本文整理汇总了C#中Gtk.Button类的典型用法代码示例。如果您正苦于以下问题:C# Button类的具体用法?C# Button怎么用?C# Button使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Button类属于Gtk命名空间,在下文中一共展示了Button类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
uint rows = 5;
uint columns = 5;
uint spacing = 2;
Application.Init ();
Window win = new Window ("Minesweeper");
var table = new global::Gtk.Table (rows, columns, false);
table.RowSpacing = (spacing);
table.ColumnSpacing = (spacing);
for (uint row = 0; row < rows; row++) {
for (uint column = 0; column < columns; column++) {
var button = new Button();
button.CanFocus = true;
button.Label = (string.Empty.PadLeft(5));
button.Clicked += new EventHandler(OnButtonClicked);
table.Attach(button, row, row+1,column, column+1);
}
}
table.ShowAll();
win.Add(table);
win.Show ();
Application.Run ();
}
开发者ID:HackerBaloo,项目名称:minesweeper,代码行数:25,代码来源:Main.cs
示例2: MainWindow_Event
public MainWindow_Event()
: base("")
{
SetDefaultSize(250, 200);
SetPosition(WindowPosition.Center);
DeleteEvent += delegate { Application.Quit(); };
Fixed fix = new Fixed();
Button btn = new Button("Enter");
btn.EnterNotifyEvent += OnEnter;
_quit = new Button("Quit");
//_quit.Clicked += OnClick;
_quit.SetSizeRequest(80, 35);
CheckButton cb = new CheckButton("connect");
cb.Toggled += OnToggled;
fix.Put(btn, 50, 20);
fix.Put(_quit, 50, 50);
fix.Put(cb, 120, 20);
Add(fix);
ShowAll();
}
开发者ID:oraora81,项目名称:NOCmono,代码行数:26,代码来源:MainWindow_Event.cs
示例3: Button
void IPadContent.Initialize (IPadWindow window)
{
this.window = window;
window.Icon = icon;
DockItemToolbar toolbar = window.GetToolbar (PositionType.Right);
buttonStop = new Button (new Gtk.Image ("gtk-stop", IconSize.Menu));
buttonStop.Clicked += new EventHandler (OnButtonStopClick);
buttonStop.TooltipText = GettextCatalog.GetString ("Stop");
toolbar.Add (buttonStop);
buttonClear = new Button (new Gtk.Image ("gtk-clear", IconSize.Menu));
buttonClear.Clicked += new EventHandler (OnButtonClearClick);
buttonClear.TooltipText = GettextCatalog.GetString ("Clear console");
toolbar.Add (buttonClear);
buttonPin = new ToggleButton ();
buttonPin.Image = new Gtk.Image ((IconId)"md-pin-up", IconSize.Menu);
buttonPin.Image.ShowAll ();
buttonPin.Clicked += new EventHandler (OnButtonPinClick);
buttonPin.TooltipText = GettextCatalog.GetString ("Pin output pad");
toolbar.Add (buttonPin);
toolbar.ShowAll ();
}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:25,代码来源:DefaultMonitorPad.cs
示例4: BebidasCalientesView
public BebidasCalientesView(Label labelTotalMainWindow,Button botonNP)
: base(Gtk.WindowType.Toplevel)
{
this.Build ();
labelBebidasCalientes.Markup = "<span size='xx-large' weight='bold'>Bebidas Calientes</span>";
botonNuevoPedidoMainWindow = botonNP;
totalMainWindow = labelTotalMainWindow;
dbConnection = ApplicationContext.Instance.DbConnection;
//hacer la consulta bd
IDbCommand dbCommand = dbConnection.CreateCommand ();
dbCommand.CommandText =
"select * from bebidascalientes ";
IDataReader dataReader = dbCommand.ExecuteReader ();
//Aquí creamos un objeto de la clase RellenarTreeView y le pasamos a la clase el treeView y el dataReader
RellenarTreeView rellenar =new RellenarTreeView();
rellenar.llenarTreeView(treeView, dataReader);
//recogemos el listStore que usamos en la clase RellenarTreeView, para ser usada en los los métodos en esa clase
listStore = rellenar.get_ListStore();
dataReader.Close ();
}
开发者ID:JulianaCFS,项目名称:Proyecto,代码行数:27,代码来源:BebidasCalientesView.cs
示例5: creaVentanaArticulo
public void creaVentanaArticulo()
{
titulo="Añadir articulo";
ventana(titulo);
Label cat=new Label("Introduce el nombre del nuevo articulo: ");
text= new Entry();
ComboBox cb=new ComboBox();
Label cat2=new Label("Selecciona la categoria: ");
combot= new ComboBoxHelper(App.Instance.DbConnection,cb,"nombre","id",0,"categoria");
tabla.Attach(cat,0,1,0,1);
tabla.Attach(text,1,2,0,1);
tabla.Attach(cat2,0,1,1,2);
tabla.Attach(cb,1,2,1,2);
Label pre=new Label("Introduce el precio del nuevo articulo: ");
precio=new Entry();
tabla.Attach(pre,0,1,2,3);
tabla.Attach(precio,1,2,2,3);
Button button=new Button("Añadir");
button.Clicked +=delegate{
añadirArticulo(App.Instance.DbConnection);
if(!enBlanco){
window.Destroy();
refresh();
}
};
tabla.Attach(button,1,2,3,4);
window.Add(vbox);
window.ShowAll();
}
开发者ID:nerea123,项目名称:ad,代码行数:30,代码来源:ArticuloListView.cs
示例6: ProgressDialog
public ProgressDialog(string title, CancelButtonType cancel_button_type, int total_count, Gtk.Window parent_window)
{
Title = title;
this.total_count = total_count;
if (parent_window != null)
this.TransientFor = parent_window;
HasSeparator = false;
BorderWidth = 6;
SetDefaultSize (300, -1);
message_label = new Label (String.Empty);
VBox.PackStart (message_label, true, true, 12);
progress_bar = new ProgressBar ();
VBox.PackStart (progress_bar, true, true, 6);
switch (cancel_button_type) {
case CancelButtonType.Cancel:
button = (Gtk.Button)AddButton (Gtk.Stock.Cancel, (int) ResponseType.Cancel);
break;
case CancelButtonType.Stop:
button = (Gtk.Button)AddButton (Gtk.Stock.Stop, (int) ResponseType.Cancel);
break;
}
Response += new ResponseHandler (HandleResponse);
}
开发者ID:iainlane,项目名称:f-spot,代码行数:29,代码来源:ProgressDialog.cs
示例7: GetButton
public static Widget GetButton (Action action, bool label)
{
Widget w = action.CreateIcon (IconSize.Button);
if (label) {
HBox box = new HBox ();
box.PackStart (w, false, false, 0);
Label l = new Label ();
l.Markup = "<small>" + action.Label + "</small>";
box.PackStart (l);
w = box;
}
Button button;
if (action is ToggleAction) {
ToggleButton toggle = new ToggleButton ();
toggle.Active = ((ToggleAction)action).Active;
button = toggle;
} else {
button = new Button ();
}
button.Relief = ReliefStyle.None;
button.Add (w);
w.ShowAll ();
action.ConnectProxy (button);
tips.SetTip (button, action.Tooltip, String.Empty);
return button;
}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:27,代码来源:ItemAction.cs
示例8: PulseExecute
//execution
public PulseExecute(int personID, string personName, int sessionID, string type, double fixedPulse, int totalPulsesNum,
Chronopic cp, Gtk.TextView event_execute_textview_message, Gtk.Window app, int pDN, bool volumeOn,
//double progressbarLimit,
ExecutingGraphData egd
)
{
this.personID = personID;
this.personName = personName;
this.sessionID = sessionID;
this.type = type;
this.fixedPulse = fixedPulse;
this.totalPulsesNum = totalPulsesNum;
this.cp = cp;
this.event_execute_textview_message = event_execute_textview_message;
this.app = app;
this.pDN = pDN;
this.volumeOn = volumeOn;
// this.progressbarLimit = progressbarLimit;
this.egd = egd;
fakeButtonUpdateGraph = new Gtk.Button();
fakeButtonEventEnded = new Gtk.Button();
fakeButtonFinished = new Gtk.Button();
simulated = false;
needUpdateEventProgressBar = false;
needUpdateGraph = false;
//initialize eventDone as a Pulse
eventDone = new Pulse();
}
开发者ID:dineshkummarc,项目名称:chronojump,代码行数:35,代码来源:pulse.cs
示例9: Main15
//private static Gdk.Pixmap pixmap = null;
//private static Gtk.InputDialog inputDialog = null;
public static int Main15 (string[] args) {
Application.Init ();
win = new Gtk.Window ("Scribble XInput Demo");
win.DeleteEvent += new DeleteEventHandler (WindowDelete);
vBox = new VBox (false, 0);
win.Add (vBox);
darea = new Gtk.DrawingArea ();
darea.SetSizeRequest (200, 200);
// darea.ExtensionEvents=ExtensionMode.Cursor;
vBox.PackStart (darea, true, true, 0);
//darea.ExposeEvent += new ExposeEventHandler (ExposeEvent);
darea.ConfigureEvent += new ConfigureEventHandler (ConfigureEvent);
darea.MotionNotifyEvent += new MotionNotifyEventHandler (MotionNotifyEvent);
darea.ButtonPressEvent += new ButtonPressEventHandler (ButtonPressEvent);
darea.Events = EventMask.ExposureMask | EventMask.LeaveNotifyMask |
EventMask.ButtonPressMask | EventMask.PointerMotionMask;
inputButton = new Button("Input Dialog");
vBox.PackStart (inputButton, false, false, 0);
inputButton.Clicked += new EventHandler (InputButtonClicked);
quitButton = new Button("Quit");
vBox.PackStart (quitButton, false, false, 0);
quitButton.Clicked += new EventHandler (QuitButtonClicked);
win.ShowAll ();
Application.Run ();
return 0;
}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:37,代码来源:ScribbleXInput.cs
示例10: ViewNameIcon
public ViewNameIcon() : base()
{
upbutton = new Button();
upbutton.Add( new Image(Stock.GoUp, IconSize.Button) );
upbutton.Clicked += OnUpClicked;
downbutton = new Button();
downbutton.Add( new Image(Stock.GoDown, IconSize.Button) );
downbutton.Clicked += OnDownClicked;
swindow = new ScrolledWindow();
view = new IconView();
CellRendererPixbuf cellicon= new CellRendererPixbuf();
CellRendererText celltext = new CellRendererText();
celltext.Xalign=0.5f;
view.PackStart(cellicon, false);
view.SetCellDataFunc(cellicon, CellRenderFunctions.RenderIcon);
view.PackStart(celltext, false);
view.SetCellDataFunc(celltext, CellRenderFunctions.RenderName);
view.SelectionMode = Gtk.SelectionMode.Browse;
view.SelectionChanged += OnSelectionChanged;
view.ItemActivated += OnRowActivated;
swindow.Add(view);
swindow.HscrollbarPolicy = PolicyType.Never;
swindow.VscrollbarPolicy = PolicyType.Automatic;
this.PackStart(upbutton, false, false, 0);
this.PackStart(swindow, true, true, 0);
this.PackStart(downbutton, false, false, 0);
store = new StoreBase();
view.Model=store.ViewModel;
ShowAll();
}
开发者ID:hpbaotho,项目名称:supos,代码行数:33,代码来源:ViewNameIcon.cs
示例11: ExportDialog
public ExportDialog(Catalog catalog, bool searchOn)
: base(Mono.Posix.Catalog.GetString ("Export"), null, DialogFlags.NoSeparator | DialogFlags.Modal)
{
this.catalog = catalog;
this.templates = new Hashtable ();
this.searchOn = searchOn;
Glade.XML gxml = new Glade.XML (null, "dialogexport.glade", "hbox1", null);
gxml.Autoconnect(this);
cancelButton = (Button)this.AddButton (Gtk.Stock.Cancel, 0);
okButton = (Button)this.AddButton (Gtk.Stock.Ok, 1);
cancelButton.Clicked += OnCancelButtonClicked;
okButton.Clicked += OnOkButtonClicked;
VBox vBox = this.VBox;
vBox.Add ((Box)gxml["hbox1"]);
PopulateComboBox ();
if (!searchOn) {
radioButtonSearch.Sensitive = false;
}
radioButtonActive.Label = String.Format (Mono.Posix.Catalog.GetString ("Export the whole {0} catalog"),catalog.ShortDescription);
this.ShowAll();
}
开发者ID:MonoBrasil,项目名称:historico,代码行数:28,代码来源:ExportDialog.cs
示例12: MonoMacPackagingSettingsDialog
public MonoMacPackagingSettingsDialog ()
{
this.Title = GettextCatalog.GetString ("Create Mac Installer");
this.DestroyWithParent = true;
this.Modal = true;
settingsWidget.Show ();
var al = new Alignment (0.5f, 0.5f, 1.0f, 1.0f) {
TopPadding = 12,
BottomPadding = 12,
RightPadding = 12,
LeftPadding = 12,
Child = settingsWidget,
};
al.Show ();
this.VBox.PackStart (al, true, true, 0);
var okButton = new Button () {
Label = GettextCatalog.GetString ("Create Package")
};
var cancelButton = new Button (Stock.Cancel);
this.AddActionWidget (cancelButton, ResponseType.Cancel);
this.AddActionWidget (okButton, ResponseType.Ok);
this.ActionArea.ShowAll ();
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:27,代码来源:MonoMacPackagingSettingsDialog.cs
示例13: Build
protected virtual void Build()
{
Gui.Initialize (this);
// Widget BolPatcher.MenuGameWidget
BinContainer.Attach (this);
Name = "BolPatcher.MenuGameWidget";
// Container child BolPatcher.MenuGameWidget.Gtk.Container+ContainerChild
_frame1 = new Frame ();
_frame1.Name = "frame1";
_frame1.ShadowType = 0;
// Container child frame1.Gtk.Container+ContainerChild
_gtkAlignment = new Alignment (0F, 0F, 1F, 1F);
_gtkAlignment.Name = "GtkAlignment";
_gtkAlignment.LeftPadding = 12;
// Container child GtkAlignment.Gtk.Container+ContainerChild
_button2 = new Button ();
_button2.CanFocus = true;
_button2.Name = "button2";
_button2.UseUnderline = true;
_button2.Label = Catalog.GetString ("GtkButton");
_gtkAlignment.Add (_button2);
_frame1.Add (_gtkAlignment);
_gtkLabel1 = new Label ();
_gtkLabel1.Name = "GtkLabel1";
_gtkLabel1.LabelProp = Catalog.GetString ("<b>GtkFrame</b>");
_gtkLabel1.UseMarkup = true;
_frame1.LabelWidget = _gtkLabel1;
Add (_frame1);
if ((Child != null)) {
Child.ShowAll ();
}
Hide ();
}
开发者ID:githuis,项目名称:BolPatcher,代码行数:33,代码来源:BolPatcher.MenuGameWidget.cs
示例14: base
public AñadirNumPersonas(Label labelTotalMainWindow,Button botonNP)
: base(Gtk.WindowType.Toplevel)
{
this.Build ();
botonNuevoPedidoMainWindow = botonNP;
totalMainWindow = labelTotalMainWindow;
}
开发者ID:JulianaCFS,项目名称:Proyecto,代码行数:7,代码来源:AñadirNumPersonas.cs
示例15: NotificationMessage
public NotificationMessage (string t, string m) : base (false, 5)
{
this.Style = style;
BorderWidth = 5;
icon = new Image (Stock.DialogInfo, IconSize.Dialog);
this.PackStart (icon, false, true, 5);
VBox vbox = new VBox (false, 5);
this.PackStart (vbox, true, true, 0);
title = new Label ();
title.SetAlignment (0.0f, 0.5f);
this.Title = t;
vbox.PackStart (title, false, true, 0);
message = new Label ();
message.LineWrap = true;
message.SetSizeRequest (500, -1); // ugh, no way to sanely reflow a gtk label
message.SetAlignment (0.0f, 0.0f);
this.Message = m;
vbox.PackStart (message, true, true, 0);
action_box = new HBox (false, 3);
Button hide_button = new Button (Catalog.GetString ("Hide"));
hide_button.Clicked += OnHideClicked;
action_box.PackEnd (hide_button, false, true, 0);
Alignment action_align = new Alignment (1.0f, 0.5f, 0.0f, 0.0f);
action_align.Add (action_box);
vbox.PackStart (action_align, false, true, 0);
}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:34,代码来源:NotificationArea.cs
示例16: 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;
var closeIcon = new Xwt.ImageView (closeImage).ToGtkWidget ();
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 ();
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:33,代码来源:TabLabel.cs
示例17: ShowSetupPage
private void ShowSetupPage()
{
Header = CmisSync.Properties_Resources.ResourceManager.GetString("Welcome", CultureInfo.CurrentCulture);
Description = CmisSync.Properties_Resources.ResourceManager.GetString("Intro", CultureInfo.CurrentCulture);
Add(new Label("")); // Page must have at least one element in order to show Header and Descripton
Button cancel_button = new Button (cancelText);
cancel_button.Clicked += delegate {
Controller.SetupPageCancelled ();
};
Button continue_button = new Button (continueText)
{
Sensitive = false
};
continue_button.Clicked += delegate (object o, EventArgs args) {
Controller.SetupPageCompleted ();
};
AddButton (cancel_button);
AddButton (continue_button);
Controller.UpdateSetupContinueButtonEvent += delegate (bool button_enabled) {
Application.Invoke (delegate {
continue_button.Sensitive = button_enabled;
});
};
Controller.CheckSetupPage ();
}
开发者ID:jmanuelnavarro,项目名称:CmisSync,代码行数:32,代码来源:Setup.cs
示例18: PasswordWindow
public PasswordWindow()
: base(WindowType.Toplevel)
{
Password = null;
Cancelled = true;
box = new HBox(true, 3);
label = new Label("Wachtwoord:");
box.PackStart(label);
TextTagTable textTagTable = new TextTagTable();
passwordField = new TextView(new TextBuffer(new TextTagTable()));
box.PackStart(passwordField);
button = new Button();
button.Label = "Ok";
button.Clicked += delegate {
Password = passwordField.Buffer.Text;
Cancelled = false;
Hide();
};
box.PackStart(button);
Add(box);
ShowAll();
}
开发者ID:reinkrul,项目名称:SailorsTabDotNet,代码行数:27,代码来源:PasswordWindow.cs
示例19: ConfigurationWidget
public override Widget ConfigurationWidget()
{
VBox h = new VBox ();
r = new HScale (0, 100, 1);
r.ModifyBg (StateType.Selected, new Color (0xff, 0, 0));
r.Value = 80;
r.ValueChanged += SettingsChanged;
h.Add (r);
g = new HScale (0, 100, 1);
g.ModifyBg (StateType.Selected, new Color (0, 0xff, 0));
g.Value = 10;
g.ValueChanged += SettingsChanged;
h.Add (g);
b = new HScale (0, 100, 1);
b.ModifyBg (StateType.Selected, new Color (0, 0, 0xff));
b.Value = 10;
b.ValueChanged += SettingsChanged;
h.Add (b);
c = new Curve ();
c.CurveType = CurveType.Spline;
c.SetRange (0, 255, 0, 255);
h.Add (c);
Button btn = new Button (Gtk.Stock.Refresh);
btn.Clicked += delegate {UpdatePreview ();};
h.Add (btn);
return h;
}
开发者ID:iainlane,项目名称:f-spot,代码行数:27,代码来源:BWEditor.cs
示例20: DebugView
public DebugView(Settings set, DebugManager mgr)
{
debugManager = mgr;
layout = new Table(2, 2, false);
runStop = new Button("Interrupt");
command = new Entry();
log = new ConsoleLog(set);
command.Activated += OnCommand;
runStop.Clicked += OnRunStop;
layout.Attach(log.View, 0, 2, 0, 1,
AttachOptions.Fill,
AttachOptions.Expand | AttachOptions.Fill,
4, 4);
layout.Attach(command, 0, 1, 1, 2,
AttachOptions.Fill | AttachOptions.Expand,
AttachOptions.Fill,
4, 4);
layout.Attach(runStop, 1, 2, 1, 2,
AttachOptions.Fill, AttachOptions.Fill, 4, 4);
runStop.SetSizeRequest(80, -1);
command.Sensitive = false;
runStop.Sensitive = false;
mgr.MessageReceived += OnDebugOutput;
mgr.DebuggerBusy += OnBusy;
mgr.DebuggerReady += OnReady;
mgr.DebuggerStarted += OnStarted;
mgr.DebuggerExited += OnExited;
layout.Destroyed += OnDestroy;
}
开发者ID:dlbeer,项目名称:olishell,代码行数:34,代码来源:DebugView.cs
注:本文中的Gtk.Button类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论