本文整理汇总了C#中Gtk.MenuBar.Append方法的典型用法代码示例。如果您正苦于以下问题:C# MenuBar.Append方法的具体用法?C# MenuBar.Append怎么用?C# MenuBar.Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.MenuBar
的用法示例。
在下文中一共展示了MenuBar.Append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppMenu
public AppMenu(DebugManager mgr, AccelGroup agr,
Settings set, Window parent,
DebugPane pane, string argsOverride)
{
settings = set;
debugPane = pane;
debugManager = mgr;
menuBar = new MenuBar();
preferences = new PreferencesDialog(set, parent, argsOverride);
menuBar.Append(CreateFileMenu(agr));
menuBar.Append(CreateEditMenu(agr));
menuBar.Append(CreateViewMenu(agr));
menuBar.Append(CreateDebuggerMenu(agr));
menuBar.Append(CreateHelpMenu(agr));
debugManager.DebuggerBusy += OnDebuggerBusy;
debugManager.DebuggerReady += OnDebuggerReady;
debugManager.DebuggerStarted += OnDebuggerStarted;
debugManager.DebuggerExited += OnDebuggerExited;
menuBar.Destroyed += OnDestroy;
debuggerStop.Sensitive = false;
debuggerInterrupt.Sensitive = false;
foreach (MenuItem m in commandMacros)
m.Sensitive = false;
}
示例2: CreateMenus
Gtk.MenuBar CreateMenus ()
{
AccelGroup group = new AccelGroup ();
MenuBar bar = new MenuBar ();
Menu file_menu = new Menu ();
MenuItem file_menu_item = new MenuItem ("_File");
file_menu_item.Submenu = file_menu;
ImageMenuItem file_exit = new ImageMenuItem (Gtk.Stock.Quit, group);
file_exit.Activated += new EventHandler (exit_cb);
file_menu.Append (file_exit);
bar.Append (file_menu_item);
Menu help_menu = new Menu ();
ImageMenuItem help_menu_item = new ImageMenuItem (Gtk.Stock.Help, group);
help_menu_item.Submenu = help_menu;
ImageMenuItem file_help = new ImageMenuItem (Gnome.Stock.About, group);
file_help.Activated += new EventHandler (about_cb);
help_menu.Append (file_help);
bar.Append (help_menu_item);
bar.ShowAll ();
return bar;
}
示例3: CreateMenu
private MenuBar CreateMenu(MenuItem[] items)
{
var acc = new MenuBar();
foreach (var item in items)
acc.Append(Map(item));
return acc;
}
示例4: Main21
public static void Main21 (string[] args)
{
Application.Init();
Window win = new Window ("Menu Sample App");
win.DeleteEvent += new DeleteEventHandler (delete_cb);
win.DefaultWidth = 200;
win.DefaultHeight = 150;
VBox box = new VBox (false, 2);
MenuBar mb = new MenuBar ();
Menu file_menu = new Menu ();
MenuItem exit_item = new MenuItem("Exit");
exit_item.Activated += new EventHandler (exit_cb);
file_menu.Append (exit_item);
MenuItem file_item = new MenuItem("File");
file_item.Submenu = file_menu;
mb.Append (file_item);
box.PackStart(mb, false, false, 0);
Button btn = new Button ("Yep, that's a menu");
box.PackStart(btn, true, true, 0);
win.Add (box);
win.ShowAll ();
Application.Run ();
}
示例5: MenuBarController
public MenuBarController()
{
MenuBar mb = new MenuBar();
Menu filemenu = new Menu();
MenuItem file = new MenuItem("File");
file.Submenu = filemenu;
ImageMenuItem importDirectoryMenuItem = new ImageMenuItem("Import Directory");
importDirectoryMenuItem.Activated += ImportDirectoryMenuItemOnActivated;
filemenu.Append(importDirectoryMenuItem);
ImageMenuItem open = new ImageMenuItem(Stock.Open);
filemenu.Append(open);
SeparatorMenuItem sep = new SeparatorMenuItem();
filemenu.Append(sep);
ImageMenuItem exit = new ImageMenuItem(Stock.Quit);
exit.Activated += (sender, args) => Application.Quit();
filemenu.Append(exit);
mb.Append(file);
View = mb;
}
示例6: VolatileReader
public VolatileReader()
: base("Volatile Reader")
{
this.Build ();
SetDefaultSize(250,200);
SetPosition(Gtk.WindowPosition.Center);
DeleteEvent += delegate(object o, DeleteEventArgs args) {
Application.Quit();
};
MenuBar bar = new MenuBar();
Menu fileMenu = new Menu();
MenuItem fileMenuItem = new MenuItem("File");
fileMenuItem.Submenu = fileMenu;
MenuItem exit = new MenuItem("Exit");
exit.Activated += delegate(object sender, EventArgs e) {
Application.Quit();
};
MenuItem openFile = new MenuItem("Open file...");
openFile.Activated += OpenFile;
fileMenu.Append(openFile);
fileMenu.Append(exit);
bar.Append(fileMenuItem);
_vbox = new VBox(false, 2);
_vbox.PackStart(bar, false, false, 0);
this.Add(_vbox);
this.ShowAll();
}
示例7: CreateMenu
private Gtk.MenuBar CreateMenu ()
{
MenuBar menu = new MenuBar ();
// File
Menu fileSub = new Menu ();
MenuItem file = new MenuItem ("File");
file.Submenu = fileSub;
MenuItem login = new MenuItem ("Login");
MenuItem exit = new MenuItem ("Exit");
fileSub.Append (login);
fileSub.Append (exit);
// Options
Menu optionSub = new Menu ();
MenuItem option = new MenuItem ("Options");
option.Submenu = optionSub;
MenuItem preferences = new MenuItem ("Preferences");
optionSub.Append (preferences);
// Help
Menu helpSub = new Menu ();
MenuItem help = new MenuItem ("Help");
help.Submenu = helpSub;
MenuItem about = new MenuItem ("About");
helpSub.Append (about);
// Menubar
menu.Append (file);
menu.Append (option);
menu.Append (help);
return menu;
}
示例8: MainWindow_Table
public MainWindow_Table()
: base("Table")
{
SetDefaultSize(250, 230);
SetPosition(WindowPosition.Center);
DeleteEvent += delegate { Application.Quit(); };
VBox vbox = new VBox(false, 2);
MenuBar mb = new MenuBar();
Menu filemenu = new Menu();
MenuItem file = new MenuItem("File");
file.Submenu = filemenu;
mb.Append(file);
vbox.PackStart(mb, false, false, 0);
Table table = new Table(5, 4, true);
table.Attach(new Button("Cls"), 0, 1, 0, 1);
table.Attach(new Button("Bck"), 1, 2, 0, 1);
table.Attach(new Label(), 2, 3, 0, 1);
table.Attach(new Button("Close"), 3, 4, 0, 1);
table.Attach(new Button("7"), 0, 1, 1, 2);
table.Attach(new Button("8"), 1, 2, 1, 2);
table.Attach(new Button("9"), 2, 3, 1, 2);
table.Attach(new Button("/"), 3, 4, 1, 2);
table.Attach(new Button("4"), 0, 1, 2, 3);
table.Attach(new Button("5"), 1, 2, 2, 3);
table.Attach(new Button("6"), 2, 3, 2, 3);
table.Attach(new Button("*"), 3, 4, 2, 3);
table.Attach(new Button("1"), 0, 1, 3, 4);
table.Attach(new Button("2"), 1, 2, 3, 4);
table.Attach(new Button("3"), 2, 3, 3, 4);
table.Attach(new Button("-"), 3, 4, 3, 4);
table.Attach(new Button("0"), 0, 1, 4, 5);
table.Attach(new Button("."), 1, 2, 4, 5);
table.Attach(new Button("="), 2, 3, 4, 5);
table.Attach(new Button("+"), 3, 4, 4, 5);
vbox.PackStart(new Entry(), false, false, 0);
vbox.PackEnd(table, true, true, 0);
Add(vbox);
ShowAll();
}
示例9: DemoMenus
public DemoMenus () : base ("Menus")
{
AccelGroup accel_group = new AccelGroup ();
AddAccelGroup (accel_group);
VBox box1 = new VBox (false, 0);
Add (box1);
MenuBar menubar = new MenuBar ();
box1.PackStart (menubar, false, true, 0);
MenuItem menuitem = new MenuItem ("test\nline2");
menuitem.Submenu = CreateMenu (2, true);
menubar.Append (menuitem);
MenuItem menuitem1 = new MenuItem ("foo");
menuitem1.Submenu = CreateMenu (3, true);
menubar.Append (menuitem1);
menuitem = new MenuItem ("bar");
menuitem.Submenu = CreateMenu (4, true);
menuitem.RightJustified = true;
menubar.Append (menuitem);
VBox box2 = new VBox (false, 10);
box2.BorderWidth = 10;
box1.PackStart (box2, false, true, 0);
Button close = new Button ("close");
close.Clicked += new EventHandler (CloseClicked);
box2.PackStart (close, true, true, 0);
close.CanDefault = true;
close.GrabDefault ();
ShowAll ();
}
示例10: Init
private void Init ()
{
Menu helpMenu = new Menu ();
MenuItem aboutItem = new MenuItem ("About");
aboutItem.Activated += HandleAboutActivated;
helpMenu.Append (aboutItem);
MenuItem helpItem = new MenuItem ("Help");
helpItem.Submenu = helpMenu;
MenuBar menuBar = new MenuBar ();
menuBar.Append (helpItem);
var vbox = new Gtk.VBox ();
vbox.PackStart (menuBar, false, false, 0);
this.Add (vbox);
}
示例11: CreateNormalMenu
private MenuBar CreateNormalMenu()
{
MenuBar menubar = new MenuBar ();
AccelGroup agrp = new AccelGroup();
this.AddAccelGroup(agrp);
Menu iFolderMenu = new Menu();
NewMenuItem = new ImageMenuItem (Util.GS("_Upload a Folder..."));
NewMenuItem.Image = new Image(
new Gdk.Pixbuf(Util.ImagesPath("ifolder-upload16.png")));
iFolderMenu.Append(NewMenuItem);
NewMenuItem.AddAccelerator("activate", agrp,
new AccelKey(Gdk.Key.N, Gdk.ModifierType.ControlMask,
AccelFlags.Visible));
NewMenuItem.Activated += new EventHandler(AddiFolderHandler);
DownloadMenuItem =
new ImageMenuItem (Util.GS("_Download..."));
DownloadMenuItem.Image = new Image(
new Gdk.Pixbuf(Util.ImagesPath("ifolder-download16.png")));
MergeMenuItem = new ImageMenuItem( Util.GS("Merge to Folder"));
MergeMenuItem.Image = new Image( new Gdk.Pixbuf(Util.ImagesPath("ifolder-download16.png")));
iFolderMenu.Append(DownloadMenuItem);
iFolderMenu.Append(MergeMenuItem);
DownloadMenuItem.Activated += new EventHandler(DownloadAvailableiFolderHandler);
MergeMenuItem.Activated += new EventHandler(MergeAvailableiFolderHandler);
DeleteMenuItem =
new ImageMenuItem (Util.GS("Dele_te From Server"));
DeleteMenuItem.Image = new Image(Stock.Delete, Gtk.IconSize.Menu);
iFolderMenu.Append(DeleteMenuItem);
DeleteMenuItem.Activated += new EventHandler(DeleteFromServerHandler);
RemoveMenuItem =
new ImageMenuItem (Util.GS("Re_move my membership"));
RemoveMenuItem.Image = new Image(Stock.Delete, Gtk.IconSize.Menu);
iFolderMenu.Append(RemoveMenuItem);
RemoveMenuItem.Activated += new EventHandler(RemoveMembershipHandler);
iFolderMenu.Append(new SeparatorMenuItem());
OpenMenuItem = new ImageMenuItem ( Stock.Open, agrp );
iFolderMenu.Append(OpenMenuItem);
OpenMenuItem.Activated += new EventHandler(OnOpenSynchronizedFolder);
ShareMenuItem = new MenuItem (Util.GS("Share _with..."));
iFolderMenu.Append(ShareMenuItem);
ShareMenuItem.Activated += new EventHandler(OnShareSynchronizedFolder);
ConflictMenuItem = new MenuItem (Util.GS("Resolve conflic_ts"));
iFolderMenu.Append(ConflictMenuItem);
ConflictMenuItem.Activated +=
new EventHandler(OnResolveConflicts);
SyncNowMenuItem = new MenuItem(Util.GS("S_ynchronize now"));
iFolderMenu.Append(SyncNowMenuItem);
SyncNowMenuItem.Activated += new EventHandler(OnSynchronizeNow);
RevertMenuItem =
new ImageMenuItem (Util.GS("_Revert to a Normal Folder"));
RevertMenuItem.Image = new Image(Stock.Undo, Gtk.IconSize.Menu);
iFolderMenu.Append(RevertMenuItem);
RevertMenuItem.Activated += new EventHandler(RemoveiFolderHandler);
PropMenuItem = new ImageMenuItem (Stock.Properties, agrp);
iFolderMenu.Append(PropMenuItem);
PropMenuItem.Activated += new EventHandler(OnShowFolderProperties);
iFolderMenu.Append(new SeparatorMenuItem());
MigrateMenuItem = new MenuItem(Util.GS("_Migrate iFolder"));
Menu MigrateMenu = new Menu();
MigrateMenuSubItem = new MenuItem(Util.GS("Migrate from 2.x"));
MigrateMenu.Append(MigrateMenuSubItem);
MigrateMenuItem.Submenu = MigrateMenu;
iFolderMenu.Append( MigrateMenuItem);
MigrateMenuSubItem.Activated += new EventHandler(Migrate2xClickedHandler);
iFolderMenu.Append(new SeparatorMenuItem());
CloseMenuItem = new ImageMenuItem (Stock.Close, agrp);
iFolderMenu.Append(CloseMenuItem);
CloseMenuItem.Activated += new EventHandler(CloseEventHandler);
QuitMenuItem = new ImageMenuItem(Stock.Quit, agrp);
iFolderMenu.Append(QuitMenuItem);
QuitMenuItem.Activated += new EventHandler(QuitEventHandler);
MenuItem iFolderMenuItem = new MenuItem(Util.GS("i_Folder"));
iFolderMenuItem.Submenu = iFolderMenu;
menubar.Append (iFolderMenuItem);
Menu EditMenu = new Menu();
AccountsMenuItem =
new MenuItem (Util.GS("_Account Settings..."));
EditMenu.Append(AccountsMenuItem);
AccountsMenuItem.Activated += new EventHandler(AccountsMenuItemHandler);
PreferencesMenuItem = new ImageMenuItem(Util.GS("_Preferences"));
PreferencesMenuItem.Image = new Image(Stock.Preferences, Gtk.IconSize.Menu);
EditMenu.Append(PreferencesMenuItem);
PreferencesMenuItem.Activated += new EventHandler(ShowPreferencesHandler);
MenuItem EditMenuItem = new MenuItem(Util.GS("_Edit"));
EditMenuItem.Submenu = EditMenu;
menubar.Append(EditMenuItem);
Menu ViewMenu = new Menu();
RefreshMenuItem =
new ImageMenuItem(Stock.Refresh, agrp);
ViewMenu.Append(RefreshMenuItem);
RefreshMenuItem.Activated +=
new EventHandler(RefreshiFoldersHandler);
ViewMenu.Append(new SeparatorMenuItem());
SyncLogMenuItem =
new MenuItem (Util.GS("Synchronization _Log"));
ViewMenu.Append(SyncLogMenuItem);
SyncLogMenuItem.Activated += new EventHandler(SyncLogMenuItemHandler);
ViewMenu.Append(new SeparatorMenuItem());
ViewServeriFoldersMenuItem =
new CheckMenuItem(Util.GS("View _available iFolders"));
//.........这里部分代码省略.........
示例12: SparkleLog
public SparkleLog(string path)
: base("")
{
LocalPath = path;
string name = System.IO.Path.GetFileName (LocalPath);
SetDefaultSize (480, 640);
SetPosition (WindowPosition.Center);
BorderWidth = 0;
// TRANSLATORS: {0} is a folder name, and {1} is a server address
Title = String.Format(_("Recent Events in ‘{0}’"), name);
IconName = "folder-sparkleshare";
DeleteEvent += delegate {
Close ();
};
// Adds a hidden menubar that contains to enable keyboard
// shortcuts to close the log
MenuBar = new MenuBar ();
MenuItem file_item = new MenuItem ("File");
Menu file_menu = new Menu ();
MenuItem close_1 = new MenuItem ("Close1");
MenuItem close_2 = new MenuItem ("Close2");
// adds specific Ctrl+W and Esc key accelerators to Log Window
AccelGroup accel_group = new AccelGroup ();
AddAccelGroup (accel_group);
// Close on Esc
close_1.AddAccelerator ("activate", accel_group, new AccelKey (Gdk.Key.W, Gdk.ModifierType.ControlMask,
AccelFlags.Visible));
close_1.Activated += delegate { Close (); };
// Close on Ctrl+W
close_2.AddAccelerator ("activate", accel_group, new AccelKey (Gdk.Key.Escape, Gdk.ModifierType.None,
AccelFlags.Visible));
close_2.Activated += delegate { Close (); };
file_menu.Append (close_1);
file_menu.Append (close_2);
file_item.Submenu = file_menu;
MenuBar.Append (file_item);
// Hacky way to hide the menubar, but the accellerators
// will simply be disabled when using Hide ()
MenuBar.HeightRequest = 1;
MenuBar.ModifyBg (StateType.Normal, Style.Background (StateType.Normal));
LayoutVertical = new VBox (false, 0);
LayoutVertical.PackStart (CreateEventLog (), true, true, 0);
HButtonBox dialog_buttons = new HButtonBox {
Layout = ButtonBoxStyle.Edge,
BorderWidth = 12
};
Button open_folder_button = new Button (_("_Open Folder")) {
UseUnderline = true
};
open_folder_button.Clicked += delegate (object o, EventArgs args) {
Process process = new Process ();
process.StartInfo.FileName = Defines.OPEN_COMMAND;
process.StartInfo.Arguments = LocalPath.Replace (" ", "\\ "); // Escape space-characters
process.Start ();
Close ();
};
Button close_button = new Button (Stock.Close);
close_button.Clicked += delegate {
Close ();
};
dialog_buttons.Add (open_folder_button);
dialog_buttons.Add (close_button);
LayoutVertical.PackStart (new HSeparator (), false, false, 0);
// We have to hide the menubar somewhere...
LayoutVertical.PackStart (MenuBar, false, false, 0);
LayoutVertical.PackStart (dialog_buttons, false, false, 0);
Add (LayoutVertical);
}
示例13: BuildMenu
private void BuildMenu()
{
menuBar = new MenuBar();
filemenu = new Menu();
file = new MenuItem("File");
file.Submenu = filemenu;
exit = new MenuItem("Exit");
exit.Activated += OnExitActivated;
filemenu.Append(exit);
aboutmenu = new Menu ();
about = new MenuItem("About");
about.Submenu = aboutmenu;
aboutApp = new MenuItem ("About Application");
aboutApp.Activated += OnAboutActivated;
aboutmenu.Append (aboutApp);
menuBar.Append(file);
menuBar.Append (about);
}
示例14: setupWindow
//Contains all of the components which are on the window
private void setupWindow()
{
//Vertical box (3 sections) which is the main container
VBox MainVBox = new VBox(false, 6);
/*********************Start of menu bar components*********************/
//Note: Flow of menus are:
//Menubar contains MenuItems (e.g. File, Edit, About, etc...)
//MenuItems contains one Menu (i.e. a Submenu)
//Menu contains multiple MenuItems (e.g. Save, Save As, Load, etc...)
MenuBar MainMenuBar = new MenuBar ();
Menu FileMenu = new Menu ();
MenuItem File = new MenuItem ("File");
File.Submenu = FileMenu;
MenuItem ExitItem = new MenuItem ("Exit");
ExitItem.Activated += quitProgram;
FileMenu.Append (ExitItem);
Menu GestureMenu = new Menu ();
MenuItem Gesture = new MenuItem ("Gestures");
Gesture.Submenu = GestureMenu;
MenuItem LoadGesture = new MenuItem ("Load Gesture");
LoadGesture.Activated += openGesture;
GestureMenu.Append (LoadGesture);
MenuItem SaveGestureItem = new MenuItem ("Save Gesture");
SaveGestureItem.Activated += createGesture;
GestureMenu.Append (SaveGestureItem);
Menu PointsMenu = new Menu ();
MenuItem Points = new MenuItem ("Data Points");
Points.Submenu = PointsMenu;
MenuItem LoadPointsItem = new MenuItem ("Load Points");
LoadPointsItem.Activated += loadDataPoints;
PointsMenu.Append (LoadPointsItem);
MenuItem RecordPointsItem = new MenuItem ("Record Points");
RecordPointsItem.Activated += recordPoints;
PointsMenu.Append (RecordPointsItem);
MenuItem BatchRecognizeItem = new MenuItem ("Batch Recognize");
BatchRecognizeItem.Activated += batchRecognize;
PointsMenu.Append (BatchRecognizeItem);
Menu HelpMenu = new Menu ();
MenuItem Help = new MenuItem ("Help");
Help.Submenu = HelpMenu;
MenuItem AboutMenuItem = new MenuItem("About");
HelpMenu.Append (AboutMenuItem);
MainMenuBar.Append (File);
MainMenuBar.Append (Gesture);
MainMenuBar.Append (Points);
MainMenuBar.Append (Help);
/*********************End of menu bar components*********************/
//Drawing area which is the core component of the application
dArea = new DrawingArea ();
dArea.SetSizeRequest (500, 500);
//Horizontal box (4 sections) which contains all of the buttons along the
//bottom of the window
HBox ButtonHBox = new HBox (false, 6);
/*********************Start of Buttons*********************/
Button BtnCreateGesture = new Button ("Create");
Button BtnRecognizeGesture = new Button ("Recognize");
Button BtnClearScreen = new Button ("Clear");
Button BtnRecordPoints = new Button ("Record points");
Button BtnChangeColour = new Button ("Change colour");
//Button functions
BtnCreateGesture.Clicked += new EventHandler (createGesture);
BtnRecognizeGesture.Clicked += new EventHandler (recognizeGesture);
BtnClearScreen.Clicked += new EventHandler (clearScreen);
BtnRecordPoints.Clicked += new EventHandler (recordPoints);
BtnChangeColour.Clicked += changeColour;
//Adding buttons to the current horizontal box
ButtonHBox.PackStart (BtnCreateGesture, true, false, 0);
ButtonHBox.PackStart (BtnRecognizeGesture, true, false, 0);
ButtonHBox.PackStart (BtnClearScreen, true, false, 0);
ButtonHBox.PackStart (BtnRecordPoints, true, false, 0);
ButtonHBox.PackStart (BtnChangeColour, true, false, 0);
/*********************End of Buttons*********************/
//Status bar which shows the score and recognized gesture
sBar = new Statusbar ();
sBar.Push (1, "Ready");
//Entry box for batch function name to be used on the files
//.........这里部分代码省略.........
示例15: BuildMenuBar
private MenuBar BuildMenuBar()
{
MenuBar mb = new MenuBar ();
Menu file_menu = new Menu ();
MenuItem new_item = new MenuItem("New Window");
MenuItem open_item = new MenuItem("Open");
MenuItem save_item = new MenuItem("Save");
MenuItem save_as_item = new MenuItem("Save As");
MenuItem exit_item = new MenuItem("Exit");
new_item.Activated += new EventHandler (OnNew);
open_item.Activated += new EventHandler (OnOpen);
save_item.Activated += new EventHandler (OnSave);
save_as_item.Activated += new EventHandler (OnSaveAs);
exit_item.Activated += new EventHandler (OnExit);
file_menu.Append (new_item);
file_menu.Append (new MenuItem());
file_menu.Append (open_item);
file_menu.Append (save_item);
file_menu.Append (save_as_item);
file_menu.Append (new MenuItem());
file_menu.Append (exit_item);
Menu view_menu = new Menu();
CheckMenuItem lines_item = new CheckMenuItem("Line numbers");
CheckMenuItem eol_item = new CheckMenuItem("EOL marker");
CheckMenuItem tab_item = new CheckMenuItem("Tab marker");
CheckMenuItem ruler_item = new CheckMenuItem("Vertical ruler");
CheckMenuItem invalid_item = new CheckMenuItem("Invalid lines");
lines_item.Active = textEditor.ShowLineNumbers;
eol_item.Active = textEditor.ShowEOLMarkers;
tab_item.Active = textEditor.ShowTabs;
ruler_item.Active = textEditor.ShowVRuler;
invalid_item.Active = textEditor.ShowInvalidLines;
lines_item.Toggled += new EventHandler (OnLineNumbersToggled);
eol_item.Toggled += new EventHandler (OnEOLToggled);
tab_item.Toggled += new EventHandler (OnTabToggled);
ruler_item.Toggled += new EventHandler (OnRulerToggled);
invalid_item.Toggled += new EventHandler (OnInvalidToggled);
view_menu.Append(lines_item);
view_menu.Append(invalid_item);
view_menu.Append(tab_item);
view_menu.Append(eol_item);
view_menu.Append(ruler_item);
Menu tools_menu = new Menu();
MenuItem font_item = new MenuItem("Font");
font_item.Activated += new EventHandler(OnFont);
tools_menu.Append(font_item);
MenuItem file_item = new MenuItem("File");
file_item.Submenu = file_menu;
MenuItem view_item = new MenuItem("View");
view_item.Submenu = view_menu;
MenuItem tools_item = new MenuItem("Tools");
tools_item.Submenu = tools_menu;
mb.Append (file_item);
mb.Append (view_item);
mb.Append (tools_item);
return mb;
}