Murga-Projects Forums
Subwindows - Printable Version

+- Murga-Projects Forums (http://www.murga-projects.com/forum)
+-- Forum: Project Forums (/forumdisplay.php?fid=1)
+--- Forum: MurgaLua - General (/forumdisplay.php?fid=2)
+--- Thread: Subwindows (/showthread.php?tid=41)


Subwindows - chrimo - 06-07-2007 01:14 AM

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


RE: Subwindows - mikshaw - 06-07-2007 02:45 AM

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()




RE: Subwindows - chrimo - 06-07-2007 03:20 AM

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


RE: Subwindows - chrimo - 06-07-2007 04:47 AM

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