Resizing a drawing area in GTK
My application performs a 90 degree rotat开发者_运维百科ion on a drawing area, so the width and height of the drawing area need to be swapped.
How can I resize the drawing area with GTK in a way so that the new width and height are actually enforced, not just requested?
Width/height cannot be enforced by a widget, they are determined by its container only. Widget can only request given dimension and its container will allocate the requested area or more (or even less, but all standard containers won't do this).
So, the answer would completely depend on how the area is packed and into what container. If your window (as in GtkWindow
) doesn't include anything expandable, setting it to be non-resizable mode will achieve what you want. Otherwise, please specify how the area is packed and/or what other widgets are in the toplevel.
精彩评论