[Glade-users] How-to define my own class inheriting from gtk.Window and using glade file



Hello all!

I'm using Glade with PyGTK (Python 2.6) and I'm quite happy about the
results. I succeed to define an application class like this:

class MyApp:

def __init__( self ):

Builder = gtk.Builder()
Builder.add_from_file( 'filename' )
Builder.connect_signals( self )

self.__MainWnd = Builder.get_object( 'MainWnd' )

etc...

But here is what I want to do: creating a class that derives from gtk.window
and being the main window defined within Glade.

class MyWnd( gtk.Window ):

def __init__( self, ??? ):

...

Here I want that the object returned by Builder.get_object( 'MainWnd' ) be
the object created by the actual class MyWnd because this class is in fact a
gtk.Window.

Is my explaination clear?

Maybe it is not possible this way and I have to create manually my own
gtk.Window then grab the VBox/HBox/Table with Builder.get_object() and add
it to my window. But it is not that cute.

Any idea will be welcome and thanks in advance!

-- 
*Dominique Beauchamp*
lgd.beauchamp at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20110405/a8028702/attachment.html 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]