[pygtk] raise reminder window
Gustavo J. A. M. Carneiro
gjc at inescporto.pt
Wed Mar 29 02:25:44 WST 2006
On Ter, 2006-03-28 at 13:18 -0500, Ryan Krauss wrote:
> This mostly works. It makes the window flash in the toolbar, but
> doesn't raise it above non-pygtk windows on my screen.
Yes, that makes sense. Since GNOME 2.12 or 2.10 or similar the window
manager makes a distinction between windows appearing in response to a
user command, like pressing a button, or windows appearing
asynchronously, like an instante message popup. In the latter case, it
would happen as you describe. There might be another API to make it
work in the first case, I'm not sure. In any case, I'm sure Elijah
Newren announced something to this respect in gnome desktop devel list,
so if you search the archives you might find something useful there.
Regards.
>
> On 3/28/06, Gustavo J. A. M. Carneiro <gjc at inescporto.pt> wrote:
> > 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.
> >
> >
--
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