开发者

Resizing a drawing area in GTK

开发者 https://www.devze.com 2022-12-31 07:27 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消