[EMAIL PROTECTED] wrote:
> Thanks for your help Greg, it works !
> I didn't know the draw_children function
> and also the way the draw_box function is used.

        The process I used was to look at what FLTK was doing
        in its draw() function for Fl_Group and Fl_Window.

        Nice thing about FLTK is in many cases you can look at
        the code and figure stuff out. Definitely helps when
        writing widgets.. for /any/ toolkit.

*** SOMETHING FOR FLTK DEVELOPMENT ***

        (I'll post this there separately)

        It definitely was harder than I thought to get a group
        to clip its children, without doing a fancy low level draw().

        Might be useful if Fl_Group had two new methods:

                clip(flag): enable/disable clipping. If enabled, by default
                it would clip to the widget's own xywh, so a group could
                be a child of a window, and children would clip within that
                region.

                clip(x,y,w,h): set the actual clip region for drawing
                children, so it can be smaller than xywh. If set, it would
                enable an fl_push/pop_clip around the draw_children() call.

        This would allow the API to easily support the opposite of an Fl_Scroll
        without the user having to derive a custom widget from Fl_Group.

        Not sure if there's hidden complexities there or not.. seems easy.
        resizing() would have to adjust the clip region (if set) similarly.
        Would hopefully only add a simple if() overhead to apps that don't
        need clipping.
        
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to