GtkTreeView 的行激活和光标更改信号
我有一个树视图,我正在观察 cursor-changed
和 row-activated
信号。问题是,为了触发行激活,我首先必须单击该行(触发 cursor-changed
),然后双击,需要单击 3 次。
有没有办法通过两次点击来响应这两个信号?
I have a treeview and I am watching for the cursor-changed
and row-activated
signals. The problem is that in order to trigger the row-activate I first have to click on the row (triggering cursor-changed
) and then do the double click, requiring 3 clicks.
Is there a way to respond to both signals with 2 clicks?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
目前还不清楚你想要实现什么目标。我猜您正在尝试响应用户更改树视图中的选择。
如果是这种情况,请连接到
gtk.TreeSelection
上的[changed][1]
信号:据我所知,使用林间空地这是不可能的界面设计师。
但是,如果您完全尝试做其他事情,请添加更多信息。
It's not very clear what you're trying to achieve. I guess you're trying to respond to the user changing the selection in the treeview.
If this is the case, connect to the
[changed][1]
signal on thegtk.TreeSelection
:As far as I can tell, this is not possible using the glade interface designer.
If, however, you are trying to do something else entirely, please add some more information.
即使单击同一(选定)行,也会发出
cursor-changed
信号。尽管如此,当您双击一行时,无论是否在双击之前选择了该行,都会发出row-activated
信号。因此,您不需要点击 3 次即可触发行激活
。正如 Jon 提到的,您想要连接到选择的
changed
信号,而不是cursor-changed
。The
cursor-changed
signal is emitted even when single clicking on the same (selected) row. Still, therow-activated
signal is emitted when you double click on a row, whether it was selected before the double click or not. Thus you don't need 3 clicks to trigger arow-activated
.As Jon mentioned, you want to connect to the selection's
changed
signal in stead ofcursor-changed
.