Re: Resizing drawing area



Cyrus Patel <cyrusp cia com au> writes:
However, I changed it and now have a fixed container with the
drawing area put inside it. But how can I resize the drawing area
when the fixed container is resized?

Connect to size_allocate and set the size of the drawing area
(gtk_drawing_area_size()) in there, may work. (Unless it creates an
infinite loop, which is possible, I'm not sure.)

The whole point of GtkFixed is to disable all GTK's automatic sizing
intelligence and take over yourself. If you want smart resizes, you
might try GtkTable for example.

I tried connecting the size_allocate signal to the fixed container -
that calls a function fixed_container_resized when the fixed area is
resized. In the fixed_container_resized function I called

gtk_container_resize_children(GTK_CONTAINER(fixed));                                                        
           
but this doesn't seem to work. Any ideas why?                                                               
           

That's an internal function that you don't want to use. (But why would
you expect it to magically pick the size you want for the drawing area
- it doesn't take a size argument or
anything. gtk_container_do_what_i_mean() ;-))

Havoc




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