[Glade-users] how to build an application with multiple "pop up" windows

Neville C. Dempsey nevillednz.glade at 3ttechnology.com
Mon May 16 11:39:00 EDT 2005


On Mon, 2005-05-16 at 23:10, Neville C. Dempsey wrote:
> On Mon, 2005-05-16 at 22:03, y g wrote:
> > 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....
> 
> I could probably do it in 5 lines, but then it would be too crowded.

Here is the same program using python's lambda (unnamed) procedures:
#!/usr/bin/env python
# run glade-2 to create TWO windows, then TWO buttons, 
import gtk.glade;
project1=gtk.glade.XML("project1.glade");
window2=project1.get_widget("window2");
window2.hide(),
project1.get_widget("button1").connect("clicked",lambda dummy: window2.show()),
project1.get_widget("button2").connect("clicked",lambda dummy: gtk.main_quit()),
gtk.main()

4 statements....  That can be merged into just one line.

You could label the buttons, "hello world", "hello moon" to legitimise
the program.

N
-- 
Neville C. Dempsey <nevillednz dot glade at 3ttechnology dot com>



More information about the Glade-users mailing list