Marking a frame as sticky

12 views
Skip to first unread message

Joril

unread,
Dec 17, 2009, 9:02:29 AM12/17/09
to wxPython-users
Hi all!
Is there a way to set the "sticky" bit for a frame/window? (=visible
on all virtual desktops)

(wxPython 2.8.9.1 under Ubuntu Jaunty)

Robin Dunn

unread,
Dec 17, 2009, 1:14:44 PM12/17/09
to wxpytho...@googlegroups.com

No, that is handled by the window manager, not the application.

--
Robin Dunn
Software Craftsman
http://wxPython.org

Joril

unread,
Dec 18, 2009, 3:06:21 AM12/18/09
to wxPython-users
On 17 Dic, 19:14, Robin Dunn <ro...@alldunn.com> wrote:
> > Is there a way to set the "sticky" bit for a frame/window? (=visible
> > on all virtual desktops)
>
> No, that is handled by the window manager, not the application.

I see, but AFAIK the application could _ask_ the WM to handle a window
as sticky, and surely e.g. GKrellm does it (it has a "set sticky
state" option).. Moreover, I see that PyGTK has a stick() method
(http://www.pygtk.org/docs/pygtk/class-gtkwindow.html#method-
gtkwindow--stick), so maybe wxPython could do it too..
I'll check for an alternative way, thanks for your time :)

Joril

unread,
Dec 18, 2009, 4:18:43 AM12/18/09
to wxPython-users
On 18 Dic, 09:06, Joril <jor...@gmail.com> wrote:
> > > Is there a way to set the "sticky" bit for a frame/window? (=visible
> > > on all virtual desktops)

For the record I came up with the following:


import gtk

def set_sticky(frame):
gdkwin = gtk.gdk.window_lookup(frame.GetHandle())
win = gdkwin.get_user_data() #
http://library.gnome.org/devel/gdk/unstable/gdk-Windows.html#gdk-window-get-user-data
while not isinstance(win, gtk.Window):
win = win.get_parent()
win.stick()


Maybe there's a quicker way, but it works nicely (at least on Xubuntu
9.04)

Steven Sproat

unread,
Dec 18, 2009, 8:48:10 AM12/18/09
to wxpytho...@googlegroups.com
Is your application linux only? You may wish to surround the code in
some try/except statement in case the user doesn't have pygtk installed
Regards,

--
Steven Sproat, BSc
http://www.basicrpg.com/

Joril

unread,
Dec 18, 2009, 9:41:50 AM12/18/09
to wxPython-users
On 18 Dic, 14:48, Steven Sproat <spro...@gmail.com> wrote:
> Is your application linux only? You may wish to surround the code in
> some try/except statement in case the user doesn't have pygtk installed

Well yes it's Linux only.. Anyway thanks for the hint :)

Reply all
Reply to author
Forward
0 new messages