📄 pmw_scrolledlistbox.py
字号:
from Tkinter import *
import Pmw
root = Tk()
root.option_readfile('optionDB')
root.title('ScrolledListbox')
Pmw.initialise()
box = None
def selectionCommand():
sels = box.getcurselection()
if len(sels) == 0:
print 'No selection'
else:
print 'Selection:', sels[0]
box = Pmw.ScrolledListBox(root, listbox_selectmode=SINGLE,
items=('John Cleese', 'Eric Idle', 'Graham Chapman',
'Terry Jones', 'Michael Palin', 'Terry Gilliam'),
labelpos=NW, label_text='Cast Members',
listbox_height=5, vscrollmode='static',
selectioncommand=selectionCommand,
dblclickcommand=selectionCommand,
usehullsize=1, hull_width=200, hull_height=200,)
box.pack(fill=BOTH, expand=1, padx=5, pady=5)
root.mainloop()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -