> > hello,
> >
> > I have a set of image thumbnails that I want to scroll along horizontally 
> > as well as expand when the window is resized. When I use a Fl_Scroll I can 
> > scroll them nicely but they do not resize when the scroll resizes. If I 
> > place the images in a Fl_Pack they do resize, but then of course I lose the 
> > scroll functionality.
> > So how can I combine these 2 functionalies?
> >
> > Do I need to manually detect a window resize and respond?
> > If so how should I detect this event? I didn't see an event for it so 
> > currently I check the window size during draw() to see if it has changed, 
> > which feels awkward.
> >
> > thanks, Richard
>
> You can inherit Fl_Scroll and override resize(X,Y,W,H) method. Each time
> window (and thus your scroll group widget) resizes, resize() will be
> called with new values.
>
> I would advise calling Fl_Scroll's resize too (in overriden method) so 
> scrollbars
> can be nicely updated.
>
> --
> Sanel

overriding resize() is working well - thanks for the advice.

For the resize I use:
pack->resize( x(), y(), pack->w(), h() - 17 );

I found that 17 is the offset required to leave room for the scroll bar. Is 
this value defined somewhere?


Ian:
> You do have to watch out though - depending on how the window manager
> handles resizing (e.g. if it shows the content changing while resizing)
> you might do an awful lot of work scaling the images during the drag -
> sometimes it is betetr to wait until the drag has stopped and just do
> all the rescaling once at the final size...

for now it is responsive enough with a few thumbnails, but I will keep this in 
mind.


Duncan:
> Does this example from Greg's Cheat Sheet meet your needs?
> http://seriss.com/people/erco/fltk/#ScrollableWidgetBrowser

ah I forgot about this excellent resource

Richard

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

Reply via email to