Hi,

I've been trying to figure out how to modify the decorations of a window 
depending on whether a child widget has the focus or not. If you have VS2009 
you may have noticed that the title bar color of the currently active window 
changes. This is what I am trying to emulate. Below is what I've tried so far, 
but it doesn't work and I'm not sure why.

class MyWindow : public Fl_Group
{
  // some stuff ...
  int handle(int nevent);
};

int MyWindow::handle(int nevent)
{
  int nret = Fl_Group::handle(nevent);

  switch (nevent)
  {
    case FL_FOCUS:
       if (nret == 1)
       {
          // change decorations to indicate a child has the focus
       }
       break;
    case FL_UNFOCUS:
       // change decorations to indicate a child does not have the focus
       break;
  }

  return nret;
}

It seems that the code never reaches the if-statement and I don't understand 
why. I hope my explanation is clear enough. Any advice on why this is not 
working or any alternative suggestions how to solve this problem would be 
greatly appreciated.

Cheers,

Steve.

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

Reply via email to