Re: problem resizing windows



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?

I would do this as a simple GtkTable, or else use GtkScrolledWindow. 
In the GtkTable of course you need a 2x2 table where the drawing area
is attached in cell 0, 0 and the horizontal bar is on the bottom in
cell 0, 1 and the vertical bar on the left in 1, 0. If you set the
table packing right there should be no need to set_usize().

(In general, set_usize() should be rarely used...)

Havoc





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