本文整理汇总了C#中Gtk.VBox.Add方法的典型用法代码示例。如果您正苦于以下问题:C# VBox.Add方法的具体用法?C# VBox.Add怎么用?C# VBox.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.VBox
的用法示例。
在下文中一共展示了VBox.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CategoriaListView
public CategoriaListView()
{
TreeViewHelper t=new TreeViewHelper(treeView,"Select * from categoria");
Gtk.Action refreshAction = new Gtk.Action("refreshAction", null, null, Stock.Refresh);
//tengo acceso al actionGroup de IEntityListView
actionGroup.Add(refreshAction);
refreshAction.Activated += delegate {t.Refresh ();};
Gtk.Action editAction = new Gtk.Action("editAction", null, null, Stock.Edit);
actionGroup.Add(editAction);
editAction.Activated += delegate {
Window ventana=new Window("Editar");
ventana.SetDefaultSize(500,500);
VBox h=new VBox(true,10);
ventana.Add (h);
Label enunciado=new Label("Introduce el nuevo valor:");
h.Add (enunciado);
Entry caja=new Entry();
h.Add (caja);
Button b=new Button("Editar");
h.Add (b);
b.Clicked+=delegate
{
IDbCommand dbCommand=App.Instance.DbConnection.CreateCommand();
dbCommand.CommandText =
string.Format ("update categoria set nombre='{1}' where id={0}", t.Id,caja.Text);
dbCommand.ExecuteNonQuery ();
};
ventana.ShowAll();
};
}
示例2: BuildLayout
void BuildLayout ()
{
primary_vbox = new VBox ();
var label = new Label ("Super duper test UI!");
label.Show ();
primary_vbox.Add (label);
var button_box = new HButtonBox ();
button_box.Show ();
primary_vbox.Add (button_box);
var folder_button = new FileChooserButton ("Select import folder", FileChooserAction.SelectFolder);
folder_button.FileSet += delegate {
folder = folder_button.Uri;
Log.Information ("Selected " + folder);
};
folder_button.Show ();
button_box.Add (folder_button);
var import_button = new Button { Label = "Start Import" };
import_button.Activated += StartImport;
import_button.Clicked += StartImport;
import_button.Show ();
button_box.Add (import_button);
primary_vbox.Show ();
Add (primary_vbox);
}
示例3: Build
private void Build ()
{
// Section label + line
var hbox1 = new HBox (false, 6);
var label = new Label ();
label.LabelProp = Mono.Unix.Catalog.GetString ("Random Noise");
hbox1.PackStart (label, false, false, 0);
hbox1.PackStart (new HSeparator (), true, true, 0);
// Reseed button
button1 = new Button ();
button1.WidthRequest = 88;
button1.CanFocus = true;
button1.UseUnderline = true;
button1.Label = Mono.Unix.Catalog.GetString ("Reseed");
var hbox2 = new HBox (false, 6);
hbox2.PackStart (button1, false, false, 0);
// Main layout
var vbox = new VBox (false, 6);
vbox.Add (hbox1);
vbox.Add (hbox2);
Add (vbox);
vbox.ShowAll ();
}
示例4: DoWork
/// <summary>
/// Runs in a separate thread.
/// </summary>
public void DoWork()
{
Application.Init();
//Create the Window
myWin = new Window("N'Oubliez pas les paroles - Fenêtre de contrôle");
myWin.DeleteEvent += this.OnWindowDeleteEvent;
vBox = new VBox();
myWin.Add(vBox);
myPlayerScoreController = new PlayerScoreController(this);
vBox.Add(myPlayerScoreController.GetPaneBox());
mySongTestController = new SongTestController(this);
vBox.Add(mySongTestController.GetPaneBox());
// Rend tout visible
myWin.ShowAll();
// start the message pump
messagePumper.Start();
Application.Run();
}
示例5: ConfigurationWidget
public override Widget ConfigurationWidget()
{
VBox h = new VBox ();
r = new HScale (0, 100, 1);
r.ModifyBg (StateType.Selected, new Color (0xff, 0, 0));
r.Value = 80;
r.ValueChanged += SettingsChanged;
h.Add (r);
g = new HScale (0, 100, 1);
g.ModifyBg (StateType.Selected, new Color (0, 0xff, 0));
g.Value = 10;
g.ValueChanged += SettingsChanged;
h.Add (g);
b = new HScale (0, 100, 1);
b.ModifyBg (StateType.Selected, new Color (0, 0, 0xff));
b.Value = 10;
b.ValueChanged += SettingsChanged;
h.Add (b);
c = new Curve ();
c.CurveType = CurveType.Spline;
c.SetRange (0, 255, 0, 255);
h.Add (c);
Button btn = new Button (Gtk.Stock.Refresh);
btn.Clicked += delegate {UpdatePreview ();};
h.Add (btn);
return h;
}
示例6: CreateConfigWidget
/// <summary>
/// Creates the config widget.
/// </summary>
/// <returns>The config widget.</returns>
public override Gtk.Widget CreateConfigWidget()
{
var container = new VBox();
var citiesNumber = new SpinButton(2, 10000, 2);
citiesNumber.Text = "Number of cities";
citiesNumber.Value = m_numberOfCities;
citiesNumber.ValueChanged += delegate
{
m_numberOfCities = citiesNumber.ValueAsInt - (citiesNumber.ValueAsInt % 2);
citiesNumber.Value = m_numberOfCities;
OnReconfigured();
};
container.Add(citiesNumber);
var generateButton = new Button();
generateButton.Label = "Generate cities";
generateButton.Clicked += delegate
{
m_numberOfCities = citiesNumber.ValueAsInt;
OnReconfigured();
};
container.Add(generateButton);
var showIndexes = new CheckButton();
showIndexes.Active = m_showIndexes;
showIndexes.Label = "Show indexes";
showIndexes.Toggled += delegate
{
m_showIndexes = showIndexes.Active;
};
container.Add(showIndexes);
return container;
}
示例7: SetupDialog
public SetupDialog()
: base("Setup Map")
{
cellSizeSpin = new SpinButton (0.1, 1.0, 0.1);
cellSizeSpin.Value = 0.3;
cellSizeSpin.Changed += CellSizeSpin_Changed;
widthSpin = new SpinButton (3.0, 10.0, 0.3);
widthSpin.Value = 9.9;
heightSpin = new SpinButton (3.0, 10.0, 0.3);
heightSpin.Value = 4.5;
portEntry = new Entry ("/dev/tty");
portEntry.Activated += PortEntry_Activated;
createButton = new Button ("Create");
createButton.Clicked += CreateButton_Clicked;
HBox widthHBox = new HBox (false, 60);
widthHBox.Add (new Label ("Width: "));
widthHBox.Add (widthSpin);
HBox heightHBox = new HBox (false, 60);
heightHBox.Add (new Label ("Height: "));
heightHBox.Add (heightSpin);
HBox cellHBox = new HBox (false, 60);
cellHBox.Add (new Label ("Cell Size: "));
cellHBox.Add (cellSizeSpin);
HBox portHBox = new HBox (false, 60);
portHBox.Add (new Label ("Port: "));
portHBox.Add (portEntry);
HBox createHbox = new HBox (false, 0);
createHbox.Add (createButton);
VBox vBox = new VBox (false, 10);
vBox.BorderWidth = 10;
vBox.Add (widthHBox);
vBox.Add (heightHBox);
vBox.Add (cellHBox);
vBox.Add (portHBox);
vBox.Add (createHbox);
Add (vBox);
SetPosition (WindowPosition.Center);
Resizable = false;
DeleteEvent += delegate
{
Application.Quit ();
};
Shown += OnShown;
}
示例8: Build
private void Build()
{
this.Title = Catalog.GetString("Select Folder");
this.DefaultWidth = 350;
#if GTK2
VBox w1 = this.VBox;
#elif GTK3
Box w1 = this.ContentArea;
#endif
w1.Spacing = 6;
w1.BorderWidth = ((uint)(2));
vbox1 = new VBox();
vbox1.Spacing = 4;
hbox1 = new HBox();
entryPath = new Entry();
hbox1.PackStart(entryPath, true, true, 0);
buttonBrowse = new Button("...");
buttonBrowse.Clicked += ButtonBrowse_Clicked;
hbox1.PackStart(buttonBrowse, false, false, 1);
vbox1.Add(hbox1);
hbox2 = new HBox();
for (uint i = 0; i < symbols.Length; i++)
{
var buttonSymbol = new Button(symbols[i]);
buttonSymbol.Clicked += ButtonSymbol_Clicked;
hbox2.PackStart(buttonSymbol, true, true, i);
}
vbox1.Add(hbox2);
w1.Add(vbox1);
this.AddButton(Catalog.GetString("Ok"), ResponseType.Ok);
this.AddButton(Catalog.GetString("Cancel"), ResponseType.Cancel);
this.DefaultResponse = ResponseType.Ok;
#if GTK3
var geom = new Gdk.Geometry();
geom.MinWidth = this.DefaultWidth;
geom.MinHeight = this.DefaultHeight;
geom.MaxWidth = 1000;
geom.MaxHeight = this.DefaultHeight;
this.SetGeometryHints(this, geom, Gdk.WindowHints.MinSize | Gdk.WindowHints.MaxSize);
#endif
this.Response += OnResponse;
this.ShowAll();
}
示例9: RolloversFrame
public RolloversFrame(SliceData sliceData)
: base(_("Rollovers"))
{
var vbox = new VBox(false, 12);
Add(vbox);
vbox.Add(CreateRolloverButton(sliceData));
var label = new Label(_("Rollover enabled: no"));
vbox.Add(label);
}
示例10: MapWindow
private TextView textView; // Textview to hold landmark information.
#endregion Fields
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="SLAM.MapWindow"/> class.
/// </summary>
/// <param name="mapView">Map view contained in this window.</param>
public MapWindow(MapView mapView)
: base("Map")
{
robot = mapView.RobotView.Robot;
this.mapView = mapView;
// Subscribe to events.
mapView.MapModel.MapUpdated += new EventHandler<MapUpdateEventArgs> (Map_Update);
mapView.RobotView.Robot.RobotUpdated += new EventHandler<RobotUpdateEventArgs> (Robot_Update);
SetPosition (WindowPosition.Center);
Resizable = false;
DeleteEvent += delegate
{
Application.Quit ();
};
TextBuffer textBuffer = new TextBuffer (new TextTagTable ());
textView = new TextView ();
textView.Indent = 10;
textView.Editable = false;
textView.Buffer = textBuffer;
textView.CursorVisible = false;
textView.SetSizeRequest (mapView.ViewWidth, 150);
foreach (Landmark landmark in mapView.MapModel.Landmarks)
{
this.textView.Buffer.Text += landmark.ToString ();
}
ScrolledWindow scrolledWindow = new ScrolledWindow ();
scrolledWindow.Add (textView);
commandEntry = new Entry ();
commandEntry.Activated += CommandEntry_OnActivated;
sendButton = new Button ("Send");
sendButton.Clicked += SendButton_OnClick;
HBox hbox = new HBox (false, 0);
hbox.Add (commandEntry);
hbox.Add (sendButton);
VBox vbox = new VBox (false, 0);
vbox.Add (this.mapView);
vbox.Add (scrolledWindow);
vbox.Add (hbox);
Add (vbox);
Shown += OnShown;
}
示例11: Dialog
public Dialog(VariableSet variables)
: base(_("UpdateCheck"), variables)
{
var vbox = new VBox(false, 12) {BorderWidth = 12};
VBox.PackStart(vbox, true, true, 0);
var table = new GimpTable(4, 3)
{ColumnSpacing = 6, RowSpacing = 6};
vbox.PackStart(table, true, true, 0);
table.Attach(new GimpCheckButton(_("Check _GIMP"),
GetVariable<bool>("check_gimp")),
0, 1, 0, 1);
table.Attach(new GimpCheckButton(_("Check G_IMP#"),
GetVariable<bool>("check_gimp_sharp")),
0, 1, 1, 2);
table.Attach(new GimpCheckButton(_("Check _Unstable Releases"),
GetVariable<bool>("check_unstable")),
0, 1, 2, 3);
var enableProxy = GetVariable<bool>("enable_proxy");
var httpProxy = GetVariable<string>("http_proxy");
var port = GetVariable<string>("port");
string tmp = Gimp.RcQuery("update-enable-proxy");
enableProxy.Value = (tmp != null || tmp == "true");
httpProxy.Value = Gimp.RcQuery("update-http-proxy") ?? "";
port.Value = Gimp.RcQuery("update-port") ?? "";
var expander = new Expander(_("Proxy settings"));
var proxyBox = new VBox(false, 12);
proxyBox.Add(new GimpCheckButton(_("Manual proxy configuration"),
enableProxy));
var hbox = new HBox(false, 12) {Sensitive = enableProxy.Value};
proxyBox.Add(hbox);
hbox.Add(new Label(_("HTTP Proxy:")));
hbox.Add(new GimpEntry(httpProxy));
hbox.Add(new Label(_("Port:")));
hbox.Add(new GimpEntry(port) {WidthChars = 4});
enableProxy.ValueChanged += delegate
{
hbox.Sensitive = enableProxy.Value;
};
expander.Add(proxyBox);
table.Attach(expander, 0, 1, 3, 4);
}
示例12: CreateNotficationWindow
public static void CreateNotficationWindow(string notification)
{
Gtk.Window nWin = new Gtk.Window(WindowType.Toplevel);
Gtk.VBox ctr = new Gtk.VBox();
ctr.Add( new Gtk.Label(notification));
Gtk.Button btn = new Gtk.Button();
btn.Label = "Close";
btn.Clicked += (sender, e) => nWin.Destroy();
ctr.Add(btn);
nWin.Add(ctr);
nWin.ShowAll();
}
示例13: MainWindow
public MainWindow()
: base(WindowType.Toplevel)
{
Console.WriteLine("MainWindow...");
this.Title = "GefGlue Demo (Gtk#)";
this.SetSizeRequest(800, 600);
var vBox = new VBox();
vBox.Visible = true;
vBox.Homogeneous = false;
var hBox = new HBox();
hBox.Visible = true;
var backButton = new Button();
backButton.Visible = true;
backButton.Label = "Back";
var forwardButton = new Button();
forwardButton.Visible = true;
forwardButton.Label = "Forward";
Console.WriteLine("new CefWebBrowserWidget()...");
var browser = new CefGlue.GtkSharp.CefWebBrowserWidget();
browser.Visible = true;
Console.WriteLine("new CefWebBrowserWidget()... done");
var statusBar = new Statusbar();
statusBar.Visible = true;
// Layout
hBox.Add(backButton);
hBox.Add(forwardButton);
vBox.Add(hBox);
vBox.Add(browser);
vBox.Add(statusBar);
this.Add(vBox);
var vw1 = ((Box.BoxChild)(vBox[hBox]));
vw1.Expand = false;
vw1.Fill = false;
var vw3 = ((Box.BoxChild)(vBox[statusBar]));
vw3.Expand = false;
vw3.Fill = false;
//Show Everything
Console.WriteLine("ShowAll()...");
// this.ShowAll();
Console.WriteLine("ShowAll()... done");
}
示例14: Alert
private static Gtk.Dialog Alert(string primary, string secondary, Image aImage, Gtk.Window parent)
{
Gtk.Dialog retval = new Gtk.Dialog("", parent, Gtk.DialogFlags.DestroyWithParent);
// graphic items
Gtk.HBox hbox;
Gtk.VBox labelBox;
Gtk.Label labelPrimary;
Gtk.Label labelSecondary;
// set-up dialog
retval.Modal=true;
retval.BorderWidth=6;
retval.HasSeparator=false;
retval.Resizable=false;
retval.VBox.Spacing=12;
hbox=new Gtk.HBox();
hbox.Spacing=12;
hbox.BorderWidth=6;
retval.VBox.Add(hbox);
// set-up image
aImage.Yalign=0.0F;
hbox.Add(aImage);
// set-up labels
labelPrimary=new Gtk.Label();
labelPrimary.Yalign=0.0F;
labelPrimary.Xalign=0.0F;
labelPrimary.UseMarkup=true;
labelPrimary.Wrap=true;
labelSecondary=new Gtk.Label();
labelSecondary.Yalign=0.0F;
labelSecondary.Xalign=0.0F;
labelSecondary.UseMarkup=true;
labelSecondary.Wrap=true;
labelPrimary.Markup="<span weight=\"bold\" size=\"larger\">"+primary+"</span>";
labelSecondary.Markup="\n"+secondary;
labelBox=new VBox();
labelBox.Add(labelPrimary);
labelBox.Add(labelSecondary);
hbox.Add(labelBox);
return retval;
}
示例15: MainWindow
public MainWindow() : base("Gtk Embedding Demo")
{
var root = new HBox();
var left = new VBox();
left.Add(new Button("I'm GTK button"));
left.Add(new Calendar());
root.PackEnd(left, false, false, 0);
var host = new GtkAvaloniaControlHost() {Content = new MainView()};
host.SetSizeRequest(600, 600);
root.PackStart(host, true, true, 0);
Add(root);
ShowAll();
}