Re: problem resizing windows



Havoc wrote:

> Bill Purvis <bill.p@bigfoot.com> writes: 
>> I want the drawing area to be as resizeable by the user (within reasonable
>> limits). So far it's fine until you come to resize it. After a lot of 
>> hassle I eventually connected a configure_event to the main window. 
>> In this I calculate how big the drawing area can be and call 
>> gtk_drawing_area_set_size.  I also resize the scrollbars using 
>> gtk_widget_set_usize. Some of the time this works fine, but 
>> occasionally it seems to develop a loop and the window keeps 
>> resizing between two sizes. Clicking on the WM bar at the top, 
>> or on another window seems to stop the cycle, but I'm just a
>> bit confused as to what I'm doing wrong.
>> 
>> Can anyone offer any advice?
>> 
>
> What you're doing is just very strange - you shouldn't need to
> set_usize() on the scrollbars. So this probably confuses GTK pretty
> badly. I can't imagine why you set_usize() on the scrollbars?

Apologies for wating your time - as is usual, I spotted my solution
within minutes of posting the query, and sent an apology to the list.

The reason I was resizing things explicitly was because I had
misunderstood the packing options (on gtk_box_pack_start) and
found that my drawing area and sliders remained fixed in size.

After re-reading the manual, the penny dropped and I was able to
achieve what I wanted without problem. 

Thanks for the tip about using a 2x2 table, I'll give it a try
sometime soon. At present I have a vbox containing 2 hboxes,
the first with drawing area and V scrollbar, the second with
the H scrollbar and a dummy label, the latter having its size
set to match the width of the V scrollbar above it. Seems to work
fine.

Bill

-- 
+-----------------------------------------------+
| Bill Purvis, Musical Engineer                 |
| 35 Chapel Road, Penketh, Warrington, Cheshire |
| WA5 2NG. phone: 01 925 725731                 |
| e-mail: bill.p@bigfoot.com                    |
+-----------------------------------------------+





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]