[pygtk] Attempting modal window in win32

Volker Helm Helm.volker at gmx.de
Wed May 2 19:25:20 WST 2007


It does work!

you can select or edit something in the parent window! But it isn't nice that you can activate the parent window!

# Start test.py
import gtk

w1 = gtk.Window(gtk.WINDOW_TOPLEVEL)
w1.connect('delete_event', lambda w, e: gtk.main_quit())

w2 = gtk.Window(gtk.WINDOW_TOPLEVEL)
w2.set_transient_for(w1)
w2.set_modal(True)
w2.set_property('skip-taskbar-hint', True)


vb = gtk.VBox()
w1.add(vb)
b = gtk.Button('Open Modal')
b.connect('clicked', lambda w: w2.show_all())
vb.pack_start(b)
l = gtk.Entry()
l.set_text('Test')
vb.pack_start(l)

w1.show_all()

gtk.main()
# End test.py

In this test you can't edit the Entry if the child is present.

Bye,

Volker

-------- Original-Nachricht --------
Datum: Tue, 01 May 2007 20:28:07 -0400
Von: El Croata <el.croata at gmail.com>
An: pygtk at daa.com.au
Betreff: [pygtk] Attempting modal window in win32

> Hi,
> 
> I've trying to perform a modal window in win32, but it doesn't work. I 
> wrote an app for better explanation of the case:
> 
> # Start test.py
snip
> # End test.py
> 
> 
> The steps for performing the case were:
> 
> 1) Run "python test.py"
> 2) Click on button "Open Modal"
> 3) Switch to any other app, clicking in the win taskbar
> 4) Switch back to the python app, clicking in the taskbar
> 
> Diagnosis: When siwtching back to the python app, it only shows the 
> parent window, insted of showing both windows with the child over its
> parent
> 
> Versions: Python 2.4.4, PyGTK 2.8.6, PyCairo 1.0.2
> 
> It seems like I'm missing a little detail... thanks!
> Of couse, in Linux it runs as expected, but I can't change the OS :(
> 
> --
> Regards,
> Cro
> 
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail


More information about the pygtk mailing list