Glade & PYGTK

2,811 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,811
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
27
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Glade & PYGTK

  1. 1. #!/usr/bin/python import pygtk import gtk pygtk.require("2.0") class Welcome: def __init__(self): self.glade = "welcome.glade" self.builder = gtk.Builder() self.builder.add_from_file(self.glade) self.window = self.builder.get_object("window1") self.lable = self.builder.get_object("label1") dic = { "on_window1_destroy" : self.exit,"on_button1_clicked":self.displaymessage} self.builder.connect_signals(dic) self.window.show() self.lable.hide() def exit(self, widget, data=None): gtk.main_quit() def displaymessage(self, widget, data=None): self.lable.show() if __name__ == "__main__": wel = Welcome() gtk.main()

×