user interface - How can I align items in menu bar from right to left with using python 3 and tkinter module? -
i'm using python 3 , tkinter module creating gui. need create menu bar , align items on right left (i want use persian language need align menu items right left), have used code didn't aligned file , edit items right left , still align left right in menubar. how can deal it?
from tkinter import * tkinter import ttk root = tk() root.title('create menu bar , items') root.geometry('300x300+100+50') root.option_add('*tearoff', false) menubar = menu(root) root.config(menu = menubar) file = menu(menubar) edit = menu(menubar) menubar.add_cascade(menu = file, label = 'فایل',compound = right) menubar.add_cascade(menu = edit, label = 'ویرایش',compound = right)
use simple trick, create blank menu between itens ;-)
blankmenu = menu(menubar, tearoff=0) menubar.add_cascade(label="".ljust(130), menu=blankmenu)
Comments
Post a Comment