--- a/example.py Wed Feb 16 23:51:30 2011 +0100
+++ b/example.py Thu Feb 17 23:35:05 2011 +0100
@@ -4,17 +4,7 @@
import locale
locale.setlocale(locale.LC_ALL, '')
-import os
-
-from tuikit.application import Application
-from tuikit.editfield import EditField
-from tuikit.window import Window
-from tuikit.button import Button
-from tuikit.scrollbar import VScrollbar
-from tuikit.textedit import TextEdit
-from tuikit.menubar import MenuBar
-from tuikit.menu import Menu
-from tuikit.layout import VerticalLayout
+from tuikit import *
class MyApplication(Application):
@@ -25,34 +15,39 @@
menubar = MenuBar()
self.top.add(menubar)
- filemenu = Menu(['New', '-', 'Open', 'Save', '-', 'Quit'])
+ win = Window()
+ self.top.add(win)
+ win.x = 10
+ win.y = 5
+ win.allowlayout = False
+
+
+ filemenu = Menu([
+ ('New', None),
+ None,
+ ('Open', None),
+ ('Save', None),
+ None,
+ ('Quit', self.terminate),
+ ])
self.top.add(filemenu)
- filemenu.allowlayout = False
- filemenu.hidden = True
- editmenu = Menu(['Copy', 'Paste'])
+ editmenu = Menu([('Copy', None), ('Paste', None)])
+ helpmenu = Menu([('About', None)])
+
self.top.add(editmenu)
- editmenu.allowlayout = False
- editmenu.hidden = True
-
- helpmenu = Menu(['About'])
self.top.add(helpmenu)
- helpmenu.allowlayout = False
- helpmenu.hidden = True
menubar.setitems([
('File', filemenu),
('Edit', editmenu),
- ('Help', helpmenu)
+ ('Help', helpmenu),
])
vert = VerticalLayout()
self.top.layout(vert)
- #win = Window()
- #self.top.add(win)
-
#button = Button('click!')
#win.add(button)
#button.x = 10