Gtk/GtkD 在窗口调整大小时检测鼠标按钮的释放?
我正在尝试改进我用 GtkD(Gtk 的 D 绑定)编写的绘图库。具有很多点的散点图需要很长时间才能调整大小。我想重新缩放图像,允许像素化,同时用户拖动窗口边缘来调整大小,并且仅在释放鼠标按钮时重新渲染它。
是否有 API 可以检测在调整窗口大小时用户是否仍然按住鼠标按钮拖动窗口边缘?如果您不熟悉 GtkD,我们仍将不胜感激 C Gtk API 方面的答复。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以为重绘添加 500 毫秒的超时(在每个调整大小事件上重置计时器),这允许用户在拖动时看到预览
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