On Feb 12, 2006, at 7:39 PM, Echo wrote:

After having lots of problems trying to use the dSplitter, I decided
to make a simple demo using dSplitter. However, I am still doing
something wrong. Anyone know what it is?

Take a look at this and let me know if it clears up any questions you might have.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"""Shows how to use the dSplitter
"""
#node: Basic controls/dSplitter
import dabo
dabo.ui.loadUI("wx")


class tSplitter(dabo.ui.dSplitter):
        def __init__(self, *args, **kwargs):
                kwargs["createPanes"] = True
                super(tSplitter, self).__init__(*args, **kwargs)

        def initProperties(self):
                self.Width = 250
                self.Height = 200
                self.MinimumPanelSize = 20

        def afterInit(self):
                self.Panel1.Sizer = dabo.ui.dSizer()
                self.Panel2.Sizer = dabo.ui.dSizer()
                
                self.edit1 = dabo.ui.dEditBox(self.Panel1)
                self.edit2 = dabo.ui.dEditBox(self.Panel2)
                
                self.Panel1.Sizer.append1x(self.edit1)
                self.Panel2.Sizer.append1x(self.edit2)

        def onSashDoubleClick(self, evt):
                if not dabo.ui.areYouSure("Remove the sash?"):
                        evt.stop()

class TestPanel(dabo.ui.dPanel):
        def afterInit(self):
                self.Sizer = dabo.ui.dSizer()
                self.mySplitter = tSplitter(self, Orientation="v")
                self.Sizer.append1x(self.mySplitter)
                        
class TestForm(dabo.ui.dForm):
        def afterInit(self):
                pnl = self.addObject(TestPanel)
                self.Sizer.append1x(pnl)
        

def runTest():
        app = dabo.dApp()
        app.MainFormClass = TestForm
        app.start()


if __name__ == "__main__":
        runTest()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




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

Reply via email to