I've created a Widget Class and set the class to Fl_Double_Window. I've
overwritten show(). However, if I click anywhere on the window and the
widget under the mouse doesn't use the FL_PUSH event, the show() method
is called. Is this normal?
Here's a fluid file that show (no pun intended) what I'm talking about. Compile
using:
$ fluid -c tabtest.fl
$ fltk-config --use-images --compile tabstest.cxx
Assuming you called the file tabtest.fl :)
Click on the big button and an instance of MyWindow will be created and shown.
Each time MyWindow::show() is called, a fl_message() is executed. I expected to
see the
message box only once, when I first pressed the button. However, when I click
inside
the Fl_Tab or on the Window, the message pops up indicating the show() was
called.
Thanks,
Alvin
# data file for the Fltk User Interface Designer (fluid)
version 1.0300
header_name {.h}
code_name {.cxx}
decl {\#include <FL/Fl_Shared_Image.H> // fl_register_images()} {public global
}
decl {\#include <Fl/fl_ask.H>} {public global
}
widget_class MyWindow {open
xywh {126 383 320 290} type Double resizable
class Fl_Double_Window size_range {320 290 0 0} visible
} {
Fl_Tabs {} {open
xywh {25 16 265 229} box UP_BOX selection_color 15 resizable
code0 {o->value(tab2);}
} {
Fl_Group tab1 {
label {Tab &1} open
xywh {38 34 240 205} hide
} {}
Fl_Group tab2 {
label {Tab &2} open
xywh {38 34 240 205}
} {}
Fl_Group tab3 {
label {Tab &3} open
xywh {38 34 240 205} hide
} {}
}
Function {show()} {open return_type void
} {
code {fl_message("MyWindow::show() called");
Fl_Double_Window::show();} {}
}
}
Function {} {open
} {
code {Fl::visual(FL_DOUBLE|FL_INDEX);
Fl::get_system_colors();
fl_register_images();
Fl::scheme("gtk+");
// This sets the tiny icon in the upper left corner
// Replace appicon_xpm with the variable name of the XPM to load
//Pixmap p, mask;
//XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display),
// (char**)appicon_xpm, &p, &mask, NULL);} {}
Fl_Window wnd {open
xywh {552 464 375 185} type Double visible
} {
Fl_Button {} {
label {Click to make MyWindow appear.}
callback {MyWindow *wnd2 = new MyWindow(10, 10, 320, 290, "MyWindow");
wnd2->position(wnd->x() + (wnd->w() - wnd2->w())/2, wnd->y() - (wnd->h() +
wnd2->h())/2);
wnd2->show();} selected
xywh {25 25 305 115}
}
}
}
--
Alvin
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk