Example #1
0
        public RadioMenuItem(RadioMenuItem[] group, string label) : base(IntPtr.Zero)
        {
            if (GetType() != typeof(RadioMenuItem))
            {
                CreateNativeObject(new string [0], new GLib.Value [0]);
                AccelLabel al = new AccelLabel("");
                al.TextWithMnemonic = label;
                al.SetAlignment(0.0f, 0.5f);
                Add(al);
                al.AccelWidget = this;
                Group          = group;
                return;
            }
            IntPtr native_label = GLib.Marshaller.StringToPtrGStrdup(label);
            IntPtr native_group = IntPtr.Zero;

            if (group != null)
            {
                GLib.List list = new GLib.List(IntPtr.Zero);
                foreach (RadioMenuItem item in group)
                {
                    list.Append(item.Handle);
                }
                native_group = list.Handle;
            }
            Raw = gtk_radio_menu_item_new_with_mnemonic(native_group, native_label);
            GLib.Marshaller.Free(native_label);
        }
Example #2
0
        public ImageMenuItem(string label) : base(IntPtr.Zero)
        {
            if (GetType() != typeof(ImageMenuItem))
            {
                CreateNativeObject(new string [0], new GLib.Value [0]);
                AccelLabel al = new AccelLabel("");
                al.TextWithMnemonic = label;
                al.SetAlignment(0.0f, 0.5f);
                Add(al);
                al.AccelWidget = this;
                return;
            }

            IntPtr native = GLib.Marshaller.StringToPtrGStrdup(label);

            Raw = gtk_image_menu_item_new_with_mnemonic(native);
            GLib.Marshaller.Free(native);
        }
Example #3
0
        public RadioMenuItem(GLib.SList group, string label) : base(IntPtr.Zero)
        {
            if (GetType() != typeof(RadioMenuItem))
            {
                CreateNativeObject(new string [0], new GLib.Value [0]);
                AccelLabel al = new AccelLabel("");
                al.TextWithMnemonic = label;
                al.SetAlignment(0.0f, 0.5f);
                Add(al);
                al.AccelWidget = this;
                Group          = group;
                return;
            }
            IntPtr native_label = GLib.Marshaller.StringToPtrGStrdup(label);

            Raw = gtk_radio_menu_item_new_with_mnemonic(group == null ? IntPtr.Zero : group.Handle, native_label);
            GLib.Marshaller.Free(native_label);
        }