Skip to content

Instantly share code, notes, and snippets.

@rtroe
Created March 7, 2016 10:56
Show Gist options
  • Save rtroe/aef10b7b9d26be8ec535 to your computer and use it in GitHub Desktop.
Save rtroe/aef10b7b9d26be8ec535 to your computer and use it in GitHub Desktop.
//Get wxPanel Handle (only for wxGTK/Linux)
GtkWidget* widget = panel->GetHandle();
//Required too avoid segfault happens.
gtk_widget_realize( widget );
gtk_widget_set_double_buffered(widget, 0);
//Get Window from wxPanel Handle.
Window wid = GDK_WINDOW_XWINDOW( widget->window );
XSync(GDK_WINDOW_XDISPLAY(widget->window), False);
//Create OpenCascade Window as wrapper around wxPanel Handle.
wind = new Xw_Window(aDisplayConnection, wid);
//Set Window
mView->SetWindow(wind);
if(!wind->IsMapped())
wind->Map();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment