【发布时间】:2017-07-23 16:18:03
【问题描述】:
编辑:更正代码。
ListBox listBox = new ListBox ();
ListBoxRow row = new ListBoxRow ();
row.add (new Label ("Test row"));
row.button_release_event.connect ((event) => {
if (event.button == 3) {
debug ("Right button clicked.\n");
}
return false;
});
listBox.add (row);
不起作用。什么都不打印。但是这个另一个工作正常
ListBox listBox = new ListBox ();
ListBoxRow row = new ListBoxRow ();
row.add (new CheckButton.with_label ("Test row"));
row.button_release_event.connect ((event) => {
if (event.button == 3) {
debug ("Right button clicked.\n");
}
return false;
});
listBox.add (row);
因为它打印调试消息。是否可以在任何区域上处理 ListBoxRow 的右键单击,无论其子项是什么?
【问题讨论】:
标签: user-interface gtk3 vala