Exemplo n.º 1
0
        public MenuTracker(Gtk.MenuTrackerItem item, string link_name, bool merge_sections, bool mac_os_mode, Gtk.MenuTrackerInsertFunc insert_func, Gtk.MenuTrackerRemoveFunc remove_func)
        {
            IntPtr native_link_name = GLib.Marshaller.StringToPtrGStrdup(link_name);

            GtkSharp.MenuTrackerInsertFuncWrapper insert_func_wrapper = new GtkSharp.MenuTrackerInsertFuncWrapper(insert_func);
            GtkSharp.MenuTrackerRemoveFuncWrapper remove_func_wrapper = new GtkSharp.MenuTrackerRemoveFuncWrapper(remove_func);
            Raw = gtk_menu_tracker_new_for_item_link(item == null ? IntPtr.Zero : item.Handle, native_link_name, merge_sections, mac_os_mode, insert_func_wrapper.NativeDelegate, remove_func_wrapper.NativeDelegate, IntPtr.Zero);
            GLib.Marshaller.Free(native_link_name);
        }
Exemplo n.º 2
0
        public MenuTracker(Gtk.IActionObservable observer, GLib.MenuModel model, bool with_separators, bool merge_sections, bool mac_os_mode, string action_namespace, Gtk.MenuTrackerInsertFunc insert_func, Gtk.MenuTrackerRemoveFunc remove_func)
        {
            IntPtr native_action_namespace = GLib.Marshaller.StringToPtrGStrdup(action_namespace);

            GtkSharp.MenuTrackerInsertFuncWrapper insert_func_wrapper = new GtkSharp.MenuTrackerInsertFuncWrapper(insert_func);
            GtkSharp.MenuTrackerRemoveFuncWrapper remove_func_wrapper = new GtkSharp.MenuTrackerRemoveFuncWrapper(remove_func);
            Raw = gtk_menu_tracker_new(observer == null ? IntPtr.Zero : ((observer is GLib.Object) ? (observer as GLib.Object).Handle : (observer as Gtk.ActionObservableAdapter).Handle), model == null ? IntPtr.Zero : model.Handle, with_separators, merge_sections, mac_os_mode, native_action_namespace, insert_func_wrapper.NativeDelegate, remove_func_wrapper.NativeDelegate, IntPtr.Zero);
            GLib.Marshaller.Free(native_action_namespace);
        }