The fastest way is to derive your own group and override the default 
resize method:

class myGroup: public Fl_Group
{
   public:

   myGroup(int X, int Y, int W, int H,const char* 
L=""):Fl_Group(X,Y,W,H,L) {}

   void resize(int X, int Y, int W, int H)
   {  // first resize as usual
      Fl_Group::resize(X,Y,W,H);
      // now make sure that the console is not smaller than the minimal         
      // height by resizing tree and viewer accordingly
      if (...) {...}
   }
};

That should do the trick.

Cheers, Herman



On 08/05/2012 07:15 PM, Cliff Yapp wrote:
>> I have a collection of widgets in a GUI, and I want those widgets to be 
>> resizable "to a point."  The general layout is:
>>
>>       Menu bar 1                        Menu bar 2
>>       ___________ _______________________________
>>      |           |                               |
>>      |  tree     |     viewer                    |
>>      |           |                               |
>>      |___________|_______________________________|
>>      |                                           |
>>      |           console (text editor, for now)  |
>>      |___________________________________________|
>>
>> The tree, viewer and console are tiled.  When it comes to horizontal 
>> resizing, I would like the console to be shrunk to some defined minimum 
>> height, and any further shrinking after the console reaches that minimum 
>> height should come out of the tree+viewer layer.
>>
>> So far, I have not been able to figure out a way to get the console window 
>> to refuse to shrink beyond a certain height.  What is the best way to do 
>> this in FLTK?  Do constraints like that need to be defined at much lower 
>> levels in widgets?  (e.g. it should be built into the eventual console 
>> widget?)
>>
>> (Sorry if this is an FAQ - I tried to search but didn't come up with much.)
>>
>> Cheers,
>> CY
>
> Beg pardon, I meant vertical resizing in the above example, not horizontal - 
> i.e. shrinking the height of the application.  Horizontal is actually also a 
> potential issue, but hasn't come up yet (though I expect it will.)
>
> CY

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

Reply via email to