maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   GTK+ window -> XID fails (https://talk.maemo.org/showthread.php?t=66812)

bonapart 2010-12-09 20:11

GTK+ window -> XID fails
 
i have GTK+ window
Quote:

HildonAnimationActor *actor;
GtkWidget *window, *drawing;
Quote:

window = hildon_stackable_window_new ();
gtk_widget_realize (window);
gtk_window_fullscreen (GTK_WINDOW(window));
Quote:

actor = HILDON_ANIMATION_ACTOR (hildon_animation_actor_new());
hildon_animation_actor_set_parent (actor, GTK_WINDOW (window));
drawing = gtk_image_new ();
gtk_container_add (GTK_CONTAINER (actor), drawing);
all looks good (window created,showed and so on). but when i try to get XID (to create EGL surface)

Quote:

XID winxid=GDK_WINDOW_XID((GdkDrawable*)(drawing));
winxid is zero
what's can be wrong?

jstokes 2010-12-09 20:47

Re: GTK+ window -> XID fails
 
I think "drawing" is not a GdkWindow; after realising it, you should call gtk_widget_get_window on it and use the XID macro on that

dannym 2010-12-10 14:27

Re: GTK+ window -> XID fails
 
realize the image.
Then:
XID winxid=GDK_WINDOW_XID(GTK_WIDGET(drawing)->window);

Note that GdkWindow is not the same as GtkWindow.


All times are GMT. The time now is 20:15.

vBulletin® Version 3.8.8