buzztrax icon indicating copy to clipboard operation
buzztrax copied to clipboard

GTK4: Get the Menu Bar actions working

Open dlbeswick opened this issue 1 year ago • 2 comments

#133

Please take a look at this: https://docs.gtk.org/gtk4/actions.html

In previous versions of GTK, logic around menu actions and popups was done via widget signals, and so this logic tended to live inside the widgets that made use of them.

In GTK4, whenever we see popup menu actions or accelerators, they should be implement by creating actions. In many cases it's appropriate to actually move these actions closer to objects implementing the program or at least application logic rather than the UI logic. I would guess that almost all of the actions in the main menu are better moved to BtEditApplication.

dlbeswick avatar Feb 05 '24 11:02 dlbeswick

I would guess that almost all of the actions in the main menu are better moved to BtEditApplication.

Wouldn't that just become a giant class then?

ensonic avatar Feb 05 '24 20:02 ensonic

I suspect it'll be fine... The set of application-level actions are fairly limited (like File/Open) and there are still a quite big set of actions that are appropriately handled in the UI controls. Those are things like updating zoom levels in machine view, etc.

Of course, if it gets large then one possibility is to break it out into something like a BtAppActionsHandler.

Message ID: @.***>

dlbeswick avatar Feb 05 '24 21:02 dlbeswick