GTK检测窗口从用户调整大小 [英] GTK detecting window resize from the user

查看:140
本文介绍了GTK检测窗口从用户调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在GTK中(或者pygtk或者gtkmm ...)

如何检测应用程序窗口是否已被手动调整大小用户,通常是通过拖动窗口的边缘完成的?



我需要找到一种方法来区分手动调整大小和源自gtk的调整大小,例如窗口内容的更改。

解决方案

您是否尝试连接到GDK_CONFIGURE事件?




移动窗口部分下查看此示例。这个例子展示了一个回调函数,当窗口被移动时,这个回调函数是一个可以移动,调整大小和堆栈顺序的事件。


In GTK (or pygtk or gtkmm...)

How can I detect that an application window has been manually resized by the user, as is typically done by dragging the window's edge?

I need to find a way to differentiate manual resizes from resizes that originate from gtk, such as changes in window content.

解决方案

Have you tried connecting to the GDK_CONFIGURE event?

Check out this example under the "Moving window" section. The example shows a callback doing something when the window is moved, but the configure event is a catch-all for moving, resizing and stack order events.

这篇关于GTK检测窗口从用户调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆