gtk.Window.present()



gtk.Window.present() does not seem to do a very good job of presenting windows (at least using Metacity as my WM (Ubuntu Edgy))

For example, run the code below. Click OK on the first message and then maximize some previously minimized window before the 5 seconds is up. Now the second message is hidden behind this window and requires hunting around minimizing stuff to find.


import gtk,time

dlg=gtk.MessageDialog(buttons=gtk.BUTTONS_OK,message_format='Beginning long task')
dlg.present()
dlg.run()
dlg.hide()
while(gtk.events_pending()): gtk.main_iteration(False)
                
time.sleep(5)   #long task

dlg2=gtk.MessageDialog(buttons=gtk.BUTTONS_OK,message_format='The task finished')
dlg2.present()
dlg2.run()


Either I am misunderstanding what present() is supposed to do - most likely, in which case how should I make sure my dialog doesn't get lost?
Or, this is a bug in GTK or Metacity.



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