Edit: corrected code.
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);
Doesn't work. Prints nothing. But this other one works fine
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);
as it prints the debug message. Is it possible to handle right clicks on the ListBoxRow on any area, regardless of what its children are?