Re: GDK set_cursor
| From: | Markus Fischer | Date: | Thu, 19 May 2005 20:13:36 +0000 |
| Subject: | Re: GDK set_cursor | ||
| References: | 1 2 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-1302@lists.php.net to get a copy of this message | ||
Hi,
I wonder what I'm missing here ...
I'm calling set_cursor of GdkWindow ... not GtkWindow. GtkWindow has no set_cursor.
I cannot create a new 'GdkWindow' with 'new GdkWindow':
Fatal Error: Class GdkWindow cannot be instantiated directly.
I guess I don't know how I can access the GdkWindow of a GtkWindow?
With some testing I found out that I can get the GdkWindow of a GtkTreeView by calling get_bin_window():
$tree = new GtkTreeView($someModel);
$tree->get_bin_window()->set_cursor(new GdkCursor(Gdk::WATCH));
However this looks too specific to me. I thought there was a generalized way to retrieve the GdkWindow of any GtkWindow like it is done in the C source.
- Markus
Andrei Zmievski wrote:
Why is there no object context? I don't see anything wrong with that function. this_ptr should be filled in by the time set_cursor() is called. -Andrei On May 19, 2005, at 3:13 AM, Markus Fischer wrote:I can create a new cursor with $c = new GdkCursor(Gdk::WATCH); but I can't find a way to call gdk_window_set_cursor correctly. It's defined as GdkWindow::set_cursor but refers to 'this_ptr' in the source, when there's no object context to call it from; calling it statically fails: gdk_window_set_cursor(GDK_WINDOW(PHPG_OBJECT(this_ptr)), cursor);