zigbert wrote:...
When it comes to right-click-menu, it suffers from rigid selection mode in <table>. You have to first select the row with a left-click before clicking right button to show the menu. Not the best usability... - But worst, <action> HAS TO be executed before <action signal="button-press-event">
With the table widget, left-click de/selects rows, the right mouse button does nothing except fire signals. The table widget does not utilise the right mouse button so it has no effect on the contents of the table.
if [ "$TABLE" ]; then will be false if nothing is selected so if you want to show the menu whether there's something selected or not then remove that code.
Gtk is responsible for the order that signals are fired and this is what happens when clicking on a table row and selecting it:
Code: Select all
button-press-event
button-release-event
select-row
... so that's the order that actions using those signals will be executed.
I made a couple of modifications to your menu code and I got something that mimmicks the behaviour you'd expect from a pop-up menu:
Remove
if [ "$TABLE" ]; then.
Add
modal="true" to the window tag because currently it's not receiving the focus:
So now you've got a simulated menu pop-up on table right-click that closes when it loses the focus. If you want to modify the contents of the menu based upon the table's selected rows then that information will be in $TABLE.
Regards,
Thunor