GtkWindow from wxWindow GetHandle
Posted: Tue Jan 11, 2011 11:23 pm
I'm using ubuntu hardy with wxWidgets 2.8. I need to get XID from a window for image stream display, so I used the following:
wxWindow* window_;
...
GtkWidget* widget = window_->GetHandle();
XID xid = GDK_WINDOW_XWINDOW(widget->window);
This does not give any error, but no image gets shown. I tried using paint event to draw the images, and it worked. So I wonder, for the XID approach to work, is there some specific settings that I missed, or procedures to be taken for creating a window? And is wxWindow the right class?
The example codes I have (to use the XID) was in gtk, and it worked fine:
GtkWidget* drawing_area = gtk_drawing_area_new ();
...
XID xid = GDK_WINDOW_XWINDOW(drawing_area->window);
So I got another question that is there a way to get a GtkWidget pointer equivilant to the result of gtk_drawing_area_new(), out of either wxWindow or any other wxWidget class?
Thanks
wxWindow* window_;
...
GtkWidget* widget = window_->GetHandle();
XID xid = GDK_WINDOW_XWINDOW(widget->window);
This does not give any error, but no image gets shown. I tried using paint event to draw the images, and it worked. So I wonder, for the XID approach to work, is there some specific settings that I missed, or procedures to be taken for creating a window? And is wxWindow the right class?
The example codes I have (to use the XID) was in gtk, and it worked fine:
GtkWidget* drawing_area = gtk_drawing_area_new ();
...
XID xid = GDK_WINDOW_XWINDOW(drawing_area->window);
So I got another question that is there a way to get a GtkWidget pointer equivilant to the result of gtk_drawing_area_new(), out of either wxWindow or any other wxWidget class?
Thanks