> Jiang Yang wrote:
>
> > Hi,
> > thanks for your reply.
> >> By using the ::add() method....
> >>
> >>
> >> Fl_Box *b =3D new Fl_Box....
> >>
> >> my_window->add(b);
> > what do you mean the parameter 'my_window'??
> > I tried this in my callback function, but still not work.
> >>
> >
> > Thanks, i am new to FLTK.
> > So look forward to receiving your assistances.
> >
> > cheers,
> > Yang
> >
> >
> >
> >>
> >> > > Fl_Check_Button* flcb =3D3D ((Fl_Check_Button*)w);
> >> > > if ( flcb->value() =3D3D=3D3D 1 ) {
> >> > > flcb->labelcolor(FL_RED);
> >> > > flcb->label("Label&Scale");
> >> > > new Fl_Box(0, 20, 1000, 20, " first ");
> >> > > new Fl_Box(0, 640, 1000, 20, " second ");
> >> > > new Fl_Box(0, 660, 1000, 20, " third ");
> >> >=20
> >> >=20
> >> > How could I add these three new Box classes to the parent window???
> >>
> >>
> >> By using the ::add() method....
> >>
> >>
> >> Fl_Box *b =3D new Fl_Box....
> >>
> >> my_window->add(b);
> >>
> >>
> >> This is covered in the docs, so a little reading might bring further
> >> enlightment.
>
> Call your parent window 'my_window'. Then wrap your 'new Fl_Box' statements
> with my_window->begin() and my_window->end(). For example:
>
> my_window->begin();
> {
> new Fl_Box ...
> new Fl_Box ...
> new Fl_Box ...
> }
> my_window->end();
>
>
> --
> Alvin
Hi ,
thanks you guy's reply.
how can I call my parent window??
I list my sample code here.
According to my program, please give me some assistances.
This is very helpful to a beginner.
the code in is below,
void setrowheader_cb(Fl_Widget* w)
{Fl_Check_Button* flcb = ((Fl_Check_Button*)w);
if ( flcb->value() == 1 ) {
flcb->labelcolor(FL_RED);
flcb->label("aa");
"££££" //how can i call my parent window here???? 'w' is a Button
widget here.
££££->begin();
new Fl-Box....
new Fl_Box....
££££->end();
}
int main(int argc, char **argv) {
Fl_Double_Window* w;
Fl_Double_Window* o = new Fl_Double_Window(1000, 700, "");
w = o;
Fl_Check_Button* labelandscale= new Fl_Check_Button();
labelandscale->box(FL_UP_BOX);
labelandscale->down_box(FL_DOWN_BOX);
labelandscale->labelcolor((Fl_Color)1);
labelandscale->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
labelandscale->callback(setrowheader_cb);
....
....
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk