From c5f34850ad648fda2a2fec30b40685c3651ea395 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Wed, 14 Aug 2013 15:54:17 +0200 Subject: Added undo to menu bar. --- main.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/main.go b/main.go index 13f9ccf..ebe99a5 100644 --- a/main.go +++ b/main.go @@ -87,6 +87,16 @@ func (g *GUI) mkMenuBar() *gtk.MenuBar { fileMenuItem.SetSubmenu(fileMenu) menubar.Append(fileMenuItem) + editMenu := gtk.NewMenu() + + undo := gtk.NewMenuItemWithLabel("Undo") + undo.Connect("activate", g.undo) + editMenu.Append(undo) + + editMenuItem := gtk.NewMenuItemWithLabel("Edit") + editMenuItem.SetSubmenu(editMenu) + menubar.Append(editMenuItem) + helpMenu := gtk.NewMenu() about := gtk.NewMenuItemWithLabel("About") @@ -217,6 +227,10 @@ func (g *GUI) showbiomesToggled() { fmt.Printf("Show biomes: %v\n", g.showbiomes.GetActive()) } +func (g *GUI) undo() { + fmt.Println("Undo") +} + func (g *GUI) Show() { g.window.ShowAll() } -- cgit v1.2.3-70-g09d2