[Glade-users] how to build an application with multiple "pop
up" windows
Neville C. Dempsey
nevillednz.glade at 3ttechnology.com
Mon May 16 11:10:00 EDT 2005
On Mon, 2005-05-16 at 22:03, y g wrote:
> hi there, i am beginning learning gtk and glade... and apologies for
> such a basic question but i ve been looking to a few tutorials and
> havent found an answer to the following... i want to create an
> application with multiple popup windows...
I was pointed at:
http://www.pygtk.org/pygtk2tutorial/ch-GettingStarted.html
http://www.async.com.br/faq/pygtk/index.py?req=index
> an easy way to illustrate that is let's just say i have window1 with
> just one button which when you click it it shows window2 which has a
> form and an ok button to close it.... now as there quite a few
> questions that i have is there anywhere some documentation about
> this....
#!/usr/bin/env python
# run glade-2 to create TWO windows, then TWO buttons,
# then save as project1
import gtk.glade
project1=gtk.glade.XML("project1.glade")
window2=project1.get_widget("window2")
window2.hide()
def on_button1_clicked(widget):
window2.show()
button1=project1.get_widget("button1")
button1.connect("clicked",on_button1_clicked)
def on_button2_clicked(widget):
gtk.main_quit()
button2=project1.get_widget("button2")
button2.connect("clicked",on_button2_clicked)
gtk.main()
I could probably do it in 5 lines, but then it would be too crowded.
--
Neville C. Dempsey <nevillednz dot glade at 3ttechnology dot com>
More information about the Glade-users
mailing list