本文整理汇总了C#中Gtk.VBox类的典型用法代码示例。如果您正苦于以下问题:C# VBox类的具体用法?C# VBox怎么用?C# VBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VBox类属于Gtk命名空间,在下文中一共展示了VBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main()
{
BusG.Init ();
Application.Init ();
btn = new Button ("Click me");
btn.Clicked += OnClick;
VBox vb = new VBox (false, 2);
vb.PackStart (btn, false, true, 0);
Window win = new Window ("D-Bus#");
win.SetDefaultSize (640, 480);
win.Add (vb);
win.Destroyed += delegate {Application.Quit ();};
win.ShowAll ();
bus = Bus.Session;
string bus_name = "org.ndesk.gtest";
ObjectPath path = new ObjectPath ("/org/ndesk/btn");
if (bus.RequestName (bus_name) == RequestNameReply.PrimaryOwner) {
bus.Register (path, btn);
rbtn = btn;
} else {
rbtn = bus.GetObject<Button> (bus_name, path);
}
//run the main loop
Application.Run ();
}
示例2: LastfmSourceContents
// "Coming Soon: Profile, Friends, Events etc")
public LastfmSourceContents () : base ()
{
HscrollbarPolicy = PolicyType.Never;
VscrollbarPolicy = PolicyType.Automatic;
viewport = new Viewport ();
viewport.ShadowType = ShadowType.None;
main_box = new VBox ();
main_box.Spacing = 6;
main_box.BorderWidth = 5;
main_box.ReallocateRedraws = true;
// Clamp the width, preventing horizontal scrolling
SizeAllocated += delegate (object o, SizeAllocatedArgs args) {
// TODO '- 10' worked for Nereid, but not for Cubano; properly calculate the right width we should request
main_box.WidthRequest = args.Allocation.Width - 30;
};
viewport.Add (main_box);
StyleSet += delegate {
viewport.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
viewport.ModifyFg (StateType.Normal, Style.Text (StateType.Normal));
};
AddWithFrame (viewport);
ShowAll ();
}
示例3: CanvasExample
public CanvasExample () {
Gtk.Window win = new Gtk.Window ("Canvas example");
win.DeleteEvent += new DeleteEventHandler (Window_Delete);
VBox vbox = new VBox (false, 0);
win.Add (vbox);
vbox.PackStart (new Label ("Drag - move object.\n" +
"Double click - change color\n" +
"Right click - delete object"),
false, false, 0);
canvas = new Canvas ();
canvas.SetSizeRequest (width, height);
canvas.SetScrollRegion (0.0, 0.0, (double) width, (double) height);
vbox.PackStart (canvas, false, false, 0);
HBox hbox = new HBox (false, 0);
vbox.PackStart (hbox, false, false, 0);
Button add_button = new Button ("Add an object");
add_button.Clicked += new EventHandler (AddObject);
hbox.PackStart (add_button, false, false, 0);
Button quit_button = new Button ("Quit");
quit_button.Clicked += new EventHandler (Quit);
hbox.PackStart (quit_button, false, false, 0);
win.ShowAll ();
}
示例4: NodeKeyInfo
public NodeKeyInfo(NodeKey key)
: base(Gtk.WindowType.Toplevel)
{
this.Build ();
int childNodes = key.ChildNodes != null ? key.ChildNodes.Count : 0;
int values = key.ChildValues != null ? key.ChildValues.Count : 0;
byte[] classnameData = key.ClassnameData != null ? key.ClassnameData : new byte[] {};
string name = key.Name != null ? key.Name : string.Empty;
DateTime timestamp = key.Timestamp != null ? key.Timestamp : DateTime.MinValue;
Label nameLabel = new Label("Name: " + name);
Label timestampLabel = new Label("Timestamp: " + timestamp.ToLongDateString());
Label childNodesLabel = new Label("Child nodes: " + childNodes);
Label valueCountLabel = new Label("Values: " + values);
//Label data = new Label(BitConverter.ToString(classnameData).Replace('-', ' '));
VBox box = new VBox();
box.PackStart(nameLabel, false, false, 30);
box.PackStart(timestampLabel, false, false, 30);
box.PackStart(childNodesLabel, false, false, 30);
box.PackStart(valueCountLabel, false, false, 30);
//data.Wrap = true;
//box.PackStart(data, false, false, 0);
this.Add(box);
this.ShowAll();
}
示例5: DockToolbarFrame
public DockToolbarFrame ()
{
vbox = new VBox ();
Add (vbox);
DockToolbarPanel topPanel = new DockToolbarPanel (this, Placement.Top);
DockToolbarPanel bottomPanel = new DockToolbarPanel (this, Placement.Bottom);
DockToolbarPanel leftPanel = new DockToolbarPanel (this, Placement.Left);
DockToolbarPanel rightPanel = new DockToolbarPanel (this, Placement.Right);
panels = new DockToolbarPanel [4];
panels [(int)Placement.Top] = topPanel;
panels [(int)Placement.Bottom] = bottomPanel;
panels [(int)Placement.Left] = leftPanel;
panels [(int)Placement.Right] = rightPanel;
vbox.PackStart (topPanel, false, false, 0);
HBox hbox = new HBox ();
contentBox = new VBox ();
hbox.PackStart (leftPanel, false, false, 0);
hbox.PackStart (contentBox, true, true, 0);
hbox.PackStart (rightPanel, false, false, 0);
vbox.PackStart (hbox, true, true, 0);
vbox.PackStart (bottomPanel, false, false, 0);
this.Events = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask;
ShowAll ();
}
示例6: ParameterInformationWindow
public ParameterInformationWindow()
{
desc = new Gtk.Label ("");
desc.Xalign = 0;
desc.Wrap = true;
count = new Gtk.Label ("");
mainBox = new HBox (false, 2);
mainBox.BorderWidth = 3;
HBox arrowHBox = new HBox ();
goPrev = new Gtk.Arrow (Gtk.ArrowType.Up, ShadowType.None);
arrowHBox.PackStart (goPrev, false, false, 0);
arrowHBox.PackStart (count, false, false, 0);
goNext = new Gtk.Arrow (Gtk.ArrowType.Down, ShadowType.None);
arrowHBox.PackStart (goNext, false, false, 0);
VBox vBox = new VBox ();
vBox.PackStart (arrowHBox, false, false, 0);
mainBox.PackStart (vBox, false, false, 0);
mainBox.PackStart (desc, true, true, 0);
mainBox.ShowAll ();
this.Add (mainBox);
EnableTransparencyControl = true;
}
示例7: SplashScreenForm
//this is a popup so it behaves like other splashes on Windows, i.e. doesn't show up as a second window in the taskbar.
public SplashScreenForm () : base (Gtk.WindowType.Popup)
{
AppPaintable = true;
this.Decorated = false;
this.WindowPosition = WindowPosition.Center;
this.TypeHint = Gdk.WindowTypeHint.Splashscreen;
try {
using (var stream = BrandingService.GetStream ("SplashScreen.png", true))
bitmap = new Gdk.Pixbuf (stream);
} catch (Exception e) {
LoggingService.LogError ("Can't load splash screen pixbuf 'SplashScreen.png'.", e);
}
progress = new ProgressBar();
progress.Fraction = 0.00;
progress.HeightRequest = 6;
vbox = new VBox();
vbox.BorderWidth = 12;
label = new Gtk.Label ();
label.UseMarkup = true;
label.Xalign = 0;
vbox.PackEnd (progress, false, true, 0);
vbox.PackEnd (label, false, true, 3);
this.Add (vbox);
if (bitmap != null)
this.Resize (bitmap.Width, bitmap.Height);
}
示例8: ComboBoxDialog
public ComboBoxDialog()
{
Title = "Gtk Combo Box Dialog";
WidthRequest = 500;
HeightRequest = 400;
var vbox = new VBox ();
this.VBox.PackStart (vbox);
comboBox = new ComboBox ();
vbox.PackStart (comboBox, false, false, 0);
listStore = new ListStore (typeof(string), typeof(ComboBoxItem));
comboBox.Model = listStore;
var cell = new CellRendererText ();
comboBox.PackStart (cell, true);
comboBox.AddAttribute (cell, "text", 0);
AddItems ();
Child.ShowAll ();
Show ();
}
示例9: 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);
}
示例10: CreateButton
public Gtk.Button CreateButton()
{
Gtk.VBox vbox = new Gtk.VBox();
Gtk.Image image = new Gtk.Image();
string photoFile = Util.GetPhotoFileName(true, p.UniqueID);
if(photoFile != "" && File.Exists(photoFile)) {
try {
Pixbuf pixbuf = new Pixbuf (photoFile); //from a file
image.Pixbuf = pixbuf;
image.Visible = true;
}
catch {
LogB.Warning("catched while adding photo");
}
}
Gtk.Label label_id = new Gtk.Label(p.UniqueID.ToString());
label_id.Visible = false; //hide this to the user
Gtk.Label label_name = new Gtk.Label(p.Name);
label_name.Visible = true;
vbox.PackStart(image);
vbox.PackStart(label_id);
vbox.PackEnd(label_name, false, false, 1);
vbox.Show();
Button b = new Button(vbox);
b.WidthRequest=150;
return b;
}
示例11: DockFrame
public DockFrame ()
{
shadedContainer = new ShadedContainer ();
dockBarTop = new DockBar (this, Gtk.PositionType.Top);
dockBarBottom = new DockBar (this, Gtk.PositionType.Bottom);
dockBarLeft = new DockBar (this, Gtk.PositionType.Left);
dockBarRight = new DockBar (this, Gtk.PositionType.Right);
container = new DockContainer (this);
HBox hbox = new HBox ();
hbox.PackStart (dockBarLeft, false, false, 0);
hbox.PackStart (container, true, true, 0);
hbox.PackStart (dockBarRight, false, false, 0);
mainBox = new VBox ();
mainBox.PackStart (dockBarTop, false, false, 0);
mainBox.PackStart (hbox, true, true, 0);
mainBox.PackStart (dockBarBottom, false, false, 0);
Add (mainBox);
mainBox.ShowAll ();
mainBox.NoShowAll = true;
CompactGuiLevel = 2;
dockBarTop.UpdateVisibility ();
dockBarBottom.UpdateVisibility ();
dockBarLeft.UpdateVisibility ();
dockBarRight.UpdateVisibility ();
}
示例12: build
private void build()
{
this.vbox1 = new VBox();
this.toolbar1 = new Toolbar();
this.aboutbtn1 = new ToolButton(Stock.About);
this.aboutbtn1.Label = "About";
this.aboutbtn1.IsImportant = true;
this.toolbar1.ToolbarStyle = ToolbarStyle.BothHoriz;
this.toolbar1.Add(this.aboutbtn1);
this.vbox1.PackStart(this.toolbar1, false, true, 0);
this.treestore1 = this.populateTreeStoreFromSession();
this.scrollw1 = new ScrolledWindow();
this.hpaned1 = new HPaned();
this.treeview1 = new TreeView(this.treestore1);
this.treeview1.HeadersVisible = true;
this.treeview1.AppendColumn("Session", new CellRendererText(), "text", 0);
this.treeview1.AppendColumn("Name", new CellRendererText(), "text", 1);
this.treeview1.ExpandAll();
this.scrollw1.Add(this.treeview1);
this.iconview1 = new IconView();
this.hpaned1.Add1(this.scrollw1);
this.hpaned1.Add2(this.iconview1);
this.hpaned1.Position = 254;
this.vbox1.PackStart(this.hpaned1, true, true, 0);
this.statusbar1 = new Statusbar();
this.vbox1.PackEnd(this.statusbar1, false, true, 0);
this.Add(this.vbox1);
this.SetSizeRequest(800,600);
this.DeleteEvent += HandleDeleteEvent;
}
示例13: 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);
}
示例14: TrackInfoPopup
public TrackInfoPopup()
: base(Gtk.WindowType.Popup)
{
BorderWidth = 8;
AppPaintable = true;
Resizable = false;
TypeHint = Gdk.WindowTypeHint.Notification;
VBox box = new VBox ();
box.Spacing = 4;
header = new ClassicTrackInfoDisplay ();
header.SetSizeRequest (320, 64);
seek_slider = new ConnectedSeekSlider (SeekSliderLayout.Horizontal);
seek_slider.StreamPositionLabel.FormatString = "<small>{0}</small>";
seek_slider.LeftPadding = 0;
seek_slider.RightPadding = 0;
box.PackStart (header, true, true, 0);
box.PackStart (seek_slider, false, false, 0);
Add (box);
box.ShowAll ();
}
示例15: Build
private void Build()
{
global::Stetic.Gui.Initialize(this);
this.Name = "Client.Forms.MicroChat";
this.Title = "Micro chat";
this.Icon = global::Gdk.Pixbuf.LoadFromResource("Client.Resources.pigeon_clip_art_hight.ico");
this.WindowPosition = Gtk.WindowPosition.Center;
vbox = new VBox();
scrollback_mc = new Scrollback();
scrollback_mc.isMicro = true;
scrollback_mc.Create();
this.TypeHint = Gdk.WindowTypeHint.Normal;
this.DefaultHeight = 420;
this.DefaultWidth = 680;
scrollback_mc.Events = ((global::Gdk.EventMask)(256));
scrollback_mc.Name = "scrollback1";
this.DeleteEvent += new DeleteEventHandler(Close);
vbox.Add(scrollback_mc);
this.Add(vbox);
if ((this.Child != null))
{
this.Child.ShowAll();
}
this.Hide();
}