本文整理汇总了C#中Gtk.Image.SetPadding方法的典型用法代码示例。如果您正苦于以下问题:C# Image.SetPadding方法的具体用法?C# Image.SetPadding怎么用?C# Image.SetPadding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Image
的用法示例。
在下文中一共展示了Image.SetPadding方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TabLabel
public TabLabel (Label label, Gtk.Image icon) : base (false, 0)
{
this.title = label;
this.icon = icon;
icon.Xpad = 2;
EventBox eventBox = new EventBox ();
eventBox.BorderWidth = 0;
eventBox.VisibleWindow = false;
eventBox.Add (icon);
this.PackStart (eventBox, false, true, 0);
titleBox = new EventBox ();
titleBox.VisibleWindow = false;
titleBox.Add (title);
this.PackStart (titleBox, true, true, 0);
Gtk.Rc.ParseString ("style \"MonoDevelop.TabLabel.CloseButton\" {\n GtkButton::inner-border = {0,0,0,0}\n }\n");
Gtk.Rc.ParseString ("widget \"*.MonoDevelop.TabLabel.CloseButton\" style \"MonoDevelop.TabLabel.CloseButton\"\n");
Button button = new Button ();
button.CanDefault = false;
Gtk.Image closeIcon = new Gtk.Image (closeImage);
closeIcon.SetPadding (0, 0);
button.Image = closeIcon;
button.Relief = ReliefStyle.None;
button.BorderWidth = 0;
button.Clicked += new EventHandler(ButtonClicked);
button.Name = "MonoDevelop.TabLabel.CloseButton";
this.PackStart (button, false, true, 0);
this.ClearFlag (WidgetFlags.CanFocus);
this.BorderWidth = 0;
this.ShowAll ();
}
示例2: NotebookLabel
public NotebookLabel(string stockIcon, string caption)
{
this.BorderWidth = 1;
Gtk.Image image = new Gtk.Image(MainClass.Tools.GetIconFromStock(stockIcon, Gtk.IconSize.Menu));
image.SetPadding(2,2);
this.PackStart(image, false, false, 0);
lblDisplay.Text = caption;
this.PackStart(lblDisplay, false, false, 0);
this.ShowAll();
}
示例3: NotebookMenuLabel
//Gtk.Image image;
public NotebookMenuLabel(string stockIcon, string caption, Gtk.Menu popupMenu)
{
this.CanFocus=false;
this.BorderWidth = 1;
this.popupMenu = popupMenu;
Gtk.Image image = new Gtk.Image(MainClass.Tools.GetIconFromStock(stockIcon, Gtk.IconSize.Menu));
image.SetPadding(2,2);
this.PackStart(image, false, false, 0);
lblDisplay.Text = caption;
this.caption = caption;
this.PackStart(lblDisplay, false, false, 0);
Pixbuf default_pixbuf = null;
string file = System.IO.Path.Combine(MainClass.Paths.ResDir, "stock-menu.png");
if (System.IO.File.Exists(file)) {
default_pixbuf = new Pixbuf(file);
Button btnClose = new Button(new Gtk.Image(default_pixbuf));
btnClose.TooltipText = "Menu";
btnClose.Relief = ReliefStyle.None;
btnClose.CanFocus = false;
btnClose.WidthRequest = btnClose.HeightRequest = 22;
this.popupMenu.AttachToWidget(btnClose,new Gtk.MenuDetachFunc(DetachWidget));
btnClose.Clicked += delegate {
if (this.popupMenu!= null){
this.popupMenu.ShowAll();
//this.popupMenu.Popup();
this.popupMenu.Popup(null,null, new Gtk.MenuPositionFunc (GetPosition) ,3,Gtk.Global.CurrentEventTime);
}
};
this.PackEnd(btnClose, false, false, 0);
}
this.ShowAll();
}
示例4: NotebookEditorLabel
public NotebookEditorLabel(EditorNotebook parent_netbook, IEditor se)
{
this.CanFocus=false;
this.BorderWidth = 1;
string stockIcon = "home.png";
if (se.FileName != "StartPage"){
stockIcon = MainClass.Tools.GetIconForExtension( System.IO.Path.GetExtension(se.Caption) );
}
image = new Gtk.Image(MainClass.Tools.GetIconFromStock(stockIcon, Gtk.IconSize.Menu));
image.SetPadding(2,2);
this.PackStart(image, false, false, 0);
caption =se.Caption.Replace("_","__");
lblDisplay.Text = caption;
lblDisplay.CanFocus=false;
this.PackStart(lblDisplay, false, false, 0);
Pixbuf default_pixbuf = null;
string file = System.IO.Path.Combine(MainClass.Paths.ResDir, "stock-close.png");
if (System.IO.File.Exists(file)) {
default_pixbuf = new Pixbuf(file);
Button btnClose = new Button(new Gtk.Image(default_pixbuf));
btnClose.TooltipText = MainClass.Languages.Translate("close");
btnClose.Relief = ReliefStyle.None;
btnClose.CanFocus = false;
btnClose.WidthRequest = btnClose.HeightRequest = 18;
btnClose.Clicked += delegate { parent_netbook.ClosePage(se); };
this.PackEnd(btnClose, false, false, 0);
}
lblDisplay.TooltipText = se.FileName;
this.ShowAll();
}
示例5: StatusIcon
public StatusIcon (MonoDevelopStatusBar statusBar, Gdk.Pixbuf icon)
{
this.statusBar = statusBar;
this.icon = icon;
box = new EventBox ();
image = new Image (icon);
image.SetPadding (0, 0);
box.Child = image;
}
示例6: StatusIcon
public StatusIcon (StatusArea statusBar, Gdk.Pixbuf icon)
{
this.statusBar = statusBar;
this.icon = icon;
box = new EventBox ();
box.VisibleWindow = false;
image = new Image (icon);
image.SetPadding (0, 0);
box.Child = image;
box.Events |= Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;
box.EnterNotifyEvent += HandleEnterNotifyEvent;
box.LeaveNotifyEvent += HandleLeaveNotifyEvent;
}