本文整理汇总了C#中EventBox.Add方法的典型用法代码示例。如果您正苦于以下问题:C# EventBox.Add方法的具体用法?C# EventBox.Add怎么用?C# EventBox.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventBox
的用法示例。
在下文中一共展示了EventBox.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WebViewer
public WebViewer()
: base(WindowType.Toplevel)
{
xml = new XML (null, "MainWindow.glade", "mainBox", null);
xml.Autoconnect (this);
Gdk.Pixbuf pix = new Gdk.Pixbuf (null, "webnotes-16.png");
//Window settings
Title = "WebNotes";
WindowPosition = WindowPosition.Center;
Icon = pix;
Resize (650,600);
//Trayicon stuff
trayIcon = new TrayIcon ("WebNotes");
EventBox ebox = new EventBox ();
ebox.ButtonPressEvent += ButtonPressed;
Image image = new Image (pix);
ebox.Add (image);
trayIcon.Add (ebox);
trayIcon.ShowAll ();
//Gecko webcontrol
wc = new WebControl ();
wc.LoadUrl ("http://localhost:8000");
geckoBox.Add (wc);
optionMenu.Changed += OptionChanged;
BuildMenu ();
int firstPage = list.IndexOf ("WikiHome");
if (firstPage != -1)
optionMenu.SetHistory ((uint)firstPage);
Add (mainBox);
}
示例2: TIcon
public TIcon(CInterfaceGateway in_krnGateway, Gtk.Window mwindow)
{
krnGateway = in_krnGateway;
mainwindow = mwindow;
menu = new Gtk.Menu ();
EventBox eb = new EventBox ();
eb.ButtonPressEvent += new ButtonPressEventHandler (TIconClicked);
eb.Add (new Gtk.Image (new Gdk.Pixbuf (null, "lPhant.png")));
MenuItem it_show = new MenuItem ("Show");
it_show.Activated += new EventHandler (TIconShow);
MenuItem it_options = new MenuItem ("Options");
it_options.Activated += new EventHandler (TIconOptions);
ImageMenuItem it_quit = new ImageMenuItem("Quit");
it_quit.Activated += new EventHandler (TIconQuit);
menu.Append (it_show);
menu.Append (it_options);
menu.Append (it_quit);
t = new TrayIcon ("eLePhantGTK");
t.Add (eb);
t.ShowAll ();
}
示例3: ImageWindow
public ImageWindow(string src)
: base(src)
{
Decorated = false;
KeepAbove = true;
Resize (640, 240);
Move (100, 100);
//Opacity = 1.0;
pixbuf = new Pixbuf (src);
Gtk.Image image = new Gtk.Image ();
image.Pixbuf = pixbuf;
EventBox box = new EventBox ();
box.Add (image);
box.ButtonPressEvent += new ButtonPressEventHandler (WindowController.OnButtonDragPress);
box.ExposeEvent += HandleMyWinExposeEvent;
Add (box);
WindowController.HandleMyWinScreenChanged(this, null);
WindowController.SetWindowShapeFromPixbuf (this, image.Pixbuf);
DestroyEvent += new DestroyEventHandler (delegate(object o, DestroyEventArgs args) {
if(cr!=null){
((IDisposable)cr).Dispose();
}
});
ShowAll();
}
示例4: 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();
}
示例5: 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 ();
}
示例6: buildWindow
private void buildWindow()
{
this.Resizable = false;
EventBox labelContainer = new EventBox ();
Label badFileLabel = new Label (Constants.Constants.badFilePathPopupText);
//set the style of the label
Style labelStyle = badFileLabel.Style.Copy();
labelStyle.FontDescription.Family = Constants.Constants.welcomeWindowFontFamily;
labelStyle.FontDescription.Size = Constants.Constants.CONFIRM_RELOAD_MESSAGE_SIZE;
badFileLabel.Style = labelStyle.Copy();
labelContainer.Add (badFileLabel);
closeButton = new Button (Constants.Constants.closeButtonText);
closeButton.Clicked += new EventHandler (dismissDialog);
//set the style of close button
Style buttonStyle = closeButton.Style.Copy ();
buttonStyle.FontDescription.Family = Constants.Constants.welcomeWindowFontFamily;
buttonStyle.FontDescription.Size = Constants.Constants.WELCOME_BUTTON_FONT_SIZE;
closeButton.Style = buttonStyle.Copy ();
HBox masterContainer = new HBox ();
VBox mainContainer = new VBox ();
mainContainer.PackStart (labelContainer, false, false, 50);
mainContainer.PackStart (closeButton, false, false, 50);
masterContainer.PackStart (mainContainer, true, true, 100);
this.Add (masterContainer);
}
示例7: TreeViewCellContainer
public TreeViewCellContainer (Gtk.Widget child)
{
box = new EventBox ();
box.ButtonPressEvent += new ButtonPressEventHandler (OnClickBox);
box.Add (child);
child.Show ();
Show ();
}
示例8: CreateColorBox
private Widget CreateColorBox(string name, Gdk.Color color)
{
EventBox eb = new EventBox();
eb.ModifyBg(StateType.Normal, color);
Label l = new Label(name);
eb.Add(l);
l.Show();
return eb;
}
示例9: TreeViewCellContainer
public TreeViewCellContainer (Gtk.Widget child)
{
box = new EventBox ();
box.ButtonPressEvent += new ButtonPressEventHandler (OnClickBox);
box.ModifyBg (StateType.Normal, Style.White);
box.Add (child);
child.Show ();
Show ();
}
示例10: ChatsPage
private ChatsPage()
{
base.FocusGrabbed += base_FocusGrabbed;
closePixbuf = new Gdk.Pixbuf(null, "FileFind.Meshwork.GtkClient.smallclose.png");
tabLabelPages = new Dictionary<Widget, ChatSubpageBase>();
notebook = new Notebook();
notebook.TabPos = PositionType.Bottom;
notebook.SwitchPage += notebook_SwitchPage;
notebook.PageReordered += notebook_PageReordered;
ScrolledWindow swindow = new ScrolledWindow();
swindow.HscrollbarPolicy = PolicyType.Automatic;
swindow.VscrollbarPolicy = PolicyType.Automatic;
chatList = new TreeView ();
swindow.Add(chatList);
chatTreeStore = new NetworkGroupedTreeStore<ChatRoom>(chatList);
chatList.Model = chatTreeStore;
TreeViewColumn column;
column = chatList.AppendColumn("Room Name", new CellRendererText(), new TreeCellDataFunc (NameDataFunc));
column.Expand = true;
column.Sizing = TreeViewColumnSizing.Autosize;
var pixbufCell = new CellRendererPixbuf();
column.PackStart(pixbufCell, false);
column.SetCellDataFunc(pixbufCell, new TreeCellDataFunc(RoomSecureDataFunc));
column = chatList.AppendColumn("Users", new CellRendererText(), new TreeCellDataFunc (RoomUsersDataFunc));
column.Sizing = TreeViewColumnSizing.Autosize;
chatList.RowActivated += chatList_RowActivated;
chatList.ButtonPressEvent += chatList_ButtonPressEvent;
EventBox box = new EventBox();
box.Add(new Label("Chatroom List"));
box.ButtonPressEvent += HandleTabButtonPressEvent;
box.ShowAll();
notebook.AppendPage(swindow, box);
this.PackStart(notebook, true, true, 0);
notebook.ShowAll();
foreach (Network network in Core.Networks) {
Core_NetworkAdded (network);
}
Core.NetworkAdded +=
(NetworkEventHandler)DispatchService.GuiDispatch(
new NetworkEventHandler(Core_NetworkAdded)
);
}
示例11: StatusBar
// create the status bar
public StatusBar(FuseApp fuse, VBox box)
{
this.fuse = fuse;
this.box = box;
EventBox eb = new EventBox ();
eb.Add (image);
eb.ButtonReleaseEvent += notify_clicked;
this.PackStart (eb, false, false, 2);
}
示例12: Tray
public Tray(MainWindow win)
{
_mainwin = win;
// we need a eventbox, because Gtk.Image doesn't receive signals
EventBox eb = new EventBox ();
eb.Add (new Image (Stock.Network, IconSize.Menu)); // using stock icon
eb.ButtonPressEvent += new ButtonPressEventHandler (this.OnImageClick);
TrayIcon icon = new TrayIcon ("MonoGnomeArt");
icon.Add (eb);
// showing the trayicon
icon.ShowAll ();
}
示例13: buildWindow
private void buildWindow()
{
//prevent resize on home screen
this.Resizable = false;
EventBox labelContainer = new EventBox ();
Label confirmLoadLabel = new Label (Constants.Constants.confirmFileReloadText);
//set the style of the label
Style labelStyle = confirmLoadLabel.Style.Copy();
labelStyle.FontDescription.Family = Constants.Constants.welcomeWindowFontFamily;
labelStyle.FontDescription.Size = Constants.Constants.CONFIRM_RELOAD_MESSAGE_SIZE;
confirmLoadLabel.Style = labelStyle.Copy();
labelContainer.Add (confirmLoadLabel);
labelContainer.WidthRequest = 100;
Button yesButton = new Button (Constants.Constants.YES);
yesButton.Clicked += new EventHandler (LoadFile);
Button noButton = new Button (Constants.Constants.NO);
noButton.Clicked += new EventHandler (CancelRequest);
//set the style of buttons
Style buttonStyle = yesButton.Style.Copy ();
buttonStyle.FontDescription.Family = Constants.Constants.welcomeWindowFontFamily;
buttonStyle.FontDescription.Size = Constants.Constants.WELCOME_BUTTON_FONT_SIZE;
yesButton.Style = buttonStyle.Copy();
noButton.Style = buttonStyle.Copy();
labelContainer.SetSizeRequest (100, 100);
yesButton.SetSizeRequest (50, 50);
noButton.SetSizeRequest (50, 50);
HBox masterContainer = new HBox ();
VBox mainContainer = new VBox ();
HBox buttonContainer = new HBox ();
buttonContainer.PackStart (yesButton, false, false, 50);
buttonContainer.PackStart (noButton, false, false, 50);
mainContainer.PackStart (labelContainer, false, false, 50);
mainContainer.PackStart (buttonContainer, false, false, 50);
masterContainer.PackStart (mainContainer, true, true, 100);
this.Add (masterContainer);
}
示例14: RegisterWidget
protected Widget RegisterWidget(Widget widget)
{
if(widget is Button) {
((Button)widget).Relief = ReliefStyle.None;
}
EventBox box = new EventBox();
box.AppPaintable = true;
box.Add(widget);
ConnectChildExpose(box);
if(!(widget is Label)) {
input_children.Add(box);
}
return box;
}
示例15: WidgetDesignerBackend
internal WidgetDesignerBackend (Gtk.Container container, int designWidth, int designHeight)
{
ShadowType = ShadowType.None;
HscrollbarPolicy = PolicyType.Automatic;
VscrollbarPolicy = PolicyType.Automatic;
resizableFixed = new ResizableFixed ();
resizableFixed.ObjectViewer = defaultObjectViewer;
wrapper = ObjectWrapper.Lookup (container);
TopLevelWindow window = container as TopLevelWindow;
if (window != null) {
preview = Stetic.Metacity.Preview.Create (window);
if (preview == null)
preview = Stetic.Windows.Preview.Create (window);
if (preview == null) {
// Use a regular box.
EventBox eventBox = new EventBox ();
eventBox.Add (container);
preview = eventBox;
}
} else {
EventBox eventBox = new EventBox ();
eventBox.Add (container);
preview = eventBox;
}
resizableFixed.Put (preview, container);
if (designWidth != -1) {
preview.WidthRequest = designWidth;
preview.HeightRequest = designHeight;
resizableFixed.AllowResize = true;
} else {
resizableFixed.AllowResize = false;
}
preview.SizeAllocated += new Gtk.SizeAllocatedHandler (OnResized);
AddWithViewport (resizableFixed);
if (wrapper != null)
wrapper.AttachDesigner (resizableFixed);
resizableFixed.SelectionChanged += OnSelectionChanged;
}