本文整理汇总了C#中EventBox.Show方法的典型用法代码示例。如果您正苦于以下问题:C# EventBox.Show方法的具体用法?C# EventBox.Show怎么用?C# EventBox.Show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventBox
的用法示例。
在下文中一共展示了EventBox.Show方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
Gtk.Window window;
EventBox eventbox;
Label label;
Application.Init();
window = new Gtk.Window ("Eventbox");
window.DeleteEvent += new DeleteEventHandler (delete_event);
window.BorderWidth = 10;
window.Resize(400,300);
eventbox = new EventBox ();
window.Add (eventbox);
eventbox.Show();
label = new Label ("Click here to quit");
eventbox.Add(label);
label.Show();
label.SetSizeRequest(110, 20);
eventbox.ButtonPressEvent += new ButtonPressEventHandler (exitbutton_event);
eventbox.Realize();
window.Show();
Application.Run();
}
示例2: ExternalWindow
public ExternalWindow()
: base(WindowType.Toplevel)
{
Icon = LongoMatch.Gui.Helpers.Misc.LoadIcon ("longomatch", IconSize.Menu);
box = new EventBox ();
box.Name = "lightbackgroundeventbox";
box.KeyPressEvent += (o, args) => {
Config.EventsBroker.EmitKeyPressed (this, Keyboard.ParseEvent (args.Event));
};
base.Add (box);
box.CanFocus = true;
Focus = box;
box.Show ();
}
示例3: SharpApp
public SharpApp()
: base("EventBox Example")
{
SetDefaultSize(230,150);
SetPosition(WindowPosition.Center);
DeleteEvent += delegate {Application.Quit();};
EventBox ebox = new EventBox();
Add(ebox);
ebox.Show();
Label label = new Label("Do Not Touch");
ebox.Add(label);
label.Show();
label.SetSizeRequest(110,20);
ebox.ButtonPressEvent += delegate{ System.Console.WriteLine("Hello");};
ebox.Realize();
Show();
}
示例4: Init
private void Init()
{
sepBox = null;
preview = false;
rootAdd = new Gtk.EventBox ();
rootAdd.VisibleWindow = false;
rootAdd.CanFocus = true;
rootAdd.DragMotion += HandleDragMotion;
rootAdd.DragDataReceived += HandleDragDataReceived;
rootAdd.DragLeave += HandleDragLeave;
help = new Gtk.Label ("<i>" + Catalog.GetString ("Drag tags here to search for them") + "</i>");
help.UseMarkup = true;
help.Visible = true;
rootBox = new HBox();
rootBox.Add (help);
rootBox.Show ();
rootAdd.Child = rootBox;
rootAdd.Show ();
Gtk.Drag.DestSet (rootAdd, DestDefaults.All, tag_dest_target_table,
DragAction.Copy | DragAction.Move );
PackEnd (rootAdd, true, true, 0);
rootTerm = new OrTerm (null, null);
}
示例5: Init
private void Init()
{
Logger.Debug("Called Init");
this.Icon = Utilities.GetIcon ("giver-48", 48);
// Update the window title
this.Title = string.Format ("Giver Preferences");
//this.DefaultSize = new Gdk.Size (300, 500);
this.VBox.Spacing = 0;
this.VBox.BorderWidth = 0;
this.SetDefaultSize (450, 100);
this.AddButton(Stock.Close, Gtk.ResponseType.Ok);
this.DefaultResponse = ResponseType.Ok;
// Start with an event box to paint the background white
EventBox eb = new EventBox();
eb.Show();
eb.BorderWidth = 0;
eb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
eb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255));
VBox mainVBox = new VBox();
mainVBox.BorderWidth = 10;
mainVBox.Spacing = 5;
mainVBox.Show ();
eb.Add(mainVBox);
this.VBox.PackStart(eb);
Label label = new Label();
label.Show();
label.Justify = Gtk.Justification.Left;
label.SetAlignment (0.0f, 0.5f);
label.LineWrap = false;
label.UseMarkup = true;
label.UseUnderline = false;
label.Markup = "<span weight=\"bold\" size=\"large\">Your Name</span>";
mainVBox.PackStart(label, true, true, 0);
// Name Box at the top of the Widget
HBox nameBox = new HBox();
nameBox.Show();
nameEntry = new Entry();
nameEntry.Show();
nameBox.PackStart(nameEntry, true, true, 0);
nameBox.Spacing = 10;
mainVBox.PackStart(nameBox, false, false, 0);
label = new Label();
label.Show();
label.Justify = Gtk.Justification.Left;
label.SetAlignment (0.0f, 0.5f);
label.LineWrap = false;
label.UseMarkup = true;
label.UseUnderline = false;
label.Markup = "<span weight=\"bold\" size=\"large\">Your Picture</span>";
mainVBox.PackStart(label, true, true, 0);
Gtk.Table table = new Table(4, 3, false);
table.Show();
// None Entry
noneButton = new RadioButton((Gtk.RadioButton)null);
noneButton.Show();
table.Attach(noneButton, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
VBox vbox = new VBox();
vbox.Show();
Gtk.Image image = new Image(Utilities.GetIcon("computer", 48));
image.Show();
vbox.PackStart(image, false, false, 0);
label = new Label("None");
label.Show();
vbox.PackStart(label, false, false, 0);
table.Attach(vbox, 1, 2, 0 ,1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
vbox = new VBox();
vbox.Show();
table.Attach(vbox, 2,3,1,2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);
// Local Entry
localButton = new RadioButton(noneButton);
localButton.Show();
table.Attach(localButton, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
vbox = new VBox();
vbox.Show();
localImage = new Image(Utilities.GetIcon("stock_person", 48));
localImage.Show();
vbox.PackStart(localImage, false, false, 0);
label = new Label("File");
label.Show();
vbox.PackStart(label, false, false, 0);
table.Attach(vbox, 1, 2, 1 ,2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
photoButton = new Button("Change Photo");
photoButton.Show();
table.Attach(photoButton, 2,3,1,2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
// Web Entry
webButton = new RadioButton(noneButton);
webButton.Show();
table.Attach(webButton, 0, 1, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
//.........这里部分代码省略.........
示例6: Build
void Build ()
{
Title = GettextCatalog.GetString ("Exception Caught");
DefaultWidth = 500;
DefaultHeight = 500;
HeightRequest = 350;
WidthRequest = 350;
VBox.Foreach (VBox.Remove);
VBox.PackStart (CreateExceptionHeader (), false, true, 0);
paned = new VPanedThin ();
paned.GrabAreaSize = 10;
paned.Pack1 (CreateStackTraceTreeView (), true, false);
paned.Pack2 (CreateExceptionValueTreeView (), true, false);
paned.Show ();
var vbox = new VBox (false, 0);
var whiteBackground = new EventBox ();
whiteBackground.Show ();
whiteBackground.ModifyBg (StateType.Normal, Ide.Gui.Styles.PrimaryBackgroundColor.ToGdkColor ());
whiteBackground.Add (vbox);
hadInnerException = HasInnerException ();
if (hadInnerException) {
vbox.PackStart (new VBox (), false, false, 6);
vbox.PackStart (CreateInnerExceptionMessage (), false, true, 0);
vbox.ShowAll ();
}
vbox.PackStart (paned, true, true, 0);
vbox.Show ();
if (hadInnerException) {
var box = new HBox ();
box.PackStart (CreateInnerExceptionsTree (), false, false, 0);
box.PackStart (whiteBackground, true, true, 0);
box.Show ();
VBox.PackStart (box, true, true, 0);
DefaultWidth = 900;
DefaultHeight = 700;
WidthRequest = 550;
HeightRequest = 450;
} else {
VBox.PackStart (whiteBackground, true, true, 0);
}
var actionArea = new HBox (false, 0) { BorderWidth = 14 };
OnlyShowMyCodeCheckbox = new CheckButton (GettextCatalog.GetString ("_Only show my code."));
OnlyShowMyCodeCheckbox.Toggled += OnlyShowMyCodeToggled;
OnlyShowMyCodeCheckbox.Show ();
OnlyShowMyCodeCheckbox.Active = DebuggingService.GetUserOptions ().ProjectAssembliesOnly;
var alignment = new Alignment (0.0f, 0.5f, 0.0f, 0.0f) { Child = OnlyShowMyCodeCheckbox };
alignment.Show ();
actionArea.PackStart (alignment, true, true, 0);
actionArea.PackStart (CreateButtonBox (), false, true, 0);
actionArea.PackStart (new VBox (), false, true, 3); // dummy just to take extra 6px at end to make it 20pixels
actionArea.ShowAll ();
VBox.PackStart (actionArea, false, true, 0);
}
示例7: DetachPlayer
void DetachPlayer(bool detach)
{
if (detach == detachedPlayer)
return;
detachedPlayer = detach;
if (detach) {
EventBox box;
Log.Debug("Detaching player");
playerWindow = new Gtk.Window(Constants.SOFTWARE_NAME);
playerWindow.Icon = Stetic.IconLoader.LoadIcon(this, "longomatch", IconSize.Button);
playerWindow.DeleteEvent += (o, args) => DetachPlayer(false);
box = new EventBox();
box.KeyPressEvent += (o, args) => OnKeyPressEvent(args.Event);
playerWindow.Add(box);
box.Show();
playerWindow.Show();
player.Reparent(box);
buttonswidget.Visible = true;
timeline.Visible = true;
if (Config.useGameUnits) {
guTimeline.Visible = true;
gameunitstaggerwidget1.Visible = true;
}
} else {
ToggleAction action;
Log.Debug("Attaching player again");
player.Reparent(this.videowidgetsbox);
playerWindow.Destroy();
if (ManualTaggingViewAction.Active)
action = ManualTaggingViewAction;
else if (TimelineViewAction.Active)
action = TimelineViewAction;
else if (GameUnitsViewAction.Active)
action = GameUnitsViewAction;
else
action = TaggingViewAction;
OnViewToggled(action, new EventArgs());
}
}
示例8: RtmPreferencesWidget
public RtmPreferencesWidget(RtmBackend backend, IPreferences preferences)
: base()
{
if (backend == null)
throw new ArgumentNullException ("backend");
if (preferences == null)
throw new ArgumentNullException ("preferences");
this.backend = backend;
this.preferences = preferences;
LoadPreferences ();
BorderWidth = 0;
// We're using an event box so we can paint the background white
EventBox imageEb = new EventBox ();
imageEb.BorderWidth = 0;
imageEb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
imageEb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255));
imageEb.Show ();
VBox mainVBox = new VBox(false, 0);
mainVBox.BorderWidth = 10;
mainVBox.Show();
Add(mainVBox);
// Add the rtm logo
image = new Gtk.Image (normalPixbuf);
image.Show();
//make the dialog box look pretty without hard coding total size and
//therefore clipping displays with large fonts.
Alignment spacer = new Alignment((float)0.5, 0, 0, 0);
spacer.SetPadding(0, 0, 125, 125);
spacer.Add(image);
spacer.Show();
imageEb.Add (spacer);
mainVBox.PackStart(imageEb, true, true, 0);
// Status message label
statusLabel = new Label();
statusLabel.Justify = Gtk.Justification.Center;
statusLabel.Wrap = true;
statusLabel.LineWrap = true;
statusLabel.Show();
statusLabel.UseMarkup = true;
statusLabel.UseUnderline = false;
authButton = new LinkButton (
#if GETTEXT
Catalog.GetString ("Click Here to Connect"));
#elif ANDROID
#endif
authButton.Clicked += OnAuthButtonClicked;
if ( isAuthorized ) {
statusLabel.Text = "\n\n" +
#if GETTEXT
Catalog.GetString ("You are currently connected");
#elif ANDROID
#endif
string userName = preferences.Get (PreferencesKeys.UserNameKey);
if (userName != null && userName.Trim () != string.Empty)
statusLabel.Text = "\n\n" +
#if GETTEXT
Catalog.GetString ("You are currently connected as") +
#elif ANDROID
#endif
"\n" + userName.Trim();
} else {
statusLabel.Text = "\n\n" +
#if GETTEXT
Catalog.GetString ("You are not connected");
#elif ANDROID
#endif
authButton.Show();
}
mainVBox.PackStart(statusLabel, false, false, 0);
mainVBox.PackStart(authButton, false, false, 0);
Label blankLabel = new Label("\n");
blankLabel.Show();
mainVBox.PackStart(blankLabel, false, false, 0);
}
示例9: CreateStatusbar
private void CreateStatusbar()
{
statusBar = new Toolbar();
statusBar.ShowArrow = false;
statusBar.ToolbarStyle = ToolbarStyle.BothHoriz;
statusBar.ExposeEvent += StatusBarExposeEvent;
statusLabel = new Label();
statusLabel.Xalign = 0;
statusLabel.Xpad = 6;
ToolItem statusLabelItem = new ToolItem();
Alignment statusAlign = new Alignment(0.5f, 0.5f, 1.0f, 1.0f);
statusLabelItem.Add(statusLabel);
statusLabelItem.Expand = true;
statusBar.Insert(statusLabelItem, -1);
statusLabelItem.ShowAll();
taskStatusIcon = new Hyena.Widgets.AnimatedImage();
taskStatusIcon.Pixbuf = Gui.LoadIcon(22, "process-working");
taskStatusIcon.FrameHeight = 22;
taskStatusIcon.FrameWidth = 22;
taskStatusIcon.Load();
EventBox taskStatusIconBox = new EventBox();
taskStatusIconBox.MotionNotifyEvent += delegate {
UpdateTaskStatusIcon();
};
taskStatusIconBox.ButtonReleaseEvent += delegate {
IndexingStatusWindow.Instance.Show();
};
taskStatusIconBox.SizeAllocated += delegate (object o, SizeAllocatedArgs args) {
statusAlign.LeftPadding = (uint)args.Allocation.Width;
};
taskStatusIconBox.SetSizeRequest(22, 22);
taskStatusIconBox.Add(taskStatusIcon);
taskStatusIconBox.Show();
ToolItem taskStatusIconItem = new ToolItem();
taskStatusIconItem.Add(taskStatusIconBox);
statusBar.Insert(taskStatusIconItem, -1);
taskStatusIconItem.Show();
mainVBox.PackStart(statusBar, false, false, 0);
UpdateTaskStatusIcon();
UpdateStatusText();
}
示例10: SetupInfoWidget
private void SetupInfoWidget()
{
infoWidget = new CanvasWidget (group);
infoWidget.Width = widgetWidth;
infoWidget.Height = widgetHeigh;
int startingMinute = Task.StartingMinute;
string minuteText = startingMinute.ToString ();
if (startingMinute <= 9)
minuteText = "0" + minuteText;
label = new Label ();
label.UseMarkup = true;
label.Markup = "<b>" + Task.StartingHour.ToString () + ":" + minuteText + "</b>";
EventBox ebox = new EventBox ();
ebox.Show ();
ebox.Add (label);
tooltips.SetTip (ebox, Task.Description, Task.Description);
infoWidget.Widget = ebox;
label.Show ();
infoWidget.Show ();
infoWidget.RaiseToTop ();
}