Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #51351 > unrolled thread

Re: Cross-Platform Python3 Equivalent to notify-send

Started byChris Angelico <rosuav@gmail.com>
First post2013-07-27 13:47 +0100
Last post2013-07-27 13:47 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Cross-Platform Python3 Equivalent to notify-send Chris Angelico <rosuav@gmail.com> - 2013-07-27 13:47 +0100

#51351 — Re: Cross-Platform Python3 Equivalent to notify-send

FromChris Angelico <rosuav@gmail.com>
Date2013-07-27 13:47 +0100
SubjectRe: Cross-Platform Python3 Equivalent to notify-send
Message-ID<mailman.5166.1374929275.3114.python-list@python.org>
On Sat, Jul 27, 2013 at 1:22 PM, Devyn Collier Johnson
<devyncjohnson@gmail.com> wrote:
> That really sucks. I was hoping Python had some way of doing that. All that
> it needs to do is display a little box at one of the corners of the screen.
> I thought someone would have implemented something by now. Thank you anyway.

Despite the best efforts of a pretty talented core dev team, Python is
not yet capable of magic :) If you browse the python-dev archives,
you'll see how much of a nightmare cross-platform compatibility can be
(eg the recent discussion on cloexec and passing file descriptors to
subprocesses); often, what you might think (from a user's point of
view) is fairly trivial will turn out to be quite tricky.

That said, though, a lot of GUI toolkits will have a means for you to
highlight a window. In GTK, it's called "present" (as in, "Lord User,
may I present Sir Window and Mrs Window?"). There may be window
managers that don't support the feature (and there are certainly those
that let the user disable it, which you should respect), but AFAIK all
of them should at least accept the command.

http://www.pygtk.org/docs/pygtk/class-gtkwindow.html#method-gtkwindow--present

So your best bet may be to simply create yourself a small window, then
present it. On Windows XP, I think that'll flash the window in the
task bar, which is usually enough highlight. On my Debian Wheezy with
Xfce, it brings the window to the top of the Z-order, and optionally
moves it to the current workspace (user's option, NOT program's).

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web