I’m trying to modify an existing Application to run on Linux.
I successfully added a Declare to modify the Toolbar-style so that the Application looks similar to Win/OSX.
What I can’t get to work on Linux are the ToolButtons with a DropDownMenu.
Here’s an example project: Xojo_Linux-Toolbar.zip
Am I doing something wrong regarding the “oToolButtonAdd.DropDownMenu = oSubMenu”, or the MenuItem’s Action?
Why isn’t the Action firing on Linux? If others can confirm this as a Bug in the Framework, I’ll file the appropriate Feedback-report…
Does someone know of a workaround (other than not using DropDownMenu’s in Toolbars on Linux)?
Here’s what I could come up with as a workaround for the DropDownMenu: Xojo_Linux-Toolbar_Workaround.zip
What’s missing is the “Indicator-Icon”, which could be drawn manually in the Icon…
I added the event DropDownMenuAction to Toolbar11 in Window1 and it fires under Linux here.
What version of Linux are you using?
Ubuntu 14.04 (32Bit)
I see - I didn’t notice that event. The Application is designed the way that MenuItem-Subclasses handle their actions.
On all other platforms (Carbon, Cocoa, Windows) the event “MyMenuItem.Action” fires. If it returns “true” (which it does in this example), the “Toolbar11. DropDownMenuAction” doesn’t (need to) fire.
However, it seems that “MyMenuItem.Action” never fires on Linux (at least not in this situation). Maybe that’s why the “Toolbar11. DropDownMenuAction” comes in play (but again: only for Linux in this situation).
So it seems that there are quite some things not working as expected with MenuItems on Linux.
Such as: <https://xojo.com/issue/38268>
I guess another workaround would then be to return false in “MyMenuItem.Action” (on Linux), and use “Toolbar11. DropDownMenuAction” instead (on Linux) to handle/forward the action.
Still I think that’s something that should be fixed in the Framework at some time, so that we get the same MenuItem/Toolbar-behavior on all platforms.