On Jan 3, 2010, at 9:32 AM, Ed Leafe wrote:

>       I'm leaning more toward making it easier to subclass and extend uiApp, 
> like we do with other contained classes, such as grid columns, tree nodes, 
> pages, etc. This way a developer who wants to add wx-specific code can do so 
> much more easily.

        OK, it's done. There is now a dApp property named 'UIAppClass'. If you 
define a custom subclass for the UI App, it can be used instead of the base 
dabo.ui.uiApp class. Here's a sample of the subclass:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
import dabo
dabo.ui.loadUI("wx")


class MySubClass(dabo.ui.uiApp):
        def onFileExit(self, evt):
                if dabo.ui.areYouSure("You wanna exit?"):
                        super(MySubClass, self).onFileExit(evt)
                else:
                        print "ok, we'll stay around."

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

        If it were defined in your app's ui subdirectory, you'd add the line:

from MySubClass import MySubClass

...to your ui/__init__.py file to add it to the app's ui module, and then use 
it like this (assuming a typical datanav main file):

from App import App
app = App(SourceURL=remotehost, UIAppClass=ui.MySubClass)

        Jacek, try that out and let me know if you're able to get this to work 
for your barcode scanner.


-- Ed Leafe



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to