Mike Werner wrote:
> I would like to replace those 3 letters with the words they stand for
> whenever the mouse goes into the box.  I would like this to happen 
> automatically
> without any clicking being done.

        You probably want to look for the FL_ENTER and FL_LEAVE events.
        You'd have to derive a class, eg. "MyGroup" from the Fl_Group.

> Can this be done from within the Fluid 'Extra Code' area,
> or the 'Callback' definition area? 

        If you derive a group, just set the Class: for the actual
        widget in your layout (in fluid's properties) to the name
        of your derived group, eg. MyGroup. See example below.

> I'd rather not get into writing my own 'handler' function.

        Can't avoid that, I don't think.

> I'm not seeing how to do this in the reference.

        Here's an example of how to watch mouse movement
        without clicks. (I used this for reference for the below):
        http://seriss.com/people/erco/fltk/#DrawCoords

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

#### 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>} {selected public global
}

class MyGroup {open : {public Fl_Group}
} {
  Function {MyGroup(int X,int Y,int W,int H,const char *L):Fl_Group(X,Y,W,H,L)} 
{open return_type void
  } {}
  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");
        redraw();
        ret = 1;                // FL_ENTER: must return(1) to receive FL_MOVE
        break;
    case FL_LEAVE:
        label("ATM");
        redraw();
        ret = 1;
        break;
}
return(ret);} {}
  }
}

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