george young wrote:

[gtk-2.2.2, pygtk-1.99.16, python-2.3b2]

I want to briefly change my app's cursor to a 'watch' or some such while it's
thinking hard.  I have a zillion widgets, so it seems like changing cursor
for one of them is not likely to be right.  From the FAQ, entry 5.6:

http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq05.006.htp

I found a reference to:
  http://www.daa.com.au/pipermail/pygtk/2000-October/000435.html

wherein it's explained how to create an "input_only" window overlaying
my entire app and change that window's cursor.  Unfortunately, I can't get
this hack to work.  It calls for:

gtk.gdk_window_new(gdk_window, attribs)

but I can't figure out how to get a new gdk window. Here's the code [partially adjusted for gtk2]

 gdk_window = my_gtkwindow.get_window()
 attribs = { 'wmclass': gtk.gdk.INPUT_ONLY,
             'window_type': gtk.gdk.WINDOW_CHILD,
             'event_mask': 0,
             'x': 0,
             'y': 0,
             'width': gtk.gdk.screen_width(),
             'height': gtk.gdk.screen_height() }
 cursor_win = gtk.gdk_window_new(gdk_window, attribs)  ??????
 gdk_cursor = gtk.cursor_new(get.gdk.WATCH)
 cursor_win.set_cursor(gdk_cursor)
 cursor_win._show()


Am I completely off base here?


Note that if a window doesn't have a cursor set on it, then it will inherit its parent window's cursor (remember that almost every widget has a window, not just the toplevel gtk.Window).

So if you set the cursor on your toplevel gtk.Window, all the child widgets will inherit it too.

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to