diff options
author | Kevin Chabowski <kevin@kch42.de> | 2013-11-04 21:00:07 +0100 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2013-11-04 21:00:07 +0100 |
commit | 96b981754d3ae968792722c4a29978b1ba5499b1 (patch) | |
tree | 8b1943fd73de03b8aac668e64ee0c2d4f758db9c | |
parent | 3acbc6d81592560dc95b1ce9ee548627042acfc5 (diff) | |
download | biomed-96b981754d3ae968792722c4a29978b1ba5499b1.tar.gz biomed-96b981754d3ae968792722c4a29978b1ba5499b1.tar.bz2 biomed-96b981754d3ae968792722c4a29978b1ba5499b1.zip |
Replaced some menu items with stock items
-rw-r--r-- | main.go | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -13,10 +13,12 @@ type GUI struct { window *gtk.Window statusbar *gtk.Statusbar + accel *gtk.AccelGroup + showbiomes *gtk.CheckButton fixSnowIce *gtk.CheckButton - menuitemSave *gtk.MenuItem + menuitemSave *gtk.ImageMenuItem statusContext uint lastStatus string @@ -94,7 +96,7 @@ func (g *GUI) mkMenuBar() *gtk.MenuBar { fileMenu := gtk.NewMenu() - open := gtk.NewMenuItemWithLabel("Open") + open := gtk.NewImageMenuItemFromStock(gtk.STOCK_OPEN, g.accel) open.Connect("activate", g.openWorldDlg) fileMenu.Append(open) @@ -104,12 +106,12 @@ func (g *GUI) mkMenuBar() *gtk.MenuBar { fileMenu.Append(quickopenItem) } - g.menuitemSave = gtk.NewMenuItemWithLabel("Save") + g.menuitemSave = gtk.NewImageMenuItemFromStock(gtk.STOCK_SAVE, g.accel) g.menuitemSave.Connect("activate", g.save) g.menuitemSave.SetSensitive(false) fileMenu.Append(g.menuitemSave) - quit := gtk.NewMenuItemWithLabel("Quit") + quit := gtk.NewImageMenuItemFromStock(gtk.STOCK_QUIT, g.accel) quit.Connect("activate", g.exitApp) fileMenu.Append(quit) @@ -127,7 +129,7 @@ func (g *GUI) mkMenuBar() *gtk.MenuBar { }) helpMenu.Append(controls) - about := gtk.NewMenuItemWithLabel("About") + about := gtk.NewImageMenuItemFromStock(gtk.STOCK_ABOUT, g.accel) about.Connect("activate", g.aboutDlg) helpMenu.Append(about) @@ -259,6 +261,9 @@ func (g *GUI) Init() { g.window = gtk.NewWindow(gtk.WINDOW_TOPLEVEL) g.window.SetTitle("biomed") + g.accel = gtk.NewAccelGroup() + g.window.AddAccelGroup(g.accel) + menubar := g.mkMenuBar() vbox := gtk.NewVBox(false, 0) vbox.PackStart(menubar, false, false, 0) |