Hi everyone!

I'm trying to develop VST plugin GUIs with FLTK. On GUI creation, the host 
tells the plugin to open(void* parentWindow), where parentWindow is a 
system-dependent window thingee (HWND on MS Windows). The plugin is now 
supposed to fill that window with its controls.

My problem is: How do I make an FLTK window a child of a given system window?

I figured that Fl_Window would be the right class to add as a child to 
parentWindow, because it's the only class with some connection to system 
windows. So here's what I do:

  dlgWnd_=new Fl_Window(0, 0, 100, 100);
  dlgWnd_->clear_border();
  // create controls...
  dlgWnd_->end();
  dlgWnd_->show();

  SetParent(fl_xid(dlgWnd_), parentWindow); // WinAPI function

Note that I use the Fl_Window constructor for child windows. SetParent() 
connects the system window handles. Still, dlgWnd_ behaves like a normal 
top-level window, except for being clipped by parentWindow. I guess it's 
because Fl_Widget::parent_ (which is an Fl_Group*) is 0. If it wasn't for 
clear_border(), it would also look like a normal top-level window trapped in 
another one (both having title bar, system menu etc). The main symptom is that 
parentWindow's title bar goes to inactive, when dlgWnd_ (or one of its 
controls) is clicked.

This kinda works, but leads to other issues, depending on level of host 
weirdness. For instance, FLTK controls are not updated until parentWindow is 
activated again.

So, how do I make an FLTK window a child of a given system window?
Thank you!

I'm using FLTK 1.1.9 on MS Windows. Another VST developer on this forum 
mentioned that his "other issues" went away when he used 2.0.x. Unfortunately, 
I wasn't able to build that version (undefined functions, unresolved 
externals)...

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to