When i use callback the button which i put it in the group of tab
does not work. However, without tab the button call function properly

here the code :


//Start Group of Images (boxes and display)
        Fl_Tabs *tabs = new Fl_Tabs(10,25,window_width-20,700-30);

        {
            // Aaa tab
            Fl_Group *Connection_Tab = new Fl_Group(30,50,800-20,700-45,"Check 
Connection");
            {


            }
            Connection_Tab->end();

              // Control Robot tab
            Fl_Group *Control_Tab = new Fl_Group(30,50,800-10,700-35,"Control 
Robot");
            {

                          // exit button

                   Fl_Button *exit_button;
               exit_button = new 
Fl_Button(display_x1+display_width+display_height+45*BORDER,40+ 
exit_y,button_size_x,button_size_y,"Exit");
               exit_button->callback(acquire_firefly_stereo_image_exit_cb);
                   exit_button->labelfont(FL_HELVETICA_BOLD);
               
exit_button->labelcolor(fl_color_cube(128*FL_NUM_RED/256,256*FL_NUM_GREEN/256, 
0*FL_NUM_BLUE/256));
                   exit_button->labelsize(12);
                   exit_button->box(FL_PLASTIC_UP_BOX);


               // Acquire on button

               Fl_Light_Button *acquire_button;
               acquire_button = new 
Fl_Light_Button(display_x1+display_width+display_height+45*BORDER,60,button_size
_x,button_size_y,"Start");
               
acquire_button->callback(acquire_firefly_stereo_button_cb);//this callback 
doesnot work
                   acquire_button->value(0);
                   acquire_button->type(FL_TOGGLE_BUTTON);
                   acquire_button->labelsize(12);
                   acquire_button->align(FL_ALIGN_CENTER);
                   acquire_button->labelfont(FL_HELVETICA_BOLD);
                   
acquire_button->labelcolor(fl_color_cube(64*FL_NUM_RED/256,100*FL_NUM_GREEN/256,
 0*FL_NUM_BLUE/256));
                   acquire_button->box(FL_PLASTIC_UP_BOX);
                   button = acquire_button; // global copy to allow other 
callbacks access to it e.g. exit_cb so it can call it to stop image acquisition

              // box to frame image
              box1 = new Fl_Box(display_x1-BORDER+50,460-BORDER,
                  display_width-30+2*BORDER,display_height-20+2*BORDER,"" );
              box1->box(FL_DOWN_BOX);
              box1->align(FL_ALIGN_BOTTOM | FL_ALIGN_CENTER);
                  box1->labelsize(12);

              box2 = new Fl_Box(display_x2-BORDER+50,460-BORDER,
                  display_width-30+2*BORDER,display_height-20+2*BORDER,"" );
              box2->box(FL_DOWN_BOX);
              box2->align(FL_ALIGN_BOTTOM | FL_ALIGN_CENTER);
                  box2->labelsize(12);

                  box3 = new 
Fl_Box(display_x1-BORDER+50,60,35+display_width+display_height+10*BORDER,390,"" 
);
              box3->box(FL_DOWN_BOX);
              box3->align(FL_ALIGN_BOTTOM | FL_ALIGN_CENTER);
                  box3->labelsize(12);

              // image display

              display1 = new dvr_display(display_x1+50, 460,
                                 display_width-30,display_height-20);

                  display2 = new dvr_display(display_x2+50, 460,
                                 display_width-30,display_height-20);


                 display3 = new dvr_display(display_x1+50,60,
                          (display_width*2)-8,display_height+display_height-92);

                         //display stutus of button what buttons are clicked

                 text_output = new Fl_Multiline_Output(text_output_x, 
text_output_y, text_output_width, text_output_height,"Serviced Robot Info" );
             text_output->align(FL_ALIGN_TOP | FL_ALIGN_CENTER );
             text_output->labelsize(12);
             text_output->textsize(11);
             text_output->value("");
             text_output->box(FL_PLASTIC_DOWN_BOX);
            }
            Control_Tab->end();
        }
        tabs->end();


_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to