Web lists-archives.com

Re: using gdk_win32_window_foreign_new_for_display




I STRONGLY, STRONGLY recommend that you do NOT use GTK or any other desktop GUI toolkit for an audio plugin UI.

It is extremely problematic. Doing so on Windows is likely to cause even more problems than it does on Linux.

Please don't do it.

Mea culpa: I don't have a clearly better suggestion for you.

On Thu, Jan 12, 2017 at 3:20 PM, Tilman K. <tkoss@xxxxxxxxxxxxxx> wrote:
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

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list