Hi,

in this sample app I want to delete or somehow hide the list box when the user 
presses Escape.
How do I achieve that?

adi


import dabo

app = dabo.dApp(MainFormClass=None)
app.setup()

class TestForm(dabo.ui.dForm):
        def afterInit(self):
                choices = ('aaaa','bbbb')
                self.lb = self.addObject(dabo.ui.dListBox, Choices=choices)
                self.lb.bindEvent(dabo.dEvents.KeyDown, self.OnKeyEvent)
                self.lb.Position = (10,10)
                
        def OnKeyEvent(self, evt):
                isinstance(evt, dabo.dEvents.KeyDown)
                if evt.GetKeyCode() == dabo.ui.dKeys.key_Escape:
                        # how to get rid of this ListBox
                        self.lb = None

app.MainForm = TestForm()
app.start()


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to