本文整理汇总了C#中Gtk.HBox.PackEnd方法的典型用法代码示例。如果您正苦于以下问题:C# HBox.PackEnd方法的具体用法?C# HBox.PackEnd怎么用?C# HBox.PackEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.HBox
的用法示例。
在下文中一共展示了HBox.PackEnd方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnButtonClicked
protected void OnButtonClicked(object sender, EventArgs e)
{
if (sender == button1)
{
Gtk.FileChooserDialog dialog = new Gtk.FileChooserDialog ("Choose item...", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Insert Spacer", ResponseType.None, "Add", ResponseType.Accept);
Gtk.Alignment align = new Alignment (1, 0, 0, 1);
Gtk.Frame frame = new Frame ("Position");
Gtk.HBox hbox = new HBox (false, 4);
RadioButton rbRight;
rbRight = new RadioButton ("Right");
hbox.PackEnd(rbRight, false, false, 1);
hbox.PackEnd(new RadioButton (rbRight, "Left"), false, false, 1);
frame.Add (hbox);
align.Add (frame);
align.ShowAll ();
dialog.ExtraWidget = align;
ResponseType response = (ResponseType)dialog.Run ();
if (response == ResponseType.Accept) {
RunCommand ("defaults write com.apple.dock " + GetAlign(dialog.ExtraWidget) + " -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>" + dialog.Filename + "</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' && /bin/sleep 1 &&/usr/bin/killall Dock");
} else if (response == ResponseType.None) {
RunCommand ("defaults write com.apple.dock " + GetAlign(dialog.ExtraWidget) + " -array-add '{tile-data={}; tile-type=\"spacer-tile\";}' && /bin/sleep 1 &&/usr/bin/killall Dock");
}
dialog.Destroy ();
}
}
示例2: DefaultPolicyOptionsDialog
public DefaultPolicyOptionsDialog (Gtk.Window parentWindow)
: base (parentWindow, new PolicySet (),
"/MonoDevelop/ProjectModel/Gui/DefaultPolicyPanels")
{
this.Title = GettextCatalog.GetString ("Custom Policies");
editingSet = (PolicySet) DataObject;
HBox topBar = new HBox ();
topBar.Spacing = 3;
topBar.PackStart (new Label (GettextCatalog.GetString ("Editing Policy:")), false, false, 0);
policiesCombo = ComboBox.NewText ();
topBar.PackStart (policiesCombo, false, false, 0);
newButton = new Button (GettextCatalog.GetString ("Add Policy"));
topBar.PackEnd (newButton, false, false, 0);
deleteButton = new Button (GettextCatalog.GetString ("Delete Policy"));
topBar.PackEnd (deleteButton, false, false, 0);
Alignment align = new Alignment (0f, 0f, 1f, 1f);
align.LeftPadding = 9;
align.TopPadding = 9;
align.RightPadding = 9;
align.BottomPadding = 9;
align.Add (topBar);
HeaderBox ebox = new HeaderBox ();
ebox.GradientBackround = true;
ebox.SetMargins (0, 1, 0, 0);
ebox.Add (align);
ebox.ShowAll ();
VBox.PackStart (ebox, false, false, 0);
VBox.BorderWidth = 0;
Box.BoxChild c = (Box.BoxChild) VBox [ebox];
c.Position = 0;
foreach (PolicySet ps in PolicyService.GetUserPolicySets ()) {
PolicySet copy = ps.Clone ();
originalSets [copy] = ps;
sets.Add (copy);
}
FillPolicySets ();
policiesCombo.Changed += HandlePoliciesComboChanged;
newButton.Clicked += HandleNewButtonClicked;
deleteButton.Clicked += HandleDeleteButtonClicked;
}
示例3: StatusView
public StatusView(string filepath, VersionControlSystem vc)
: base(Path.GetFileName(filepath) + " Status")
{
this.vc = vc;
this.filepath = filepath;
main = new VBox(false, 5);
widget = main;
main.Show();
commandbar = new HBox(false, 5);
main.PackStart(commandbar, false, false, 5);
showRemoteStatus = new Button("Show Remote Status");
commandbar.PackEnd(showRemoteStatus, false, false, 0);
showRemoteStatus.Clicked += new EventHandler(OnShowRemoteStatusClicked);
buttonCommit = new Button("Commit...");
commandbar.PackEnd(buttonCommit, false, false, 0);
buttonCommit.Clicked += new EventHandler(OnCommitClicked);
boxCommit = new VBox(false, 2);
textCommitMessage = new TextView();
HBox boxCommitButtons = new HBox(false, 2);
buttonCommitCancel = new Button("Cancel");
buttonCommitCommit = new Button("Commit");
textCommitMessage.Show();
buttonCommitCancel.Show();
buttonCommitCommit.Show();
boxCommit.PackStart(textCommitMessage, true, true, 0);
boxCommit.PackStart(boxCommitButtons, false, false, 0);
boxCommitButtons.PackEnd(buttonCommitCancel, false, false, 0);
boxCommitButtons.PackEnd(buttonCommitCommit, false, false, 0);
buttonCommitCancel.Clicked += new EventHandler(OnCommitCancelClicked);
buttonCommitCommit.Clicked += new EventHandler(OnCommitCommitClicked);
ScrolledWindow scroller = new ScrolledWindow();
Viewport viewport = new Viewport();
box = new VBox(false, 5);
main.Add(scroller);
viewport.Add(box);
scroller.Add(viewport);
main.ShowAll();
StartUpdate();
}
示例4: 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;
}
示例5: CatalogPropertiesDialog
public CatalogPropertiesDialog(Catalog catalog)
{
this.catalog = catalog;
this.Title = String.Format (Mono.Posix.Catalog.GetString ("{0} properties"), catalog.Name);
this.HasSeparator = false;
cancelButton = (Button)this.AddButton (Stock.Cancel, 0);
okButton = (Button)this.AddButton (Stock.Ok, 1);
cancelButton.Clicked += OnCancelButtonClicked;
okButton.Clicked += OnOkButtonClicked;
VBox vBox = this.VBox;
HBox titleBox = new HBox ();
Gtk.Frame frame = new Frame ("<b>"+Mono.Posix.Catalog.GetString ("Columns to show")+"</b>");
((Label)(frame.LabelWidget)).UseMarkup = true;
titleBox.PackEnd (frame);
vBox.PackStart (titleBox);
VBox columnsBox = new VBox ();
columns = catalog.Columns;
Hashtable columnsToShow = catalog.ColumnsToShow;
checks = new Hashtable ();
foreach (string colName in columns.Keys) {
if (colName.Equals ("id")) continue;
CheckButton check = new CheckButton ((string)columns[colName]);
check.Active = (bool)columnsToShow[colName];
checks.Add (columns[colName], check);
columnsBox.PackStart (check);
}
frame.Add (columnsBox);
this.ShowAll();
}
示例6: AddNewWordToDic
public static void AddNewWordToDic(object sender, EventArgs e)
{
var win = new Gtk.Window("Přidej slovo");
win.SetPosition( WindowPosition.Mouse );
Label l = new Label();
l.Text = "Vloží slovo do aktuálně načteného slovníku, avšak nezmění zdroj (např. soubor dic.txt )";
Entry entry = new Entry();
Button b = new Button("Přidej");
VBox vbox = new VBox();
HBox hbox = new HBox();
vbox.BorderWidth = 10;
vbox.PackStart( l );
vbox.PackEnd( hbox );
hbox.PackStart( entry );
hbox.PackEnd( b );
b.Clicked += delegate {
game.dictionary.Add( entry.Text );
win.HideAll();
win.Destroy();
win.Dispose();
};
win.Add(vbox);
win.ShowAll();
}
示例7: Graphics
// constructor that show the graphic interface to users
public Graphics(Game g)
: base(Gtk.WindowType.Toplevel)
{
Build ();
int scale = 10;
if (Screen.Height < 1000)
scale = 5;
this.game = g;
VBox gridWrapper = new VBox ();
HBox box = new HBox ();
this.status = new Label ("");
this.chooser = new Popup (this, this.game.getChooseableFigures(), handleChooser, scale);
this.mainGrid = new GridWidget (this.game, clickHandler, scale);
gridWrapper.PackStart (status, false, false, 0);
gridWrapper.PackStart (this.mainGrid, false, false, 0);
this.sidebarLeft = new SidebarWidget (g.getRemovedFigures (), "black", scale);
box.PackStart (new HBox ());
box.PackStart (this.sidebarLeft);
box.PackStart (gridWrapper, false, false, 0);
this.sidebarRight = new SidebarWidget (g.getRemovedFigures (), "white", scale);
box.PackEnd (this.sidebarRight);
box.PackStart (new HBox ());
box.ShowAll ();
this.Add (box);
updateGui (this.game.initialState ());
this.Show ();
}
示例8: OpenRemoteServer
public OpenRemoteServer () : base (Catalog.GetString ("Open remote DAAP server"), null)
{
VBox.Spacing = 6;
VBox.PackStart (new Label () {
Xalign = 0.0f,
Text = Catalog.GetString ("Enter server IP address and port:")
}, true, true, 0);
HBox box = new HBox ();
box.Spacing = 12;
VBox.PackStart (box, false, false, 0);
address_entry = ComboBoxEntry.NewText ();
address_entry.Entry.Activated += OnEntryActivated;
address_entry.Entry.WidthChars = 30;
address_entry.Show ();
port_entry = new SpinButton (1d, 65535d, 1d);
port_entry.Value = 3689;
port_entry.Show ();
box.PackStart (address_entry, true, true, 0);
box.PackEnd (port_entry, false, false, 0);
address_entry.HasFocus = true;
VBox.ShowAll ();
AddStockButton (Stock.Cancel, ResponseType.Cancel);
AddStockButton (Stock.Add, ResponseType.Ok, true);
LoadHistory();
}
示例9: Create
public static Gtk.Window Create ()
{
HBox options = new HBox (false, 0);
CheckButton check_button = null;
window = new ColorSelectionDialog ("Color selection dialog");
window.ColorSelection.HasOpacityControl = true;
window.ColorSelection.HasPalette = true;
window.SetDefaultSize (250, 200);
window.VBox.PackStart (options, false, false, 0);
window.VBox.BorderWidth = 10;
check_button = new CheckButton("Show Opacity");
check_button.Active = true;
options.PackStart (check_button, false, false, 0);
check_button.Toggled += new EventHandler (Opacity_Callback);
check_button = new CheckButton("Show Palette");
check_button.Active = true;
options.PackEnd (check_button, false, false, 0);
check_button.Toggled += new EventHandler (Palette_Callback);
window.ColorSelection.ColorChanged += new EventHandler (Color_Changed);
window.OkButton.Clicked += new EventHandler (Color_Selection_OK);
window.CancelButton.Clicked += new EventHandler (Color_Selection_Cancel);
options.ShowAll ();
return window;
}
示例10: SdStatusBar
public SdStatusBar(IStatusBarService manager)
{
Spacing = 3;
BorderWidth = 1;
progress = new ProgressBar ();
this.PackStart (progress, false, false, 0);
this.PackStart (txtStatusBarPanel, true, true, 0);
statusBox = new HBox ();
statusLabel = new Label ();
statusLabel.SetAlignment (0, 0.5f);
statusLabel.Wrap = false;
statusBox.PackEnd (statusLabel, true, true, 0);
txtStatusBarPanel.Add (statusBox);
this.PackStart (cursorStatusBarPanel, false, false, 0);
cursorLabel = new Label (" ");
cursorStatusBarPanel.Add (cursorLabel);
this.PackStart (modeStatusBarPanel, false, false, 0);
modeLabel = new Label (" ");
modeStatusBarPanel.Add (modeLabel);
this.PackStart (iconsStatusBarPanel, false, false, 0);
txtStatusBarPanel.ShowAll ();
Progress.Hide ();
Progress.PulseStep = 0.3;
}
示例11: Init
internal void Init(Gtk.Window parent,
Widget waitingWidget,
ButtonSet buttonSet,
string title,
string statement,
string secondaryStatement)
{
this.Title = title;
this.HasSeparator = false;
this.Resizable = false;
this.Modal = true;
if(parent != null)
this.TransientFor = parent;
this.buttonSet = buttonSet;
VBox contentVBox = new VBox();
this.VBox.Add(contentVBox);
HBox h = new HBox();
contentVBox.PackStart(h, true, true, 0);
h.BorderWidth = 10;
h.Spacing = 10;
if (waitingWidget != null)
{
h.PackStart(waitingWidget, false, false, 0);
}
VBox v = new VBox();
v.Spacing = 10;
Label l = new Label();
l.LineWrap = true;
l.UseMarkup = true;
l.Selectable = false;
l.CanFocus = false;
l.Xalign = 0; l.Yalign = 0;
l.Markup = "<span weight=\"bold\" size=\"larger\">" + GLib.Markup.EscapeText(statement) + "</span>";
v.PackStart(l);
l = new Label(secondaryStatement);
l.LineWrap = true;
l.Selectable = false;
l.CanFocus = false;
l.Xalign = 0; l.Yalign = 0;
v.PackStart(l, true, true, 8);
h.PackEnd(v);
progressBar = new ProgressBar();
contentVBox.PackStart(progressBar, true, false, 8);
progressBar.ActivityBlocks = 20;
progressBar.Orientation = ProgressBarOrientation.LeftToRight;
progressBar.PulseStep = 0.05;
contentVBox.ShowAll();
this.Realized += new EventHandler(OnRealizeWidget);
switch(buttonSet)
{
case ButtonSet.Cancel:
this.AddButton(Stock.Cancel, ResponseType.Cancel);
break;
case ButtonSet.None:
default:
break;
}
bHideCalled = false;
}
示例12: DemoStockBrowser
public DemoStockBrowser () : base ("Stock Icons and Items")
{
SetDefaultSize (-1, 500);
BorderWidth = 8;
HBox hbox = new HBox (false, 8);
Add (hbox);
ScrolledWindow sw = new ScrolledWindow ();
sw.SetPolicy (PolicyType.Never, PolicyType.Automatic);
hbox.PackStart (sw, false, false, 0);
ListStore model = CreateModel ();
TreeView treeview = new TreeView (model);
sw.Add (treeview);
TreeViewColumn column = new TreeViewColumn ();
column.Title = "Name";
CellRenderer renderer = new CellRendererPixbuf ();
column.PackStart (renderer, false);
column.SetAttributes (renderer, "stock_id", Column.Id);
renderer = new CellRendererText ();
column.PackStart (renderer, true);
column.SetAttributes (renderer, "text", Column.Name);
treeview.AppendColumn (column);
treeview.AppendColumn ("Label", new CellRendererText (), "text", Column.Label);
treeview.AppendColumn ("Accel", new CellRendererText (), "text", Column.Accel);
treeview.AppendColumn ("ID", new CellRendererText (), "text", Column.Id);
Alignment align = new Alignment (0.5f, 0.0f, 0.0f, 0.0f);
hbox.PackEnd (align, false, false, 0);
Frame frame = new Frame ("Selected Item");
align.Add (frame);
VBox vbox = new VBox (false, 8);
vbox.BorderWidth = 8;
frame.Add (vbox);
typeLabel = new Label ();
vbox.PackStart (typeLabel, false, false, 0);
iconImage = new Gtk.Image ();
vbox.PackStart (iconImage, false, false, 0);
accelLabel = new Label ();
vbox.PackStart (accelLabel, false, false, 0);
nameLabel = new Label ();
vbox.PackStart (nameLabel, false, false, 0);
idLabel = new Label ();
vbox.PackStart (idLabel, false, false, 0);
treeview.Selection.Mode = Gtk.SelectionMode.Single;
treeview.Selection.Changed += new EventHandler (SelectionChanged);
ShowAll ();
}
示例13: Build
protected virtual void Build ()
{
var hbox3 = new Gtk.HBox ();
hbox3.PackStart (CreateEntry (), true, true, 5);
hbox3.PackEnd (CreatePopupButton (), false, false, 0);
this.Add (hbox3);
}
示例14: MessageDialog
public MessageDialog(ArrayList list)
: base(WindowType.Toplevel)
{
Title = "Error";
IconName = "dialog-error";
DeleteEvent += OnClose;
Resizable = false;
BorderWidth = 6;
vbox = new VBox(false, 6);
Add(vbox);
hbox = new HBox(false, 6);
vbox.PackStart(hbox);
image = new Image(Stock.DialogError, IconSize.Dialog);
hbox.PackStart(image);
table = new Table(2, 3, false);
table.RowSpacing = 6;
hbox.PackEnd(table);
label = new Label();
label.Markup = "<big><b>Some feeds failed to import</b></big>";
table.Attach(label, 1, 2, 0, 1);
buffer = new TextBuffer(new TextTagTable());
foreach ( string feed in list ) {
buffer.Text = buffer.Text + feed+"\n";;
}
textview = new TextView(buffer);
textview.Editable = false;
textview.WrapMode = WrapMode.Word;
textview.SetSizeRequest(400, 150);
textviewsw = new ScrolledWindow(new Adjustment(0, 0, 0, 0, 0, 0), new Adjustment(0, 0, 0, 0, 0, 0));
textviewsw.ShadowType = ShadowType.In;
textviewsw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
textviewsw.Add(textview);
table.Attach(textviewsw, 1, 2, 1, 2);
bbox = new HButtonBox();
bbox.Layout = ButtonBoxStyle.End;
bbox.Spacing = 6;
vbox.PackEnd(bbox);
close_button = new Button(Stock.Close);
close_button.Clicked += new EventHandler(OnClose);
bbox.PackStart(close_button);
TransientFor = (Browser)Summa.Core.Application.Browsers[0];
}
示例15: createActionButtonsContainer
private Container createActionButtonsContainer()
{
var box = new HBox(false, 0);
var deleteContactButton = new Button("Delete Contact");
deleteContactButton.Clicked += delegate(object sender, EventArgs e) {
ShowDeleteContactDialog();
};
box.PackEnd(deleteContactButton, false, false, 0);
var editContactButton = new Button("Edit Contact");
editContactButton.Clicked += delegate(object sender, EventArgs e) {
ShowEditContactDialog ();
};
box.PackEnd(editContactButton, false, false, 0);
var newContactButton = new Button("Add Contact");
newContactButton.Clicked += delegate(object sender, EventArgs e) {
ShowNewContactDialog ();
};
box.PackEnd(newContactButton, false, false, 0);
return box;
}