本文整理汇总了C#中Gtk.HBox.Add方法的典型用法代码示例。如果您正苦于以下问题:C# HBox.Add方法的具体用法?C# HBox.Add怎么用?C# HBox.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.HBox
的用法示例。
在下文中一共展示了HBox.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlayerScoreController
public PlayerScoreController(GUILauncher launcher)
: base(launcher)
{
hBox = new HBox();
mySpinButtons = new List<SpinButton>();
GameState state = launcher.OurGameApp.GameState;
for (int i = 0; i < state.NumPlayers; i++ )
{
Label player = new Label("Score joueur " + (i+1).ToString() + ":");
hBox.Add(player);
SpinButton playerSpinButton = new SpinButton(0, 9999999d, 1);
mySpinButtons.Add(playerSpinButton);
playerSpinButton.ValueChanged += this.OnPlayerScoreEntryChanged;
playerSpinButton.Digits = 0;
playerSpinButton.Numeric = true;
playerSpinButton.Wrap = true;
playerSpinButton.SnapToTicks = true;
hBox.Add(playerSpinButton);
}
this.Add(hBox);
this.ShowAll();
}
示例2: BDialog
public BDialog(string aName, Gtk.Window aParent, string aText)
: base(aName, aParent, Gtk.DialogFlags.NoSeparator)
{
// setup dialog
this.Modal = true;
this.BorderWidth = 6;
this.HasSeparator = false;
this.Resizable = false;
this.VBox.Spacing=12;
// graphic items
hbox = new Gtk.HBox();
Gtk.VBox labelBox = new VBox();
label = new Gtk.Label();
image = new Gtk.Image();
hbox.Spacing=12;
hbox.BorderWidth=6;
this.VBox.Add(hbox);
// set-up image
image.Yalign=0.0F;
hbox.Add(image);
// set-up label
label.Yalign=0.0F;
label.Xalign=0.0F;
label.UseMarkup=true;
label.Wrap=true;
label.Markup=aText;
// add to dialog
labelBox.Add(label);
hbox.Add(labelBox);
}
示例3: Dialog
public Dialog(VariableSet variables)
: base("Splitter", variables)
{
var vbox = new VBox(false, 12) {BorderWidth = 12};
VBox.PackStart(vbox, true, true, 0);
var table = new GimpTable(4, 2)
{ColumnSpacing = 6, RowSpacing = 6};
vbox.PackStart(table, false, false, 0);
var hbox = new HBox(false, 6);
table.Attach(hbox, 0, 2, 0, 1);
hbox.Add(new Label("f(x, y):"));
hbox.Add(new GimpEntry(GetVariable<string>("formula")));
hbox.Add(new Label("= 0"));
table.Attach(CreateLayerFrame("Layer 1", "translate_1_x", "translate_1_y",
"rotate_1"), 0, 1, 1, 2);
table.Attach(CreateLayerFrame("Layer 2", "translate_2_x", "translate_2_y",
"rotate_2"), 1, 2, 1, 2);
table.Attach(new GimpCheckButton(_("_Merge visible layers"),
GetVariable<bool>("merge")), 0, 1, 3, 4);
table.Attach(CreateAdvancedOptions(), 1, 2, 3, 4);
var keep = new GimpComboBox(GetVariable<int>("keep_layer"),
new string[]{_("Both Layers"),
_("Layer 1"), _("Layer 2")});
table.AttachAligned(0, 5, _("Keep:"), 0.0, 0.5, keep, 1, true);
}
示例4: Main
static void Main ()
{
Application.Init ();
Gtk.Window w = new Gtk.Window ("System.Drawing and Gtk#");
// Custom widget sample
a = new PrettyGraphic ();
// Event-based drawing
b = new DrawingArea ();
b.ExposeEvent += new ExposeEventHandler (ExposeHandler);
b.SizeAllocated += new SizeAllocatedHandler (SizeAllocatedHandler);
Button c = new Button ("Quit");
c.Clicked += new EventHandler (quit);
MovingText m = new MovingText ();
Box box = new HBox (true, 0);
box.Add (a);
box.Add (b);
box.Add (m);
box.Add (c);
w.Add (box);
w.ShowAll ();
Application.Run ();
}
示例5: MainWindow_2
public MainWindow_2()
: base("Allignment")
{
SetDefaultSize(260, 150);
SetPosition(WindowPosition.Center);
DeleteEvent += delegate { Application.Quit(); };
VBox vbox = new VBox(false, 5);
HBox hbox = new HBox(true, 3);
Alignment valign = new Alignment(0, 0.5f, 0, 0);
vbox.PackStart(valign);
Button ok = new Button("OK");
ok.SetSizeRequest(70, 30);
Button close = new Button("Close");
hbox.Add(ok);
hbox.Add(close);
Alignment halign = new Alignment(0.5f, 0, 0, 0);
halign.Add(hbox);
vbox.PackStart(halign, false, false, 3);
Add(vbox);
ShowAll();
}
示例6: NotebookTabLabel
public NotebookTabLabel(string title)
{
Button button = new Button ();
button.Image = new Gtk.Image (Stock.Close, IconSize.Menu);
button.TooltipText = "Close Tab";
button.Relief = ReliefStyle.None;
RcStyle rcStyle = new RcStyle ();
rcStyle.Xthickness = 0;
rcStyle.Ythickness = 0;
button.ModifyStyle (rcStyle);
button.FocusOnClick = false;
button.Clicked += OnCloseClicked;
button.Show ();
Label label = new Label (title);
label.UseMarkup = false;
label.UseUnderline = false;
label.Show ();
HBox hbox = new HBox (false, 0);
hbox.Spacing = 0;
hbox.Add (label);
hbox.Add (button);
hbox.Show ();
this.Add (hbox);
}
示例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: 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;
}
示例9: addPage
private void addPage (Widget widget, string label) {
HBox hBox = new HBox ();
hBox.Add(new Label (label));
Button button = new Button (new Image (Stock.Cancel, IconSize.Button ));
hBox.Add (button);
hBox.ShowAll();
notebook1.AppendPage (widget, new Label(label));
button.Clicked += delegate {
widget.Destroy ();
};
}
示例10: 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;
}
示例11: 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");
}
示例12: TypeKindChooserDialog
public TypeKindChooserDialog()
: base(GettextCatalog.GetString ("Choose a type"))
{
Gtk.HBox hbox = new Gtk.HBox();
base.VBox.Add (hbox);
Gtk.VBox vbox;
// box 1
vbox = new Gtk.VBox ();
hbox.Add (vbox);
AddButton (vbox, GettextCatalog.GetString ("Activity"), SetActivity);
_selection = "Activity";
AddButton (vbox, GettextCatalog.GetString ("Actor"), SetActor);
AddButton (vbox, GettextCatalog.GetString ("Artifact"), SetArtifact);
AddButton (vbox, GettextCatalog.GetString ("Association"), SetAssociation);
AddButton (vbox, GettextCatalog.GetString ("AssociationClass"), SetAssociationClass);
AddButton (vbox, GettextCatalog.GetString ("Class"), SetClass);
AddButton (vbox, GettextCatalog.GetString ("Collaboration"), SetCollaboration);
vbox.Show ();
// box 2
vbox = new Gtk.VBox();
hbox.Add (vbox);
AddButton (vbox, GettextCatalog.GetString ("CommunicationPath"), SetCommunicationPath);
AddButton (vbox, GettextCatalog.GetString ("Component"), SetComponent);
AddButton (vbox, GettextCatalog.GetString ("DataType"), SetDataType);
AddButton (vbox, GettextCatalog.GetString ("DeploymentSpecification"), SetDeploymentSpecification);
AddButton (vbox, GettextCatalog.GetString ("Device"), SetDevice);
AddButton (vbox, GettextCatalog.GetString ("Enumeration"), SetEnumeration);
AddButton (vbox, GettextCatalog.GetString ("ExecutionEnvironment"), SetExecutionEnvironment);
vbox.Show ();
// box 3
vbox = new Gtk.VBox ();
hbox.Add (vbox);
AddButton (vbox, GettextCatalog.GetString ("Extension"), SetExtension);
AddButton (vbox, GettextCatalog.GetString ("InformationItem"), SetInformationItem);
AddButton (vbox, GettextCatalog.GetString ("Interaction"), SetInteraction);
AddButton (vbox, GettextCatalog.GetString ("Interface"), SetInterface);
AddButton (vbox, GettextCatalog.GetString ("Node"), SetNode);
AddButton (vbox, GettextCatalog.GetString ("PrimitiveType"), SetPrimitiveType);
AddButton (vbox, GettextCatalog.GetString ("ProtocolStateMachine"), SetProtocolStateMachine);
vbox.Show ();
// box 4
vbox = new Gtk.VBox ();
hbox.Add (vbox);
AddButton (vbox, GettextCatalog.GetString ("Signal"), SetSignal);
AddButton (vbox, GettextCatalog.GetString ("StateMachine"), SetStateMachine);
AddButton (vbox, GettextCatalog.GetString ("Stereotype"), SetStereotype);
AddButton (vbox, GettextCatalog.GetString ("UseCase"), SetUseCase);
vbox.Show ();
hbox.Show ();
}
示例13: CreateColorAndOpacityWidget
void CreateColorAndOpacityWidget()
{
var hbox = new HBox(false, 12);
_color = new GimpColorButton("", 16, 16, new RGB(0, 0, 0),
ColorAreaType.Flat);
_color.Update = true;
hbox.Add(_color);
_opacity = new SpinButton(0, 100, 1);
hbox.Add(new Label(_("Opacity:")));
hbox.Add(_opacity);
hbox.Add(new Label("%"));
AttachAligned(0, 3, _("Color:"), 0.0, 0.5, hbox, 1, true);
}
示例14: SourceFrame
public SourceFrame(Variable<ProviderFactory> loader)
: base(3, 2, "Source")
{
_loader = loader;
Table.ColumnSpacing = 12;
var imageButton = CreateImageButton();
Attach(imageButton, 0, 1, 0, 1);
var hbox = new HBox();
Attach(hbox, 1, 2, 0, 1);
_imageBox = CreateImageComboBox();
hbox.Add(_imageBox);
_refresh = CreateRefreshButton();
hbox.PackEnd(_refresh, false, false, 0);
var fileButton = CreateFileButton(imageButton);
Attach(fileButton, 0, 1, 1, 2);
var folderButton = CreateFolderButton(fileButton);
Attach(folderButton, 0, 1, 2, 3);
_include = CreateIncludeToggleButton();
Attach(_include, 1, 2, 2, 3);
SetFileEntry(false);
_choose.Sensitive = false;
}
示例15: NewsMenuItem
public NewsMenuItem()
{
HBox box = new HBox (false, 0);
menuLabel = new Label ();
box.Add (menuLabel);
newsicon = new Image (Gdk.Pixbuf.LoadFromResource ("QSSupportLib.icons.internet-news-reader.png"));
newsicon.TooltipText = "Нет непрочитанных новостей.";
newsicon.Show ();
box.Add (newsicon);
this.Add (box);
this.RightJustified = true;
this.ShowAll ();
menuLabel.Visible = false;
}