On Nov 13, 2007, at 1:04 PM, Richard Penman wrote:

> hi,
>
> I have a Fl_Pack in a FL_Scroll to form an image browser. My problem  
> is when I resize it vertically the images get stretched vertically.


Assuming you have a horizontal Pack, the Pack will always stretch  
vertically. That's what it was designed to do. You can either rewrite  
the "resize()" function of Pack, or you can add another group level  
inside Pack, for example:


scr = new Fl_Scroll(10, 10, 100, 100);
scr->begin();
   pck = new Fl_Pack(10, 10, 100, 100); // fill the scroll
   pck->begin();
   for (i=0; i<20, ++i) {
     grp = new Fl_Group(10+i*20, 10, 20, 100); // this will fill the  
Pack
         // with invisible widget groups
     grp->begin();
       img = new Fl_Box(FL_UP_BOX, grp->x(), grp->y(), grp->w(), 50);
           // creates 50 pixel high poxes at the top of the group
       filler = new Fl_Box(FL_FLAT_BOX, grp->x(), grp->y()+50, grp- 
 >w(), grp->h()-50);
           // creates a filler pieces that does all the resizing
       grp->resizable(filler);
           // now your img will never change size
     grp->end();
   }
   pck->end();
scr->end();


----
http://robowerk.com/


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

Reply via email to