OSDN Git Service

Update view of stack at start.
[joypy/Thun.git] / trylb.py
1 from Tkinter import Tk, mainloop, BOTH
2 from joy.gui.controllerlistbox import ControllerListbox
3
4
5 class StackListbox(ControllerListbox):
6
7     def _update(self):
8         self.delete(0, 'end')
9         self.insert(0, *self.stack)
10
11     def dnd_commit(self, source, event):
12         ControllerListbox.dnd_commit(self, source, event)
13         self._update()
14
15     
16 T = Tk()
17 T.title("Hello there.")
18 stack = [1, 2, 3]
19 lb = FooListbox(T, items=stack)
20 lb.pack(expand=True, fill=BOTH)
21 lb._update()