February 2019
Intermediate to advanced
450 pages
11h 59m
English
To complete the work on the compose view, we need to update the buttons callback. For the cancel button, all that's necessary is to call Close() on the window object. In the click handler for the send button, we will construct a new email and send it using the server object's Send() function. The client.NewMessage() function handles creation of the email object. All we need to do is use the Entry.Text field for each input in order to access the current state:
send := widget.NewButton("Send", func() { email := client.NewMessage(subject.Text, content.Text, client.Email(to.Text), "", time.Now()) server.Send(email) compose.Close()})send.Style = widget.PrimaryButtonbuttons := widget.NewHBox( layout.NewSpacer(), widget.NewButton( ...
Read now
Unlock full access