Gtk/GtkD Detect release of mouse button on window resize?

微笑、不失礼 提交于 2019-12-23 18:48:38

问题


I'm trying to improve a plotting library that I wrote with GtkD (the D bindings for Gtk). Scatter plots with a lot of points take a long time to resize. I want to rescale the image, allowing pixelation, while the user is dragging the window edge to resize, and only re-render it when the mouse button is released.

Is there an API to detect whether the user is still holding down the mouse button to drag the window edge when a window is being resized? If you are not familiar with GtkD, a response in terms of the C Gtk API would still be appreciated.


回答1:


you can add a 500 millisecond timeout to the redraw (resetting the timer on each resize event) this allows a user to see a preview while dragging



来源:https://stackoverflow.com/questions/8663355/gtk-gtkd-detect-release-of-mouse-button-on-window-resize

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!