Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Building Cross-Platform GUI Applications with Fyne

You're reading from  Building Cross-Platform GUI Applications with Fyne

Product type Book
Published in Jan 2021
Publisher Packt
ISBN-13 9781800563162
Pages 318 pages
Edition 1st Edition
Languages
Author (1):
Andrew Williams Andrew Williams
Profile icon Andrew Williams

Table of Contents (18) Chapters

Preface 1. Section 1: Why Fyne? The Reason for Being and a Vision of the Future
2. Chapter 1: A Brief History of GUI Toolkits and Cross-Platform Development 3. Chapter 2: The Future According to Fyne 4. Section 2: Components of a Fyne App
5. Chapter 3: Window, Canvas, and Drawing 6. Chapter 4: Layout and File Handling 7. Chapter 5: Widget Library and Themes 8. Chapter 6: Data Binding and Storage 9. Chapter 7: Building Custom Widgets and Themes 10. Section 3: Packaging and Distribution
11. Chapter 8: Project Structure and Best Practices 12. Chapter 9: Bundling Resources and Preparing for Release 13. Chapter 10: Distribution – App Stores and Beyond 14. Other Books You May Enjoy Appendix A: Developer Tool Installation 1. Appendix B: Installing Mobile Build Tools 2. Appendix C: Cross-Compiling

Implementing a water consumption tracker

The APIs that we have explored in this chapter can be helpful for most applications. To learn how we can add preference storage to a simple application, we will explore another example project. This time, we will create a tracker that can track water consumption over 1 week.

Constructing the user interface

Before we start working with data binding APIs, we will construct the basic user interface. The aim is to put today's total in large text at the top of a window, with the date below. We will follow this with the controls to add water to the current total. Under this, we will add another section that shows the values for the current week. Let's get started:

  1. We will start, as usual, by defining a makeUI function, which builds the user interface. To start, we will define the large label that will be used to show the total by setting the font to 42 points, center aligning it, and using the theme primary color:
    func makeUI...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}