[...]
> And that's the point where the FLTK developers ask you to file an STR to
> get the documentation updated/improved ...

Fair enough.

[...]
>
> To the OP: is there a problem you want to solve (which?) or did you only
> want to know what init_sizes() does ?
>

Yes, and it turns out to have nothing to do with init_sizes.
It seems that there's something fundamental about fltk that
I don't understand.

Here's an illustration.  When I run the little program below,
and shrink the window horizontally, the boxes' w() dimensions
are 100, but they are obviously drawn smaller than that.

My brain has become addled because, while trying to debug some
unexpected visual appearance in an actual application, I was relying
on dumping out the x,y,w,h geometry of some program objects, not
realizing that the actual screen dimensions were different.

It's possible that this is all an artifact of my operating
environment (X/Solaris running remotely).  If anyone could find
the time to confirm or deny this I'd certainly appreciate it.

Best,
Stan

#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl.H>
#include <algorithm>
#include <sstream>

struct MyBox : public Fl_Box {
    MyBox(int x, int y, int w, int h, char const* label = 0)
        : Fl_Box(x, y, w, h)
    {
        box(FL_DOWN_BOX);
    }

    void resize(int x, int y, int w, int h)
    { Fl_Box::resize(x, y, std::max(w, 100), h); }

    void draw()
    {
        std::ostringstream oss;
        oss << "<- " << w() << " ->";
        copy_label(oss.str().c_str());
        Fl_Box::draw();
    }
};

int main()
{
    Fl_Double_Window win(400, 200);
    MyBox* bx1 = new MyBox(50, 50, 150, 20);
    MyBox* bx2 = new MyBox(bx1->x() + bx1->w(), bx1->y(), 150, 20);
    win.end();
    win.resizable(&win);
    win.show();
    return Fl::run();
}

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

Reply via email to