Help calling def from class.

Posted by wtzolt on Stack Overflow See other posts from Stack Overflow or by wtzolt
Published on 2010-04-11T00:39:53Z Indexed on 2010/04/11 0:43 UTC
Read the original article Hit count: 639

Filed under:
|

Hello,

Noob question...

class msgbox:
    def __init__(self, lbl_msg = '', dlg_title = ''):
            self.wTree = gtk.glade.XML('msgbox.glade')    

            self.wTree.get_widget('dialog1').set_title(dlg_title) 
            self.wTree.get_widget('label1').set_text(lbl_msg)

            self.wTree.signal_autoconnect( {'on_okbutton1_clicked':self.done} )

    def done(self,w):
            self.wTree.get_widget('dialog1').destroy()

class Fun(object):
    wTree = None
    def __init__(self):      
        self.wTree = gtk.glade.XML( "main.glade" )
        self.wTree.signal_autoconnect( {'on_buttonOne' : self.one,} ) 

        gtk.main()

    @yieldsleep
    def one(self, widget, data=None):
        self.msg = msgbox('Please wait...','')
        yield 500
        self.msg = msgbox().done()  # <----------------???
        self.msg = msgbox('Done!','')

With this i get an error: messageBox().done() TypeError: done() takes exactly 2 arguments (1 given)

How can i make the dialog box with "please wait" to close before the second dialog box with "done" appears??

Thank you.

© Stack Overflow or respective owner

Related posts about python

Related posts about pygtk