Bug 36476 - Missed property int Gtk.Menu.active
Summary: Missed property int Gtk.Menu.active
Alias: None
Product: Gtk#
Classification: Mono
Component: gtk-sharp ()
Version: 2.x
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Marius Ungureanu
Depends on:
Reported: 2015-12-02 18:58 UTC by konkor
Modified: 2017-06-15 01:33 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 36476 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description konkor 2015-12-02 18:58:51 UTC
Cannot determinate the index of the currently selected menu item. 
U had lost implementation of the “active” property GtkMenu:

 “active”                   gint


U have only implementation for gtk_menu_get_active function:
GtkWidget *
gtk_menu_get_active (GtkMenu *menu);

If u have any FIX "int Gtk.Menu.active", how determinate active/selected/pressed index 
of MenuItem in dynamic menu, please tell me...
Comment 1 konkor 2015-12-02 22:33:13 UTC
I have found a workaround for this BUG. It is a Custom MenuItem Widget. But this is not good for C-sharp popularity on Linux.

public class CustomMenuItem : ImageMenuItem
		private long i;

		public CustomMenuItem (string name, long i = -1L) : base (name)
			this.i = i;

		public Long Value {
			get { return i; }
Comment 2 Marius Ungureanu 2017-06-15 01:33:15 UTC
This is because the "active" property was added in 2.14, and the gtk# bindings for 2.12 are compliant with 2.12 Gtk# only. This will be automatically fixed when gtk# will target newer versions.