本文整理汇总了C#中ToggleButton.Add方法的典型用法代码示例。如果您正苦于以下问题:C# ToggleButton.Add方法的具体用法?C# ToggleButton.Add怎么用?C# ToggleButton.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToggleButton
的用法示例。
在下文中一共展示了ToggleButton.Add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GladeApp
public GladeApp(string[] args)
{
program = new Gnome.Program ("mCatalog", "1.0", Gnome.Modules.UI, args);
Mono.Posix.Catalog.Init ("mcatalog", Defines.GNOME_LOCALE_DIR);
// Proxy Setup
bool use_proxy = Conf.Get ("/system/http_proxy/use_http_proxy", false);
if (use_proxy) {
string proxy_host = Conf.Get ("/system/http_proxy/host", "");
int proxy_port = Conf.Get ("/system/http_proxy/port", 8080);
string proxy = string.Format("http://{0}:{1}/", proxy_host, proxy_port);
WebProxy proxyObject = new WebProxy(proxy, true);
System.Net.GlobalProxySelection.Select = proxyObject;
}
database = new Database (Conf.HomeDir+"/db.db");
database.Debug = true;
Glade.XML gxml = new Glade.XML (null, "mainwindow.glade", "app1", "mcatalog");
gxml.Autoconnect (this);
app1.DeleteEvent += OnWindowDeleteEvent;
presentation = new Presentation ();
itemShelf = new ItemShelf (presentation);
swPresentation.AddWithViewport (presentation);
presentation.Init ();
searchEntry.Activated += OnSearchEntryActivated;
itemListPaned.SizeRequested += OnItemListPanedResized;
// Fill the list hbox
HBox hBoxList = (HBox)gxml["hBoxList"];
buttonList = new ToggleButton ();
buttonList.Clicked += OnButtonListClicked;
Gtk.Image image1 = new Gtk.Image (new Gdk.Pixbuf (null, "list.png"));
image1.Visible = true;
buttonList.Add (image1);
buttonList.Relief = ReliefStyle.Half;
hBoxList.PackStart (buttonList, false, true, 0);
buttonShelf = new ToggleButton ();
buttonShelf.Clicked += OnButtonShelfClicked;
Gtk.Image image2 = new Gtk.Image (new Gdk.Pixbuf (null, "shelf.png"));
image2.Visible = true;
buttonShelf.Add (image2);
buttonShelf.Relief = ReliefStyle.Half;
hBoxList.PackStart (buttonShelf, false, true, 0);
titleWidget = new TitleWidget ();
titleWidget.OnOrderChanged += OnOrderChanged;
hBoxList.PackStart (titleWidget, true, true, 4);
hBoxList.ShowAll();
// Get the menu items we need to handle
menuItemAddItem.Sensitive = false;
menuItemRemoveItem.Sensitive = false;
menuItemShelfView.Data["view"] = View.Shelf;
menuItemListView.Data["view"] = View.List;
menuItemShelfView.Toggled += OnViewToggled;
// Buttons
addItemButton.Sensitive = false;
removeItemButton.Sensitive = false;
lendItemButton.Sensitive = false;
editItemButton.Sensitive = false;
lendItemButton.Clicked += LendOrReturnItem;
editItemButton.Clicked += EditItem;
// Populate the catalog tree
PopulateCatalogs ();
PopulateBorrowers ();
app1.ShowAll();
RestoreWindowState ();
program.Run();
}