本文整理汇总了C#中Gtk.Window.EnsureStyle方法的典型用法代码示例。如果您正苦于以下问题:C# Window.EnsureStyle方法的具体用法?C# Window.EnsureStyle怎么用?C# Window.EnsureStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Window
的用法示例。
在下文中一共展示了Window.EnsureStyle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SparkleInfobar
public SparkleInfobar(string icon_name, string title, string text)
{
Window window = new Window (WindowType.Popup) {
Name = "gtk-tooltip"
};
window.EnsureStyle ();
Style = window.Style;
Label label = new Label () {
Markup = "<b>" + title + "</b>\n" + text
};
HBox hbox = new HBox (false, 12) {
BorderWidth = 12
};
hbox.PackStart (new Image (SparkleUIHelpers.GetIcon (icon_name, 24)),
false, false, 0);
hbox.PackStart (label, false, false, 0);
Add (hbox);
}
示例2: NotificationMessage
static NotificationMessage ()
{
Gtk.Window temp_win = new Gtk.Window (WindowType.Popup);
temp_win.Name = "gtk-tooltips";
temp_win.EnsureStyle ();
style = temp_win.Style.Copy ();
}
示例3: MessageBar
public MessageBar () : base (0.0f, 0.5f, 1.0f, 0.0f)
{
win = new Window (WindowType.Popup);
win.Name = "gtk-tooltips";
win.EnsureStyle ();
win.StyleSet += delegate {
Style = win.Style;
};
HBox shell_box = new HBox ();
shell_box.Spacing = 10;
box = new HBox ();
box.Spacing = 10;
image = new AnimatedImage ();
try {
image.Pixbuf = Gtk.IconTheme.Default.LoadIcon ("process-working", 22, IconLookupFlags.NoSvg);
image.FrameHeight = 22;
image.FrameWidth = 22;
Spinning = false;
image.Load ();
} catch {
}
label = new WrapLabel ();
label.Show ();
box.PackStart (image, false, false, 0);
box.PackStart (label, true, true, 0);
box.Show ();
button_box = new HBox ();
button_box.Spacing = 3;
close_button = new Button (new Image (Stock.Close, IconSize.Menu));
close_button.Relief = ReliefStyle.None;
close_button.Clicked += delegate { Hide (); };
close_button.ShowAll ();
close_button.Hide ();
shell_box.PackStart (box, true, true, 0);
shell_box.PackStart (button_box, false, false, 0);
shell_box.PackStart (close_button, false, false, 0);
shell_box.Show ();
Add (shell_box);
EnsureStyle ();
BorderWidth = 3;
}