Open kaesaecracker opened 6 years ago
Complete runnable source: https://gist.github.com/kaesaecracker/6263ea05b71210cc4f86c77d67987eb6
Hey @kaesaecracker, thanks for posting the issue and the repro! It is very helpful.
I'll take a look but be aware that some platforms (macOS I believe) don't let you make the top level menu items be clickable anyway, and must have a submenu.
The same problem exists with ButtonToolItems
too.
Also I googled a little bit and did not find anything about not being able to do that in Gtk.
As far as I can tell, there is no logic that forces Enabled=true. The ButtonMenuItemHandler just references Control.Sensitive which in turn just runs the GtkSharp methods.
I created a small test app using GtkSharp. Sensitive=false disables the menu item properly.
Did anything change on this yet?
Hey @kaesaecracker, no. I think your problem is that you're trying to set the Enabled property and the Command property at the same time. The Command provides the enabled state, so if you set its Enabled property instead, it should work.
Also, if you use the ButtonMenuItem's Click event instead of a Command, that would be another option.
Expected Behavior
When setting Enabled=false, I expect a ButtonMenuItem not to be clickable, especially when it is not a menu.
Actual Behavior
It is still clickable!
Steps to Reproduce the Problem
Code that Demonstrates the Problem
Specifications
NETStandard.Library 2.0 Eto.Forms 2.4.1 Eto.Platform.Gtk 2.4.1 On Ubuntu 18.04