本文整理汇总了C#中Gtk.Notebook.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Notebook.Add方法的具体用法?C# Notebook.Add怎么用?C# Notebook.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Notebook
的用法示例。
在下文中一共展示了Notebook.Add方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainWindow
public MainWindow()
: base(WindowType.Toplevel)
{
this.barChart = new SmartQuant.Controls.BarChart.BarChart();
this.barChart2 = new SmartQuant.Controls.BarChart.BarChart2();
this.chart3 = new SmartQuant.FinChart.Chart();
this.chart3.ActionType = ChartActionType.Cross;
var nb = new Notebook();
nb.Add(barChart);
nb.SetTabLabelText(barChart, "Chart");
nb.Add(barChart2);
nb.SetTabLabelText(barChart2, "Chart(Gapless)");
nb.Add(chart3);
nb.SetTabLabelText(chart3, "Performance");
Add(nb);
SetDefaultSize(624, 362);
DeleteEvent += (sender, e) =>
{
Application.Quit();
e.RetVal = true;
};
var f = new Framework("Demo", true);
f.IsDisposable = false;
f.GroupDispatcher = new GroupDispatcher(f);
this.barChart.Init(f, null, null);
this.barChart2.Init(f, null, null);
this.barChart.ResumeUpdates();
this.barChart2.ResumeUpdates();
GLib.Timeout.Add(500, new TimeoutHandler(delegate
{
barChart.UpdateGUI();
barChart2.UpdateGUI();
return true;
}));
// Until the framework is created, We cannot show them
ShowAll();
}
示例2: Build
private void Build()
{
this.Title = "MonoGame Packager";
this.DefaultWidth = this.WidthRequest = 640;
this.DefaultHeight = this.HeightRequest = 480;
#if WINDOWS
this.ModifyBg (StateType.Normal, new Gdk.Color (255, 255, 255));
#endif
#if GTK3
var geom = new Gdk.Geometry();
geom.MinWidth = geom.MaxWidth = this.DefaultWidth;
geom.MinHeight = geom.MaxHeight = this.DefaultHeight;
this.SetGeometryHints(this, geom, Gdk.WindowHints.MinSize | Gdk.WindowHints.MaxSize);
#else
this.Resizable = false;
#endif
vbox1 = new VBox();
vbox1.Spacing = 4;
notebook1 = new Notebook();
notebook1.ShowBorder = false;
notebook1.ShowTabs = false;
// Wizard Page 0
vbox2 = new VBox();
vbox2.Spacing = 10;
label1 = new Label();
label1.Wrap = true;
label1.LineWrapMode = Pango.WrapMode.Word;
label1.Text = "Welcome to MonoGame Packager\n" +
"\n" +
"This tool will help you pack you desktop game for redistribution. It offers 2 options, installer and bundle of binaries. The difference between bundling the game into an archive with this tool and doing it by hand is the fact that this tool will help by adding per platform dependencies.";
vbox2.PackStart(label1, true, true, 0);
label2 = new Label("Do note that installer generation is usually only supported for the OS this tool is run from.\n");
vbox2.PackStart(label2, false, true, 1);
notebook1.Add(vbox2);
// Wizaed Page 1
table1 = new Table(5, 3, false);
table1.Attach(new Label(), 0, 3, 0, 1);
label3 = new Label(" Select game folder: ");
label3.SetAlignment(0f, 0.5f);
table1.Attach(label3, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 4, 4);
entryGameDir = new Entry();
entryGameDir.Sensitive = false;
table1.Attach(entryGameDir, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 4, 4);
btnBrowse = new Button("Browse...");
btnBrowse.Clicked += BtnBrowse_Clicked;
table1.Attach(btnBrowse, 2, 3, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 4, 4);
label4 = new Label(" Select game .exe file:");
label4.SetAlignment(0f, 0.5f);
table1.Attach(label4, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4);
scroll1 = new ScrolledWindow();
scroll1.HeightRequest = 200;
treeview1 = new TreeView();
treeview1.HeightRequest = scroll1.HeightRequest;
treeview1.HeadersVisible = false;
treeview1.Reorderable = false;
treeview1.CursorChanged += Treeview1_CursorChanged;
scroll1.Add(treeview1);
table1.Attach(scroll1, 0, 3, 3, 4, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
table1.Attach(new Label(), 0, 3, 4, 5);
notebook1.Add(table1);
// Wizard Page 2
table2 = new Table(10, 3, false);
table2.Attach(new Label(), 0, 3, 0, 1);
imageIcon = new Image();
btnIcon = new Button(imageIcon);
btnIcon.WidthRequest = btnIcon.HeightRequest = 64;
btnIcon.Clicked += BtnIcon_Clicked;
table2.Attach(btnIcon, 0, 1, 1, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4);
label5 = new Label("Title:");
label5.SetAlignment(0f, 0.5f);
table2.Attach(label5, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 4, 4);
//.........这里部分代码省略.........
示例3: CreateContextNotebook
private void CreateContextNotebook ()
{
notebook = new Notebook () {
ShowBorder = false,
ShowTabs = false
};
// 'No active track' and 'Loading' widgets
no_active = new RoundedFrame ();
no_active.Add (new Label () {
Markup = String.Format ("<b>{0}</b>", Catalog.GetString ("Waiting for playback to begin..."))
});
no_active.ShowAll ();
notebook.Add (no_active);
loading = new RoundedFrame ();
loading.Add (new Label () { Markup = String.Format ("<b>{0}</b>", Catalog.GetString ("Loading...")) });
loading.ShowAll ();
notebook.Add (loading);
PackStart (notebook, true, true, 0);
notebook.Show ();
}
示例4: CreateWidgets
private void CreateWidgets()
{
this.Title = APP_NAME;
this.SetDefaultSize (800, 600);
this.DeleteEvent += new DeleteEventHandler (OnDeleteEvent);
CreateActions ();
CreateMenubar ();
CreateToolbar ();
CreateWebView ();
CreateFindbar ();
CreateStatusBar ();
Notebook nb = new Notebook ();
Gtk.ScrolledWindow scroll = new Gtk.ScrolledWindow ();
scroll.Add (nb);
//string label =url;
//nb.AppendPage (new Button (label), new Label (label));
nb.Add(webview);
vbox = new Gtk.VBox (false, 1);
vbox.PackStart (menubar, false, false, 0);
vbox.PackStart (toolbar, false, false, 0);
vbox.PackStart (scroll);
vbox.PackStart (findbar, false, false, 0);
vbox.PackEnd (statusbar, false, true, 0);
this.Add (vbox);
this.ShowAll ();
}
示例5: Build
private void Build()
{
// toolbar
toolbar = new Toolbar();
// toolbar.MarginLeft = 10;
this.Add (toolbar);
var toolbarBox = (Gtk.Box.BoxChild)this [toolbar];
toolbarBox.Fill = false;
toolbarBox.Expand = false;
toolbarBox.Position = 0;
// toolbar choose database dropdown
Gtk.Label l = new Gtk.Label(string.Format("Current database: {0}", this.ServerConnection.Name));
ToolItem lTi = new ToolItem ();
lTi.Add (l);
toolbar.Insert (lTi, 0);
// toolbar exec button
ToolButton execBtn = new ToolButton (Gtk.Stock.MediaPlay);
execBtn.Clicked += (sender, e) => this.ExecuteCommand();
toolbar.Insert (execBtn, 1);
// vpaned
vpaned = new VPaned();
this.Add (vpaned);
// Sql area textbox wrapped in a scrolled window
ScrolledWindow sqlAreaScroll = new ScrolledWindow();
vpaned.Add1 (sqlAreaScroll);
sqlArea = new Mono.TextEditor.TextEditor();
sqlArea.Text = string.Format ("{0}{0}", System.Environment.NewLine);
sqlArea.SetCaretTo (1, 1);
sqlArea.CanFocus = true;
sqlArea.IsFocus = true;
var syntaxMode = loadSyntaxMode ();
sqlArea.Document.SyntaxMode = syntaxMode;
sqlAreaScroll.Add (sqlArea);
// result tabs
resultNoteBook = new Notebook ();
sqlResultContainer = new Gtk.ScrolledWindow ();
resultNoteBook.Add (sqlResultContainer);
resultNoteBook.SetTabLabel (sqlResultContainer, new Label ("Results"));
outputView = new TextView ();
outputView.Editable = false;
resultNoteBook.Add (outputView);
resultNoteBook.SetTabLabel (outputView, new Label ("Output"));
vpaned.Add2 (resultNoteBook);
vpaned.Position = 180;
}
示例6: SearchWindow
public SearchWindow (ISearch search) : base (WindowType.Toplevel)
{
this.search = search;
base.Title = Catalog.GetString ("Desktop Search");
base.Icon = WidgetFu.LoadThemeIcon ("system-search", 16);
base.DefaultWidth = 700;
base.DefaultHeight = 550;
base.DeleteEvent += OnWindowDelete;
VBox vbox = new VBox ();
vbox.Spacing = 3;
uim = new UIManager (this);
uim.DomainChanged += OnDomainChanged;
uim.SortChanged += OnSortChanged;
uim.ToggleDetails += OnToggleDetails;
uim.ShowQuickTips += OnShowQuickTips;
uim.ShowIndexInfo += OnShowIndexInfo;
uim.StartDaemon += OnStartDaemon;
uim.StopDaemon += OnStopDaemon;
vbox.PackStart (uim.MenuBar, false, false, 0);
HBox hbox = new HBox (false, 6);
Label label = new Label (Catalog.GetString ("_Find in:"));
hbox.PackStart (label, false, false, 0);
scope_list = ComboBox.NewText ();
foreach (ScopeMapping mapping in scope_mappings)
scope_list.AppendText (mapping.label);
scope_list.Active = 0;
scope_list.Changed += new EventHandler (delegate (object o, EventArgs args) {
ComboBox combo = o as ComboBox;
if (o == null)
return;
int active = combo.Active;
Log.Debug ("Scope changed: {0} maps to '{1}'", combo.ActiveText, scope_mappings [active].query_mapping);
Query (true);
});
hbox.PackStart (scope_list, false, false, 0);
entry = new Entry ();
entry.Activated += OnEntryActivated;
hbox.PackStart (entry, true, true, 0);
label.MnemonicWidget = entry;
uim.FocusSearchEntry += delegate () { entry.GrabFocus (); };
// The auto search after timeout feauture is now optional
// and can be disabled.
if (Conf.BeagleSearch.GetOption (Conf.Names.BeagleSearchAutoSearch, true)) {
entry.Changed += OnEntryResetTimeout;
entry.MoveCursor += OnEntryResetTimeout;
}
button = new Gtk.Button ();
Gtk.HBox button_hbox = new Gtk.HBox (false, 2);
Gtk.Image icon = new Gtk.Image (Gtk.Stock.Find, Gtk.IconSize.Button);
button_hbox.PackStart (icon, false, false, 0);
label = new Gtk.Label (Catalog.GetString ("Find Now"));
button_hbox.PackStart (label, false, false, 0);
button.Add (button_hbox);
button.Clicked += OnButtonClicked;
Gtk.VBox buttonVBox = new Gtk.VBox (false, 0);
buttonVBox.PackStart (button, true, false, 0);
hbox.PackStart (buttonVBox, false, false, 0);
spinner = new Spinner ();
hbox.PackStart (spinner, false, false, 0);
HBox padding_hbox = new HBox ();
padding_hbox.PackStart (hbox, true, true, 9);
vbox.PackStart (padding_hbox, false, true, 6);
VBox view_box = new VBox (false, 3);
vbox.PackStart (view_box, true, true, 0);
HBox na_padding = new HBox ();
view_box.PackStart (na_padding, false, true, 0);
notification_area = new NotificationArea ();
na_padding.PackStart (notification_area, true, true, 3);
pages = new Gtk.Notebook ();
pages.ShowTabs = false;
pages.ShowBorder = false;
pages.BorderWidth = 3;
view_box.PackStart (pages, true, true, 0);
quicktips = new Pages.QuickTips ();
quicktips.Show ();
pages.Add (quicktips);
indexinfo = new Pages.IndexInfo ();
indexinfo.Show ();
pages.Add (indexinfo);
//.........这里部分代码省略.........