Greg Ercolano wrote:
>       Using that as an example, I made the following entirely within fluid;
>       should do exactly what you describe.

    Actually, the following .fl file should work better.

    The last example I designed in an older version of fluid,
    but when loaded into 1.3.x fluid, it didn't make the derived class code
    correctly if the ctor had no 'code' assigned to it. So I added an empty
    'code' to the ctor to make it work in fluid 1.3.x.

    Also, changed "redraw();" to "window()->redraw();" to ensure the label,
    which in this case draws outside the widget, draws correctly when changed.


#### SNIP #### SNIP #### SNIP #### SNIP #### SNIP #### SNIP #### SNIP #### SNIP
# data file for the Fltk User Interface Designer (fluid)
version 1.0109
header_name {.h}
code_name {.cxx}
decl {\#include <FL/Fl_Group.H>} {public global
}

class MyGroup {open : {public Fl_Group}
} {
  Function {MyGroup(int X,int Y,int W,int H,const char 
*L=0):Fl_Group(X,Y,W,H,L)} {open return_type void
  } {
    code {// empty} {}
  }
  Function {handle(int e)} {open protected return_type int
  } {
    code {int ret = Fl_Group::handle(e);
switch ( e ) {
    case FL_ENTER:
        label("At The Moment");
        window()->redraw();
        ret = 1;                // FL_ENTER: must return(1) to receive FL_MOVE
        break;
    case FL_LEAVE:
        label("ATM");
        window()->redraw();
        ret = 1;
        break;
}
return(ret);} {selected
    }
  }
}

Function {} {open
} {
  Fl_Window {} {open
    xywh {631 198 465 385} type Double visible
  } {
    Fl_Group group {
      label ATM open
      xywh {25 40 295 275} box FLAT_BOX color 41 labelfont 1 labelsize 19
      class MyGroup
    } {}
  }
}
#### SNIP #### SNIP #### SNIP #### SNIP #### SNIP #### SNIP #### SNIP #### SNIP


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

Reply via email to