It occurred to me to have a Widget that put a box around
itself.  In the program below, if the line marked #2
is enabled, it works as I expected, but if line #1 is
used instead, the button is invisible.  Can anyone offer
any insight?

TIA,
Stan

///////////////////////////////////////////////////////////////////////
#include <FL/Fl_Double_Window.H>
#include <FL/Fl.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Button.H>

class BoxedThing : public Fl_Group {
public:
  BoxedThing(int x, int y, int w, int h, char const* label = 0)
    : Fl_Group(x, y, w, y, label)
  {
    int const border = 5;

    // #1
    button_= new Fl_Button(x + border, y + border, 100, 20, "button");

    Fl_Box* bx = new Fl_Box(x, y, w, y);
    bx->box(FL_UP_BOX);

    // #2
    //button_= new Fl_Button(x + border, y + border, 100, 20,"button");

    end();
  }
private:
        Fl_Button* button_;
};

int main()
{
  Fl_Double_Window win(300, 300);
  new BoxedThing(50, 50, 200, 100);
  win.end();
  win.show();
  return Fl::run();
}

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

Reply via email to