[pygtk] raise reminder window

Gustavo J. A. M. Carneiro gjc at inescporto.pt
Wed Mar 29 00:32:32 WST 2006


On Ter, 2006-03-28 at 10:13 -0500, Ryan Krauss wrote:
> I am trying to learn pygtk and use it to write an application that
> will pop up a reminder window for me every 5, 10, or 15 minutes or
> whatever.  I would like this window to raise itself to the to the
> center of the current workspace so that it is visible.  I am having
> trouble learning how to do this.  I see that gtk.gdk.Window has a
> raise method, but I am trying to raise the top level gtk.Window.  It
> would also be o.k. to create a dialog and pop it up each time, but my
> first attempt at this seemd to have threading issues.
> 
> Attached is my modification of an example from Beginning Python about
> pygtk and threading.  My modification is lines 75-93.  They basically
> use a seperate thread to do the wait timer that I would need, but the
> dialog doesn't work very well.

  Use gtk.Window.present_with_time.  The "time" parameter to use should
be event.time of the gdk event you're currently handling, if any, or
zero, if not called from an event handler.

  Regards.

-- 
Gustavo J. A. M. Carneiro
<gjc at inescporto.pt> <gustavo at users.sourceforge.net>
The universe is always one step beyond logic.



More information about the pygtk mailing list