Murga-Projects Forums

Full Version: Subwindows
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
please can somebody tell me, how to create subwindows inside a mainwindows ?

Code:
window = fltk:Fl_Double_Window(MaxWinSizeX, MaxWinSizeY, "NXTLuaSim");
window:tooltip("NXT Lua Sim by Chrimo and friends "..version);
window:color(55);
window:align(fltk.FL_ALIGN_CENTER);
window:position(10,10);

subwindow = fltk:Fl_Window(X, Y, "NXT");
subwindow:tooltip("NXT Lua Sim by Chrimo and friends "..version);
subwindow:color(55);
subwindow:position(0,0);


Subwindows should be located inside the main window and have own coordinates...
Where is the reference or assignment to main window
Any idea ?
Thanks for supporting a rookie
Bye
Christian

I haven't done anything with embedded windows, but this seems to work:

Code:
ww=300; wh=180
w = fltk:Fl_Window(ww,wh,"Hello")
w2 = fltk:Fl_Window(ww/2,wh/2,"Hello x2"); w2:box(fltk.FL_UP_BOX)
w:add(w2)  -- <---this is the important part
w:show(); w2:show()
Fl:run()

mikshaw Wrote:
I haven't done anything with embedded windows, but this seems to work:

Code:
ww=300; wh=180
w = fltk:Fl_Window(ww,wh,"Hello")
w2 = fltk:Fl_Window(ww/2,wh/2,"Hello x2"); w2:box(fltk.FL_UP_BOX)
w:add(w2)  -- <---this is the important part
w:show(); w2:show()
Fl:run()


Much easier as I thought Big Grin

Code:
subwindow = fltk:Fl_Window(X, Y, "NXT");
subwindow:tooltip("NXT Lua Sim by Chrimo and friends "..version);
subwindow:color(55);
subwindow:position(0,0);
subwindow:parent(window) --- <==== ADDED reference to main window


Cool staff
Looking at the FLTK-Sources and Demos helps very much ;-)
Thanks
Bye
Christian

Bad news
it didn't work at MacOSX 10.4.9 (tested with PPC and Intel)
Subwindows are not visible at the main window.
Windows XP SP2 works.
This needs some more investigations
Christian

window:add(subwindow) has the same problem
Reference URL's