本文整理汇总了C#中Gtk.HBox.SetChildPacking方法的典型用法代码示例。如果您正苦于以下问题:C# HBox.SetChildPacking方法的具体用法?C# HBox.SetChildPacking怎么用?C# HBox.SetChildPacking使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.HBox
的用法示例。
在下文中一共展示了HBox.SetChildPacking方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Reparent
private void Reparent (Widget widget, HBox box, int index)
{
if (widget.Parent == box) {
return;
}
if (widget.Parent == null) {
box.PackStart (widget, false, false, 0);
} else {
widget.Reparent (box);
box.SetChildPacking (widget, false, false, 0, PackType.Start);
}
box.ReorderChild (widget, index);
widget.Show ();
}
示例2: addtabwithicon
Gtk.Label addtabwithicon(string filename,string label,Gtk.Widget contents)
{
Gtk.Image image=new Gtk.Image(MainClass.GetResource(""+filename));
image.SetSizeRequest(16,16);
Gtk.Label lable=new Gtk.Label(label);
Gtk.HBox box=new Gtk.HBox();
box.PackStart(image);
box.PackStart(lable);
box.SetChildPacking(image,false,false,0,PackType.Start);
box.ShowAll();
notebook1.InsertPage(contents,box,-1);
notebook1.ShowAll();
return lable;
}
示例3: MainWindow
public MainWindow()
: base(Gtk.WindowType.Toplevel)
{
Build();
trayIcon = new StatusIcon(MainClass.GetResource("omvviewer-light.xpm"));
trayIcon.Visible=true;
trayIcon.Tooltip="Disconnected";
trayIcon.Activate+= delegate{
Visible=!Visible;
this.Deiconify();
};
trayIcon.Activate += delegate { trayIcon.Blinking = false; this.UrgencyHint = false; };
trayIcon.PopupMenu += delegate {
Gtk.Menu menu = new Gtk.Menu();
Gtk.ImageMenuItem menu_hide = new ImageMenuItem("Minimse");
Gtk.ImageMenuItem menu_restore = new ImageMenuItem("Restore");
AccelGroup ag=new AccelGroup();
Gtk.ImageMenuItem menu_quit = new ImageMenuItem("gtk-quit",ag);
menu_quit.ButtonPressEvent += new ButtonPressEventHandler(menu_quit_fn);
menu_restore.ButtonPressEvent += new ButtonPressEventHandler(menu_restore_fn);
menu_hide.ButtonPressEvent += new ButtonPressEventHandler(menu_hide_fn);
if(MainClass.win.Visible)
menu.Append(menu_hide);
else
menu.Append(menu_restore);
menu.Append(menu_quit);
menu.ShowAll();
menu.Popup();
};
this.Icon=MainClass.GetResource("omvviewer-light.xpm");
status_location=new Gtk.Label("Location: Unknown (0,0,0)");
appearancesetting.Set();
status_balance=new Gtk.HBox();
status_balance_lable=new Gtk.Label("?");
Gtk.Image balicon=new Gtk.Image();
balicon.Pixbuf = MainClass.GetResource("status_money.png");
status_balance.PackStart(balicon);
status_balance.PackStart(status_balance_lable);
status_balance.SetChildPacking(balicon,false,false,0,PackType.Start);
status_balance.SetChildPacking(status_balance_lable,false,false,0,PackType.Start);
status_parcel=new Gtk.Label("Parcel: Unknown");
this.statusbar1.PackStart(status_location);
this.statusbar1.PackStart(status_parcel);
this.statusbar1.PackStart(status_balance);
this.Title="omvviewer light v0.48.1";
chat=new ChatLayout();
chat_tab_lable=this.addtabwithicon("icn_voice-pvtfocus.png","Chat",chat);
chat.passontablable(chat_tab_lable);
this.notebook.SwitchPage += new SwitchPageHandler(chat.onSwitchPage);
this.LocationAction.Active = MainClass.appsettings.tab_location;
this.SearchAction.Active = MainClass.appsettings.tab_search;
this.GroupsAction.Active = MainClass.appsettings.tab_groups;
this.InventoryAction.Active = MainClass.appsettings.tab_inv;
this.ObjectsAction.Active = MainClass.appsettings.tab_objects;
this.ParcelAction.Active = MainClass.appsettings.tab_parcel;
this.statusbar1.ShowAll();
MainClass.onRegister += new MainClass.register(MainClass_onRegister);
MainClass.onDeregister += new MainClass.deregister(MainClass_onDeregister);
if(MainClass.client != null ) { MainClass_onRegister(); }
//this.menubar1.get
this.AvaiableAction.Activate();
this.StandingAction.Activate();
this.AvaiableAction.Sensitive=false;
this.AwayAction.Sensitive=false;
this.BusyAction.Sensitive=false;
this.StandingAction.Sensitive=false;
this.CrouchAction.Sensitive=false;
this.FlyAction.Sensitive=false;
this.GroundSitAction.Sensitive=false;
this.SittingAction.Sensitive=false;
this.WindowStateEvent += delegate { if (this.Visible) { trayIcon.Blinking = false; this.UrgencyHint = false; };};
this.DeleteEvent += new DeleteEventHandler(MainWindow_DeleteEvent);
GLib.Timeout.Add(1000,OnUpdateStatus);
tooltips1 = new Tooltips();
this.statusbar1.Push(1, "Logged out");
//.........这里部分代码省略.........
示例4: makeimwindow
void makeimwindow(string name,ChatConsole cs,bool group,UUID target)
{
Gtk.Image image=new Gtk.Image(MainClass.GetResource("closebox.png"));
image.HeightRequest=16;
image.WidthRequest=16;
Gtk.Image icon;
if(group)
icon=new Gtk.Image(MainClass.GetResource("icon_group.png"));
else
icon=new Gtk.Image(MainClass.GetResource("icn_voice-groupfocus.png"));
image.SetSizeRequest(16,16);
Gtk.Label lable=new Gtk.Label(name);
Gtk.Button button=new Gtk.Button(image);
button.SetSizeRequest(16,16);
Gtk.HBox box=new Gtk.HBox();
box.PackStart(icon);
box.PackStart(lable);
box.PackStart(button);
box.SetChildPacking(image,false,false,0,PackType.Start);
box.ShowAll();
notebook.InsertPage(cs,box,-1);
notebook.ShowAll();
cs.tabLabel=lable;
AsyncNameUpdate ud;
if(target!=UUID.Zero)
{
if(group)
ud=new AsyncNameUpdate(target,true);
else
ud=new AsyncNameUpdate(target,false);
ud.onNameCallBack += delegate(string namex,object [] values){cs.tabLabel.Text=namex;};
ud.go();
}
button.Clicked += new EventHandler(cs.clickclosed);
this.notebook.SwitchPage += new SwitchPageHandler(cs.onSwitchPage);
}
示例5: doicons
void doicons(Parcel parcel)
{
if(status_icons!=null)
status_icons.Destroy();
status_icons=new Gtk.HBox();
this.statusbar1.PackStart(status_icons);
if((parcel.Flags & OpenMetaverse.ParcelFlags.AllowFly) != OpenMetaverse.ParcelFlags.AllowFly )
{
Gtk.Image myimage=new Gtk.Image(MainClass.GetResource("status_no_fly.png"));
status_icons.PackStart(myimage);
status_icons.SetChildPacking(myimage,false,false,0,PackType.Start);
}
if((parcel.Flags & OpenMetaverse.ParcelFlags.RestrictPushObject)==OpenMetaverse.ParcelFlags.RestrictPushObject)
{
Gtk.Image myimage=new Gtk.Image(MainClass.GetResource("status_no_push.png"));
status_icons.PackStart(myimage);
status_icons.SetChildPacking(myimage,false,false,0,PackType.Start);
}
if((parcel.Flags & OpenMetaverse.ParcelFlags.AllowOtherScripts)!=OpenMetaverse.ParcelFlags.AllowOtherScripts)
{
Gtk.Image myimage=new Gtk.Image(MainClass.GetResource("status_no_scripts.png"));
status_icons.PackStart(myimage);
status_icons.SetChildPacking(myimage,false,false,0,PackType.Start);
}
if((parcel.Flags & OpenMetaverse.ParcelFlags.CreateObjects)!=OpenMetaverse.ParcelFlags.CreateObjects)
{
Gtk.Image myimage=new Gtk.Image(MainClass.GetResource("status_no_build.png"));
status_icons.PackStart(myimage);
status_icons.SetChildPacking(myimage,false,false,0,PackType.Start);
}
status_icons.ShowAll();
}