Skip to Main Content
Hands-On GUI Application Development in Go
book

Hands-On GUI Application Development in Go

by Andrew Williams
February 2019
Intermediate to advanced content levelIntermediate to advanced
450 pages
11h 59m
English
Packt Publishing
Content preview from Hands-On GUI Application Development in Go

Layout

Basic layout with GTK+-based applications uses a familiar vertical and horizontal box model. Go-GTK (as a straightforward binding to this API) exposes this same functionality. We lay out the GoMail main window using a vertical box to position the menu and toolbar above the main content. Our main content is then a horizontally split pane created with gtk.NewHPaned() (where H refers to the horizontal layout, not the bar orientation, which is vertical). Before looking at the details, here's the basic layout code for the main window. The toolbar and menu creation code is omitted for brevity but can be found in the example code repository:

package mainimport "github.com/mattn/go-gtk/gtk"const padding = 3func main() {   gtk.Init(nil) window ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Cross-Platform GUI Applications with Fyne

Building Cross-Platform GUI Applications with Fyne

Andrew Williams

Publisher Resources

ISBN: 9781789138412Supplemental Content