本文整理汇总了C#中Gtk.ImageMenuItem类的典型用法代码示例。如果您正苦于以下问题:C# ImageMenuItem类的具体用法?C# ImageMenuItem怎么用?C# ImageMenuItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ImageMenuItem类属于Gtk命名空间,在下文中一共展示了ImageMenuItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MenuBarController
public MenuBarController()
{
MenuBar mb = new MenuBar();
Menu filemenu = new Menu();
MenuItem file = new MenuItem("File");
file.Submenu = filemenu;
ImageMenuItem importDirectoryMenuItem = new ImageMenuItem("Import Directory");
importDirectoryMenuItem.Activated += ImportDirectoryMenuItemOnActivated;
filemenu.Append(importDirectoryMenuItem);
ImageMenuItem open = new ImageMenuItem(Stock.Open);
filemenu.Append(open);
SeparatorMenuItem sep = new SeparatorMenuItem();
filemenu.Append(sep);
ImageMenuItem exit = new ImageMenuItem(Stock.Quit);
exit.Activated += (sender, args) => Application.Quit();
filemenu.Append(exit);
mb.Append(file);
View = mb;
}
示例2: TIcon
public TIcon(CInterfaceGateway in_krnGateway, Gtk.Window mwindow)
{
krnGateway = in_krnGateway;
mainwindow = mwindow;
menu = new Gtk.Menu ();
EventBox eb = new EventBox ();
eb.ButtonPressEvent += new ButtonPressEventHandler (TIconClicked);
eb.Add (new Gtk.Image (new Gdk.Pixbuf (null, "lPhant.png")));
MenuItem it_show = new MenuItem ("Show");
it_show.Activated += new EventHandler (TIconShow);
MenuItem it_options = new MenuItem ("Options");
it_options.Activated += new EventHandler (TIconOptions);
ImageMenuItem it_quit = new ImageMenuItem("Quit");
it_quit.Activated += new EventHandler (TIconQuit);
menu.Append (it_show);
menu.Append (it_options);
menu.Append (it_quit);
t = new TrayIcon ("eLePhantGTK");
t.Add (eb);
t.ShowAll ();
}
示例3: CreateImageMenuItem
private ImageMenuItem CreateImageMenuItem(Color color, string name)
{
ImageMenuItem item = new ImageMenuItem(name);
item.Activated += ColorActivated;
item.Image = new ColorBlockWidget(color);
return item;
}
示例4: HandleTrayIconPopupMenu
static void HandleTrayIconPopupMenu(object o, PopupMenuArgs args)
{
Menu popupMenu = new Menu ();
ImageMenuItem menuItemQuit = new ImageMenuItem ("Quit");
ImageMenuItem menuItemEnabled;
if(Preferences.Enabled)
{
menuItemEnabled = new ImageMenuItem ("Disable");
menuItemEnabled.Image = new Gtk.Image (Gtk.Stock.Yes, IconSize.Menu);
}
else
{
// hopefully prevent any major mem leaks
menuItemEnabled = new ImageMenuItem ("Enable");
menuItemEnabled.Image = new Gtk.Image(Gtk.Stock.Yes, IconSize.Menu);
}
menuItemQuit.Image = new Gtk.Image (Gtk.Stock.Quit, IconSize.Menu);
popupMenu.Add(menuItemQuit);
popupMenu.Add(menuItemEnabled);
menuItemQuit.Activated += delegate(object sender, EventArgs e) {
Application.Quit();
};
menuItemEnabled.Activated += HandleMenuItemEnabledActivated;
popupMenu.ShowAll();
popupMenu.Popup();
}
示例5: CreateMenus
Gtk.MenuBar CreateMenus ()
{
AccelGroup group = new AccelGroup ();
MenuBar bar = new MenuBar ();
Menu file_menu = new Menu ();
MenuItem file_menu_item = new MenuItem ("_File");
file_menu_item.Submenu = file_menu;
ImageMenuItem file_exit = new ImageMenuItem (Gtk.Stock.Quit, group);
file_exit.Activated += new EventHandler (exit_cb);
file_menu.Append (file_exit);
bar.Append (file_menu_item);
Menu help_menu = new Menu ();
ImageMenuItem help_menu_item = new ImageMenuItem (Gtk.Stock.Help, group);
help_menu_item.Submenu = help_menu;
ImageMenuItem file_help = new ImageMenuItem (Gnome.Stock.About, group);
file_help.Activated += new EventHandler (about_cb);
help_menu.Append (file_help);
bar.Append (help_menu_item);
bar.ShowAll ();
return bar;
}
示例6: VideoContextMenu
// create the context menu
public VideoContextMenu()
: base()
{
MenuItem aspect_ratio = new MenuItem ("Aspect Ratio");
ImageMenuItem fullscreen = new ImageMenuItem (Stock.Fullscreen, null);
Menu aspect_menu = new Menu ();
aspect_auto = new RadioMenuItem ("Auto");
aspect_4x3 = new RadioMenuItem (aspect_auto, "4:3");
aspect_16x9 = new RadioMenuItem (aspect_auto, "16:9");
aspect_16x10 = new RadioMenuItem (aspect_auto, "16:10");
aspect_menu.Add (aspect_auto);
aspect_menu.Add (aspect_4x3);
aspect_menu.Add (aspect_16x9);
aspect_menu.Add (aspect_16x10);
aspect_ratio.Submenu = aspect_menu;
this.Add (aspect_ratio);
showVisualisations ();
this.Add (new SeparatorMenuItem ());
this.Add (fullscreen);
fullscreen.Activated += fullscreen_activated;
aspect_auto.ButtonReleaseEvent += aspect_auto_toggled;
aspect_4x3.ButtonReleaseEvent += aspect_4x3_toggled;
aspect_16x9.ButtonReleaseEvent += aspect_16x9_toggled;
aspect_16x10.ButtonReleaseEvent += aspect_16x10_toggled;
toggle_aspect_value ();
}
示例7: AddImageItem
public ImageMenuItem AddImageItem(string stock_id, EventHandler handler)
{
ImageMenuItem item = new ImageMenuItem(stock_id, null);
item.Activated += handler;
Append(item);
return(item);
}
示例8: MainWindow
public MainWindow()
{
Build ();
popupMenu = new Menu ();
ImageMenuItem explore = new ImageMenuItem ("Explore");
explore.Image = new Image (Stock.Open, IconSize.Menu);
explore.Activated += Open;
popupMenu.Add (explore);
ImageMenuItem quit = new ImageMenuItem ("Exit");
quit.Image = new Image (Stock.Quit, IconSize.Menu);
quit.Activated += (object sender, EventArgs e) => {
Application.Quit ();
};
popupMenu.Add (quit);
statusIcon = new StatusIcon ();
statusIcon.Pixbuf = c.Icon.Bitmap.ToPixbuf ();
statusIcon.Activate += Open;
statusIcon.PopupMenu += (object o, PopupMenuArgs args) => {
popupMenu.ShowAll ();
popupMenu.Popup ();
};
statusIcon.Tooltip = c.Icon.Tooltip;
statusIcon.Visible = true;
}
示例9: AddImageMenuButton
public static ImageMenuItem AddImageMenuButton(string title, string imgName, Gtk.Menu parent,EventHandler OnMenuClicked)
{
var sep = System.IO.Path.DirectorySeparatorChar;
var menuItem = new ImageMenuItem(title);
if (imgName != null)
{
var picFileName = SupportMethods.AppPath + sep + "Icons" + sep + imgName;
if (System.IO.File.Exists(picFileName))
{
menuItem.Image = new Gtk.Image(picFileName);
}
}
if (OnMenuClicked != null)
{
menuItem.Activated+= OnMenuClicked;
}
if (parent != null)
{
parent.Add(menuItem);
}
return menuItem;
}
示例10: AddImageMenuItem
public ImageMenuItem AddImageMenuItem(string label, Image image)
{
ImageMenuItem item = new ImageMenuItem(label);
item.Image = image;
Append(item);
return item;
}
示例11: DockNotebook
public DockNotebook ()
{
pagesCol = new ReadOnlyCollection<IDockNotebookTab> (pages);
AddEvents ((Int32)(EventMask.AllEventsMask));
tabStrip = new TabStrip (this);
PackStart (tabStrip, false, false, 0);
contentBox = new EventBox ();
PackStart (contentBox, true, true, 0);
ShowAll ();
tabStrip.DropDownButton.Sensitive = false;
tabStrip.DropDownButton.MenuCreator = delegate {
Gtk.Menu menu = new Menu ();
foreach (var tab in pages) {
var mi = new Gtk.ImageMenuItem ("");
menu.Insert (mi, -1);
var label = (Gtk.AccelLabel) mi.Child;
if (tab.Markup != null)
label.Markup = tab.Markup;
else
label.Text = tab.Text;
var locTab = tab;
mi.Activated += delegate {
CurrentTab = locTab;
};
}
menu.ShowAll ();
return menu;
};
}
示例12: Next
public ImageMenuItem Next()
{
ImageMenuItem next = new ImageMenuItem("Next");
next.Image = new Gtk.Image(Gtk.Stock.MediaNext, IconSize.Menu);;
next.Activated += delegate { _parent.oXbmc.Controls.Next(); };
return next;
}
示例13: Next
public ImageMenuItem Next()
{
ImageMenuItem next = new ImageMenuItem("Next");
next.Image = new Gtk.Image(new Pixbuf(_parent.appDir + "/Interface/" + _parent.theme + "/buttons/next_16.png"));
next.Activated += delegate { _parent.oXbmc.Controls.Next(); };
return next;
}
示例14: Enque
public ImageMenuItem Enque(string caller, string identifier)
{
ImageMenuItem enque = new ImageMenuItem("Enque");
enque.Image = new Gtk.Image(new Pixbuf(_parent.appDir + "/Interface/" + _parent.theme + "/buttons/add_16.png"));
enque.Activated += delegate { _parent.oControls.AddToPlaylist(caller, identifier, false); };
return enque;
}
示例15: Configuration
public ImageMenuItem Configuration()
{
ImageMenuItem config = new ImageMenuItem("Configuration");
config.Image = new Gtk.Image(new Pixbuf(_parent.appDir + "/Interface/" + _parent.theme + "/buttons/configure_16.png"));
config.Activated += delegate { Application.Quit(); };
return config;
}