Ejemplo n.º 1
0
    def start(self):
        self.hellos = 0
        self.master.title("GuiMaker Demo")
        self.master.iconname("GuiMaker")

        self.menuBar = [  # a tree: 3 pulldowns
            (
                'File',
                0,  # (pull-down)
                [
                    ('New...', 0, self.notdone),  # [menu items list]
                    ('Open...', 0, self.fileOpen),
                    ('Quit', 0, self.quit)
                ]  # label,underline,action
            ),
            (
                'Edit',
                0,
                [
                    ('Cut', -1, self.notdone),  # no underline|action
                    ('Paste', -1, self.notdone),  # lambda:0 works too 
                    'separator',  # add a separator
                    (
                        'Stuff',
                        -1,
                        [
                            ('Clone', -1, self.clone),  # cascaded submenu
                            ('More', -1, self.more)
                        ]),
                    ('Delete', -1, lambda: 0),
                    [5]
                ]  # disable 'delete'
            ),
            ('Play', 0,
             [('Hello', 0, self.greeting), ('Popup...', 0, self.dialog),
              ('Demos', 0,
               [('Hanoi', 0,
                 lambda: self.spawn(findDemoDir() + '\guido\hanoi.py', wait=0)
                 ),
                ('Pong', 0, lambda: self.spawn(
                    findDemoDir() + '\matt\pong-demo-1.py', wait=0)),
                ('Other...', -1, self.pickDemo)])])
        ]

        self.toolBar = [
            ('Quit', self.quit, {
                'side': RIGHT
            }),  # add 3 buttons
            ('Hello', self.greeting, {
                'side': LEFT
            }),
            ('Popup', self.dialog, {
                'side': LEFT,
                'expand': YES
            })
        ]
    def start(self):
        self.hellos = 0
        self.master.title("GuiMaker Demo")
        self.master.iconname("GuiMaker")

        self.menuBar = [  # a tree: 3 pulldowns
            (
                "File",
                0,  # (pull-down)
                [
                    ("New...", 0, self.notdone),  # [menu items list]
                    ("Open...", 0, self.fileOpen),
                    ("Quit", 0, self.quit),
                ],  # label,underline,action
            ),
            (
                "Edit",
                0,
                [
                    ("Cut", -1, self.notdone),  # no underline|action
                    ("Paste", -1, self.notdone),  # lambda:0 works too
                    "separator",  # add a separator
                    ("Stuff", -1, [("Clone", -1, self.clone), ("More", -1, self.more)]),  # cascaded submenu
                    ("Delete", -1, lambda: 0),
                    [5],
                ],  # disable 'delete'
            ),
            (
                "Play",
                0,
                [
                    ("Hello", 0, self.greeting),
                    ("Popup...", 0, self.dialog),
                    (
                        "Demos",
                        0,
                        [
                            ("Hanoi", 0, lambda x=self: x.spawn(findDemoDir() + "\guido\hanoi.py", wait=0)),
                            ("Pong", 0, lambda x=self: x.spawn(findDemoDir() + "\matt\pong-demo-1.py", wait=0)),
                            ("Other...", -1, self.pickDemo),
                        ],
                    ),
                ],
            ),
        ]

        self.toolBar = [
            ("Quit", self.quit, {"side": RIGHT}),  # add 3 buttons
            ("Hello", self.greeting, {"side": LEFT}),
            ("Popup", self.dialog, {"side": LEFT, "expand": YES}),
        ]
Ejemplo n.º 3
0
 def pickDemo(self):
    pick = self.selectOpenFile(dir=findDemoDir()+'\guido')
    if pick:
Ejemplo n.º 4
0
 def pickDemo(self):
     pick = self.selectOpenFile(dir=findDemoDir() + '\guido')
     if pick:
         self.spawn(pick, wait=0)  # spawn any python program
 def pickDemo(self):
     pick = self.selectOpenFile(dir=findDemoDir() + "\guido")
     if pick:
         self.spawn(pick, wait=0)  # spawn any python program