On 16 Aug 2009, at 10:07, Meir wrote:
> Hello all
> im trying to do simple thing
> placing a button on top of box , this box is one on the two parts
> of a tile object i did it with the fluid tool
> the tile is working great but as you can see the button can't be
> moved with the right tile when i resize it what im doing wrong here ?
Well, the first thing you did wrong was post an example that is
incomplete and does not compile!
If you want help, you will get a lot more feedback if you make it as
easy as possible for others to contribute, and posting compileable
examples is a prerequisite for that.
Ranting on my part aside, the main issue is that you really need to
make the child widgets of the tile group widgets, so that they can
then contain other widgets (such as your button).
A simple box can not contain other widgets, so fltk can not tell that
you intend the button to be "inside" the box...
Here's a reworked, compileable, example that does what I think you
intended:
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Tile.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Button.H>
Fl_Double_Window* make_window();
Fl_Double_Window* make_window() {
Fl_Double_Window* w;
{ Fl_Double_Window* o = new Fl_Double_Window(400, 283);
w = o;
{ Fl_Tile* o = new Fl_Tile(10, 5, 380, 260);
o->box(FL_FLAT_BOX);
o->color((Fl_Color)5);
{ Fl_Group* g = new Fl_Group(10, 5, 190, 260);
g->box(FL_FLAT_BOX);
g->color((Fl_Color)30);
g->end();
} // Fl_Box* o
{ Fl_Group* g = new Fl_Group(200, 5, 190, 260);
g->box(FL_FLAT_BOX);
g->color((Fl_Color)20);
g->begin();
{ Fl_Button* o = new Fl_Button(265, 40, 100, 110);
o->color((Fl_Color)177);
} // Fl_Button* o
g->end();
} // Fl_Box* o
o->end();
} // Fl_Tile* o
o->end();
} // Fl_Double_Window* o
return w;
}
int main (int ac, char **av)
{
Fl_Double_Window* w = make_window();
w->show(ac, av);
return Fl::run();
}
/* end of file */
--
Ian
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk