本文整理汇总了C#中Gtk.Button.Show方法的典型用法代码示例。如果您正苦于以下问题:C# Button.Show方法的具体用法?C# Button.Show怎么用?C# Button.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Button
的用法示例。
在下文中一共展示了Button.Show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AudioView
public AudioView()
{
// this.WidthRequest = 500; //250;
// this.HeightRequest = 375; //187;
Frame frame = new Frame();
frame.BorderWidth = 5;
frame.Show();
VBox vbox = new VBox(false, 0);
frame.Add(vbox);
vbox.Show();
Label label = new Label(Catalog.GetString("Audio Chat in progress..."));
label.Show();
vbox.PackStart(label, false, true, 5);
Button button = new Button(Catalog.GetString("End Call"));
button.Clicked += OnCloseAudioClicked;
button.Show();
vbox.PackStart(button, false, true, 5);
this.Add(frame);
}
示例2: PageNavigationEntry
public PageNavigationEntry (TrackEditorDialog dialog, string completionTable, string completionColumn)
{
this.dialog = dialog;
entry = new TextEntry (completionTable, completionColumn);
entry.Changed += OnChanged;
entry.Activated += EditNextTitle;
entry.KeyPressEvent += delegate (object o, KeyPressEventArgs args) {
if ((args.Event.Key == Gdk.Key.Return || args.Event.Key == Gdk.Key.KP_Enter) &&
(args.Event.State & Gdk.ModifierType.ControlMask) != 0 && dialog.CanGoBackward) {
dialog.NavigateBackward ();
entry.GrabFocus ();
}
};
entry.Show ();
Spacing = 1;
PackStart (entry, true, true, 0);
if (dialog.TrackCount > 1) {
dialog.Navigated += delegate {
forward_button.Sensitive = dialog.CanGoForward;
};
forward_button = EditorUtilities.CreateSmallStockButton (Stock.GoForward);
object tooltip_host = Hyena.Gui.TooltipSetter.CreateHost ();
Hyena.Gui.TooltipSetter.Set (tooltip_host, forward_button, Catalog.GetString ("Advance to the next track and edit its title"));
forward_button.Sensitive = dialog.CanGoForward;
forward_button.Show ();
forward_button.Clicked += EditNextTitle;
PackStart (forward_button, false, false, 0);
}
}
示例3: NewSearchPage
public NewSearchPage()
: base(0.5f, 0.5f, 0f, 0f)
{
base.SetPadding(36, 36, 36, 36);
base.FocusGrabbed += base_FocusGrabbed;
mainVBox = new VBox();
Label label = new Label();
label.Xalign = 0;
label.Markup = "<span size=\"x-large\" weight=\"bold\">Search for files...</span>";
mainVBox.PackStart(label, false, false, 0);
label.Show();
searchEntry = new FileSearchEntry();
searchEntry.WidthRequest = 400;
mainVBox.PackStart(searchEntry, false, false, 6);
searchEntry.Show();
searchButton = new Button("_Search");
searchButton.Image = new Image(Stock.Find, IconSize.Button);
searchButton.Clicked += searchButton_Clicked;
searchButton.Show();
HButtonBox buttonBox = new HButtonBox();
buttonBox.Layout = ButtonBoxStyle.End;
buttonBox.PackStart(searchButton, false, false, 0);
mainVBox.PackStart(buttonBox, false, false, 0);
buttonBox.Show();
base.Add(mainVBox);
mainVBox.Show();
}
示例4: SampleSourceInterface
public SampleSourceInterface(SampleSource source)
{
this.source = source;
Button button = new Button ("Waiting...");
button.Show ();
PackStart (button, true, true, 0);
ServiceManager.PlayerEngine.TrackIntercept += delegate (TrackInfo track) {
if (System.IO.Path.GetExtension (track.Uri.LocalPath) != ".wmv") {
// We don't care about non wmv URIs, so let the engine take care of it
return false;
}
// Stop the engine if playing
ServiceManager.PlayerEngine.Close ();
// Update our UI and switch to our source
button.Label = track.ToString ();
ServiceManager.SourceManager.SetActiveSource (source);
// Tell the engine that we've handled this track
return true;
};
}
示例5: NotebookTabLabel
public NotebookTabLabel(string title)
{
Button button = new Button ();
button.Image = new Gtk.Image (Stock.Close, IconSize.Menu);
button.TooltipText = "Close Tab";
button.Relief = ReliefStyle.None;
RcStyle rcStyle = new RcStyle ();
rcStyle.Xthickness = 0;
rcStyle.Ythickness = 0;
button.ModifyStyle (rcStyle);
button.FocusOnClick = false;
button.Clicked += OnCloseClicked;
button.Show ();
Label label = new Label (title);
label.UseMarkup = false;
label.UseUnderline = false;
label.Show ();
HBox hbox = new HBox (false, 0);
hbox.Spacing = 0;
hbox.Add (label);
hbox.Add (button);
hbox.Show ();
this.Add (hbox);
}
示例6: VersionInformationDialog
public VersionInformationDialog()
: base()
{
AccelGroup accel_group = new AccelGroup();
AddAccelGroup(accel_group);
Modal = true;
Button button = new Button("gtk-close");
button.CanDefault = true;
button.UseStock = true;
button.Show();
DefaultResponse = ResponseType.Close;
button.AddAccelerator("activate", accel_group, (uint)Gdk.Key.Escape,
0, Gtk.AccelFlags.Visible);
AddActionWidget(button, ResponseType.Close);
Title = Catalog.GetString("Assembly Version Information");
BorderWidth = 10;
version_tree = new TreeView();
version_tree.RulesHint = true;
version_tree.AppendColumn(Catalog.GetString("Assembly Name"),
new CellRendererText(), "text", 0);
version_tree.AppendColumn(Catalog.GetString("Version"),
new CellRendererText(), "text", 1);
version_tree.Model = FillStore();
version_tree.CursorChanged += OnCursorChanged;
ScrolledWindow scroll = new ScrolledWindow();
scroll.Add(version_tree);
scroll.ShadowType = ShadowType.In;
scroll.SetSizeRequest(420, 200);
ContentArea.PackStart(scroll, true, true, 0);
ContentArea.Spacing = 5;
path_label = new Label();
path_label.Ellipsize = Pango.EllipsizeMode.End;
path_label.Hide();
path_label.Xalign = 0.0f;
path_label.Yalign = 1.0f;
ContentArea.PackStart(path_label, false, true, 0);
scroll.ShowAll();
}
示例7: 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();
}
示例8: ProgressPanel
public ProgressPanel (string message, string button, StartWorkDelegate StartWork, FinishWorkDelegate FinishWork)
{
Gtk.Label l = new Gtk.Label (message);
l.UseMarkup = true;
l.Show ();
PackStart (l);
pb = new ProgressBar ();
pb.Show ();
PackEnd (pb, false, false, 3);
Button b = new Button (button);
b.Show ();
b.Clicked += new EventHandler (OnStartWorking);
PackEnd (b, false, false, 3);
this.StartWork = StartWork;
this.FinishWork = FinishWork;
}
示例9: Main
public static void Main(string[] args)
{
Application.Init ();
var window = new Gtk.Window (Gtk.WindowType.Toplevel) {
Title = "Treemap Example",
BorderWidth = 0,//12,
};
window.SetDefaultSize (640, 480);
window.DeleteEvent += delegate {
Gtk.Application.Quit ();
};
window.Show ();
var vbox = new Gtk.VBox (false, 6);
window.Add (vbox);
vbox.Show ();
var treemap = new TreeMap.TreeMap () {
Model = BuildModel (),
TextColumn = 0,
WeightColumn = 1,
Title = "Treemap Example",
};
vbox.PackStart (treemap, true, true, 0);
treemap.Show ();
var buttonbox = new Gtk.HButtonBox ();
buttonbox.BorderWidth = 12;
buttonbox.Layout = Gtk.ButtonBoxStyle.End;
vbox.PackStart (buttonbox, false, true, 0);
buttonbox.Show ();
var close = new Gtk.Button (Gtk.Stock.Close);
close.CanDefault = true;
close.Clicked += delegate { Gtk.Application.Quit (); };
buttonbox.PackStart (close, false, true, 0);
window.Default = close;
close.Show ();
Application.Run ();
}
示例10: StartDaemon
public StartDaemon ()
{
HeaderIconFromStock = Stock.DialogError;
Header = Catalog.GetString ("Search service not running");
Append (Catalog.GetString ("The search service does not appear to be running. " +
"You can start it by clicking the button below."));
Gtk.Button button = new Gtk.Button (Catalog.GetString ("Start search service"));
button.Clicked += OnStartDaemon;
button.Show ();
Append (button);
autostart_toggle = new Gtk.CheckButton (Catalog.GetString ("Automatically start service on login"));
autostart_toggle.Active = true;
autostart_toggle.Show ();
Append (autostart_toggle);
}
示例11: CommonAboutDialog
public CommonAboutDialog ()
{
Name = "wizard_dialog";
Title = string.Format (GettextCatalog.GetString ("About {0}"), BrandingService.ApplicationName);
TransientFor = IdeApp.Workbench.RootWindow;
AllowGrow = false;
HasSeparator = false;
BorderWidth = 0;
var notebook = new Notebook ();
notebook.ShowTabs = false;
notebook.ShowBorder = false;
notebook.BorderWidth = 0;
notebook.AppendPage (new AboutMonoDevelopTabPage (), new Label (Title));
notebook.AppendPage (new VersionInformationTabPage (), new Label (GettextCatalog.GetString ("Version Information")));
VBox.PackStart (notebook, true, true, 0);
var copyButton = new Button () { Label = GettextCatalog.GetString ("Copy Information") };
copyButton.Clicked += (sender, e) => CopyBufferToClipboard ();
ActionArea.PackEnd (copyButton, false, false, 0);
copyButton.NoShowAll = true;
var backButton = new Button () { Label = GettextCatalog.GetString ("Show Details") };
ActionArea.PackEnd (backButton, false, false, 0);
backButton.Clicked += (sender, e) => {
if (notebook.Page == 0) {
backButton.Label = GettextCatalog.GetString ("Hide Details");
copyButton.Show ();
notebook.Page = 1;
}
else {
backButton.Label = GettextCatalog.GetString ("Show Details");
copyButton.Hide ();
notebook.Page = 0;
}
};
AddButton (Gtk.Stock.Close, (int)ResponseType.Close);
ShowAll ();
}
示例12: GroupSelector
public GroupSelector()
: base()
{
SetFlag (WidgetFlags.NoWindow);
background = Rectangle.Zero;
glass = new Glass (this);
min_limit = new Limit (this, Limit.LimitType.Min);
max_limit = new Limit (this, Limit.LimitType.Max);
left = new Gtk.Button ();
//left.Add (new Gtk.Image (Gtk.Stock.GoBack, Gtk.IconSize.Button));
left.Add (new Gtk.Arrow (Gtk.ArrowType.Left, Gtk.ShadowType.None));
left.Relief = Gtk.ReliefStyle.None;
//left.Clicked += HandleScrollLeft;
left.Pressed += HandleLeftPressed;
left.ButtonReleaseEvent += HandleScrollReleaseEvent;
left_delay = new Delay (50, new GLib.IdleHandler (HandleScrollLeft));
right = new Gtk.Button ();
//right.Add (new Gtk.Image (Gtk.Stock.GoForward, Gtk.IconSize.Button));
right.Add (new Gtk.Arrow (Gtk.ArrowType.Right, Gtk.ShadowType.None));
right.Relief = Gtk.ReliefStyle.None;
right.Pressed += HandleRightPressed;
right.ButtonReleaseEvent += HandleScrollReleaseEvent;
right_delay = new Delay (50, new GLib.IdleHandler (HandleScrollRight));
//right.Clicked += HandleScrollRight;
this.Put (left, 0, 0);
this.Put (right, 100, 0);
left.Show ();
right.Show ();
CanFocus = true;
Mode = RangeType.Min;
UpdateButtons ();
}
示例13: DockItemGrip
protected DockItemGrip()
{
WidgetFlags |= WidgetFlags.NoWindow;
Widget.PushCompositeChild ();
closeButton = new Button ();
Widget.PopCompositeChild ();
closeButton.WidgetFlags &= ~WidgetFlags.CanFocus;
closeButton.Parent = this;
closeButton.Relief = ReliefStyle.None;
closeButton.Show ();
Image image = new Image (GdlStock.Close, IconSize.Menu);
closeButton.Add (image);
image.Show ();
closeButton.Clicked += new EventHandler (CloseClicked);
Widget.PushCompositeChild ();
iconifyButton = new Button ();
Widget.PopCompositeChild ();
iconifyButton.WidgetFlags &= ~WidgetFlags.CanFocus;
iconifyButton.Parent = this;
iconifyButton.Relief = ReliefStyle.None;
iconifyButton.Show ();
image = new Image (GdlStock.MenuLeft, IconSize.Menu);
iconifyButton.Add (image);
image.Show ();
iconifyButton.Clicked += new EventHandler (IconifyClicked);
tooltips = new Tooltips ();
tooltips.SetTip (iconifyButton, "Iconify", "Iconify this dock");
tooltips.SetTip (closeButton, "Close", "Close this dock");
}
示例14: Main
public static void Main(string[] args)
{
Application.Init();
/* Create a new window */
Window window = new Window ("Pixmap'd Buttons!");
/* It's a good idea to do this for all windows. */
window.DeleteEvent += delete_event;
/* Sets the border width of the window. */
window.BorderWidth = 10;
window.Resize(400,300);
/* Create a new button */
Button button = new Button();
/* Connect the "clicked" signal of the button to our callback */
button.Clicked += callback;
/* This calls our box creating function */
Widget box = xpm_label_box ("info.xpm", "cool button");
/* Pack and show all our widgets */
box.Show();
button.Add(box);
button.Show();
window.Add(button);
window.ShowAll();
/* Rest in gtk_main and wait for the fun to begin! */
Application.Run();
}
示例15: ProfileConfigurationDialog
public ProfileConfigurationDialog(Profile profile)
: base()
{
this.profile = profile;
BorderWidth = 5;
AccelGroup accel_group = new AccelGroup();
AddAccelGroup(accel_group);
Button button = new Button(Stock.Close);
button.CanDefault = true;
button.Show();
if(ApplicationContext.Debugging) {
Button test_button = new Button("Test S-Expr");
test_button.Show();
test_button.Clicked += delegate {
if(sexpr_results != null) {
sexpr_results.Buffer.Text = profile.Pipeline.GetDefaultProcess();
}
};
ActionArea.PackStart(test_button, true, true, 0);
sexpr_results = new TextView();
}
AddActionWidget(button, ResponseType.Close);
DefaultResponse = ResponseType.Close;
button.AddAccelerator("activate", accel_group, (uint)Gdk.Key.Return,
0, AccelFlags.Visible);
BuildContents();
LoadProfile();
}