Gtk/GtkD是否检测到窗口调整大小时释放了鼠标按钮? [英] Gtk/GtkD Detect release of mouse button on window resize?

查看:113
本文介绍了Gtk/GtkD是否检测到窗口调整大小时释放了鼠标按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试改进用GtkD(Gtk的D绑定)编写的绘图库.包含许多点的散点图需要很长时间才能调整大小.我想在用户拖动窗口边缘以调整大小时重新缩放图像,以允许像素化,并且仅在释放鼠标按钮时才重新渲染它.

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.

在调整窗口大小时,是否有API可以检测用户是否仍按住鼠标按钮拖动窗口边缘?如果您不熟悉GtkD,则仍然希望使用C Gtk API进行响应.

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.

推荐答案

您可以在重绘中添加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

这篇关于Gtk/GtkD是否检测到窗口调整大小时释放了鼠标按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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