using gdk_win32_window_foreign_new_for_display



Hey guys,

I would like to develop the GUI for a VST synth with gtk. I need to embed a gtk gui inside a win32 HWND parent window. I think "gdk_win32_window_foreign_new_for_display" could be the right function to create a GdkWindow that is embedded inside the native window. is this correct?

I tried to create a GUI thread this way:

std::thread guiThread([=]{
        auto app = Gtk::Application::create("test");
        auto settings = Gtk::Settings::get_default();
settings->set_property<Glib::ustring>("gtk-font-name","Sans 10");

        Gtk::Window window;
        window.set_default_size(400,400);
        auto disp = Gdk::Display::get_default();
auto gdkWindow = Glib::wrap(gdk_win32_window_foreign_new_for_display(disp->gobj(),(HWND)systemWindow));
        window.set_parent_window(gdkWindow);

        initApp(&window); //creating widgets
        window.show_all();
        app->run(window);
});
guiThread.detach();

"systemWindow" is a HWND given by the VST host (in my case FLStudio). Unfortunately, the window remains black, no gui drawn. I would be greatful for suggestions :)

Greetings

Tilman



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]