[Glade-users] [Glade-Users] Problem in window



Hi to all.

I am newbie for glade and python. I did one simple application using glade
and python in that am getting problem (i.e) when i
open the dialog box or window for first time it is opening as per code. But
second time
that dialog box or window getting blank. This is my issue.  For  example one
simple program to show the problem here is my python code and
glade file.

#python code

import sys
import gtk
import gtk.glade

class Dialog:
    def __init__(self):
        self.builder=gtk.Builder()
        self.builder.add_from_file("dialogwindow.glade")
        self.Window1 = self.builder.get_object('window1')
    self.Window2 = self.builder.get_object('window2')
    self.labelmessage = self.builder.get_object('label1')
    dic = {
                "on_window1_destroy" : self.quit,
        #"on_window2_destroy" : self.quit,
                "on_button1_clicked" : self.display
                }
    self.builder.connect_signals(dic)
        self.Window1.show()


    def display(self,widget):
        self.Window2.show()
    self.labelmessage.show()
    def quit(self,widget):
        sys.exit(0)

if __name__ =="__main__":
    dialog = Dialog()
    gtk.main()


#glade file:
http://www.filefactory.com/file/b37435d/n/dialogwindow.glade


kindly solve this issue. Is any problem in the code i need help

Thanks in advance...



-- 
With Regards,
V. Balakrishnan.

Kanchi Linux User Group Rocks !!!

http://kanchilug.wordpress.com

You can see my activities at

http://gnubala.wordpress.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20100916/a3ce592b/attachment.html 




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