On 10/14/11 14:11, David wrote:
> Is there something equivalent to a Windows group box
> where the frame is drawn
You can change the border on widgets with box().
This includes groups and window-in-windows.
So in the example I posted in that other thread,
win2.box(FL_THIN_BORDER_BOX); would make a black line
border.
> and the text label is printed
> on top of the frame at top left?
Normally align(FL_ALIGN_LEFT) would be used to
position the label, but in the case of a window-in-window,
it seems like the label() isn't showing at all, which might
be a bug with that usage of windows.
Instead, make a group and set its label() and align()
to what you want, then put a window inside the group
that's the same position/dimension to get the border
and coordinate behavior you want, eg:
#include <FL/Fl.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
int main() {
Fl_Window win1(400,400,"Win1"); // a window that's
400x400
win1.begin();
Fl_Group grp1(100,100,200,200,"Grp1"); // group to get desired
label()
grp1.align(FL_ALIGN_TOP_LEFT); // label alignment
grp1.begin();
Fl_Window win2(100,100,200,200); // window-in-a-window
(for relative coords)
win2.box(FL_BORDER_BOX); // type of border to
use for window
win2.begin();
Fl_Button but(10,10,140,25,"Button");
win2.end();
grp1.end();
win1.end();
win1.show();
return(Fl::run());
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk