0%

Understand how to use the Fyne toolkit to build exciting apps for a range of devices and deploy them effectively

Key Features

  • Learn how to use standard widgets, dialogs, and layouts as well as how to build your own
  • Understand how to develop an app and package and distribute it to different operating systems and app stores
  • Explore the design principles and vision of the Fyne toolkit and how that may align with your project

Book Description

The history of graphical application development is long and complicated, with various development challenges that persist to this day. The mix of technologies involved and the need to use different programming languages led to a very steep learning curve for developers looking to build applications across multiple platforms.

In Building Cross-Platform GUI Applications with Fyne, you'll understand how the Go language, when paired with a modern graphical toolkit such as Fyne, can overcome these issues and make application development much easier. To provide an easy-to-use framework for cross-platform app development, the Fyne project offers many graphical concepts and design principles that are outlined throughout this book.

By working through five example projects, you'll learn how to build apps effectively, focusing on each of the main areas, including the canvas, layouts, file handling, widgets, data binding, and themes. The book will also show you how the completed applications can then be run on your desktop computer, laptop, and smartphone. After completing these projects, you will discover how to prepare applications for release and distribute them to platform marketplaces and app stores.

By the end of this book, you'll be able to create cross-platform graphical applications with visually appealing user interfaces and concise code.

What you will learn

  • Become well-versed with the history of GUI development and how Fyne and the Golang programming language make it easier
  • Explore how the Fyne toolkit is architected and the various modules are provided
  • Discover how Fyne apps can be tested and constructed using best practices
  • Construct five complete applications and deploy them to your devices
  • Customize the design of your apps by extending widgets and themes
  • Understand the separation and presentation of data and how to test and build applications that present dynamic data

Who this book is for

This Fyne-Golang GUI book is for developers from any background who are looking to build cross-platform applications with a modern toolkit. It will also be useful for Go developers who are looking to explore graphical apps and GUI developers looking for a new toolkit for cross-platform development. Basic knowledge of Graphical User Interface (GUI) development is assumed (although a brief history is also included in the book). The book also features a short introduction to the Go language as a quick refresher.

Table of Contents

  1. Building Cross-Platform GUI Applications with Fyne
  2. Contributors
  3. About the author
  4. About the reviewer
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Conventions used
    6. Get in touch
    7. Reviews
  6. Section 1: Why Fyne? The Reason for Being and a Vision of the Future
  7. Chapter 1: A Brief History of GUI Toolkits and Cross-Platform Development
    1. Understanding the history of the graphical user interface
    2. Popularity of the desktop computer
    3. Moving to the web
    4. Smartphones and mobile apps
    5. Exploring the evolution of GUI toolkits
    6. Platform-specific toolkits
    7. Cross-platform toolkits
    8. Hybrid apps
    9. Comparing native graphical apps to web UIs
    10. Development speed versus delivery
    11. Visual style
    12. Technical constraints
    13. Options for cross-platform native toolkits
    14. Visual style
    15. Compiled versus interpreted
    16. Interpreted options
    17. Compiled options (C-based)
    18. Compiled options (other languages)
    19. Summary
  8. Chapter 2: The Future According to Fyne
    1. Technical requirements
    2. Starting with a clean slate
    3. Designing for modern devices
    4. Parallelism and web services
    5. Building for any device
    6. Best practices have moved on
    7. How Go is a great fit for this challenge
    8. Simple cross-platform code
    9. Standard library
    10. Concurrency
    11. Web services
    12. High level with system access
    13. Looking good with Material Design
    14. Color palette
    15. Standard icons
    16. Designing APIs for simplicity and maintainability
    17. Semantic API
    18. Modular
    19. Testable
    20. Extensible
    21. A vision of the future
    22. Beautiful apps
    23. Simple to learn
    24. Platform-agnostic
    25. Distribution to all platforms
    26. Summary
    27. Further reading
  9. Section 2: Components of a Fyne App
  10. Chapter 3: Window, Canvas, and Drawing
    1. Technical requirements
    2. Anatomy of a Fyne application
    3. Application
    4. Window
    5. Canvas
    6. Container
    7. Understanding CanvasObject and the canvas package
    8. Canvas demo
    9. Adding objects to our window
    10. Combining elements
    11. Scalable drawing primitives
    12. Coordinate system
    13. Pixel output – rendering images
    14. Images
    15. Raster
    16. Gradient
    17. Animating a transition
    18. Looping animations
    19. Implementing a simple game
    20. Adding a timer to move the snake
    21. Using keys to control direction
    22. Animating the movement
  11. Chapter 4: Layout and File Handling
    1. Technical requirements
    2. Laying out containers
    3. Manual layout
    4. Using a layout manager
    5. Hidden objects
    6. Standard layouts
    7. MaxLayout
    8. CenterLayout
    9. PaddedLayout
    10. BoxLayout
    11. FormLayout
    12. GridLayout
    13. GridWrapLayout
    14. BorderLayout
    15. Combining layouts
    16. Using the container package
    17. Cross-platform file handling
    18. URI
    19. Reading and writing
    20. User file selection
    21. ListableURI
    22. Implementing an image browser application
    23. Creating the layout
    24. Listing a directory
    25. Loading the images
    26. Loading the app faster
    27. Creating a custom layout for the image elements
    28. Changing a directory
    29. Summary
  12. Chapter 5: Widget Library and Themes
    1. Technical requirements
    2. Exploring the design of the Widget API
    3. Focus on behavior
    4. Rendering a widget
    5. Card
    6. Check
    7. Entry
    8. FileIcon
    9. Form
    10. Hyperlink
    11. Icon
    12. Label
    13. Pop-up menu
    14. ProgressBar
    15. RadioGroup
    16. Select
    17. SelectEntry
    18. Slider
    19. TextGrid
    20. Toolbar
    21. Grouping with the collection widgets
    22. List
    23. Table
    24. Tree
    25. Adding structure with container widgets
    26. AppTabs
    27. Scroll
    28. Split
    29. Using common dialogs
    30. ColorPicker
    31. Confirmation
    32. File selection
    33. Form
    34. Information
    35. Custom dialogs
    36. Understanding themes
    37. Built-in themes
    38. User settings
    39. Included icons
    40. Application override
    41. Implementing a task list application
    42. Designing the GUI
    43. Defining the data
    44. Selecting tasks
    45. Filling in the details
    46. Summary
  13. Chapter 6: Data Binding and Storage
    1. Technical requirements
    2. Binding data to widgets
    3. Understanding data binding
    4. Supported data types
    5. Creating, reading, and writing bound data
    6. Listening for changes
    7. Using data with standard widgets
    8. Adapting data types for display
    9. Formatting types into strings
    10. Parsing values from the string type
    11. Propagating changes through conversions
    12. Binding complex data types
    13. Using lists of data
    14. Using data maps
    15. Mapping structs to a data binding
    16. Storing data using the Preferences API
    17. Get and set values
    18. Supported types
    19. Fallback values
    20. Removing old data
    21. Binding to preferences
    22. Implementing a water consumption tracker
    23. Constructing the user interface
    24. Binding data to the UI
    25. Storing with preferences
    26. Summary
  14. Chapter 7: Building Custom Widgets and Themes
    1. Technical requirements
    2. Extending existing widgets
    3. Overriding widget functions
    4. Adding new behavior
    5. Creating a component from scratch
    6. Implementing the theme interface
    7. Providing customizations to the standard theme
    8. Implementing a chat app user interface
    9. Creating a message widget
    10. Summary
  15. Section 3: Packaging and Distribution
  16. Chapter 8: Project Structure and Best Practices
    1. Technical requirements
    2. Organizing your project
    3. Starting simple
    4. Adding new types
    5. Splitting code into packages
    6. Test driving your development
    7. Designed to be tested
    8. Testing our GUI logic
    9. Verifying that the output is being rendered
    10. Continuous integration for GUIs
    11. Managing platform-specific code
    12. Summary
  17. Chapter 9: Bundling Resources and Preparing for Release
    1. Technical requirements
    2. Bundling assets
    3. Including multiple assets
    4. Automating bundle commands
    5. Checking for UI hints
    6. Choosing metadata, icons, and app IDs
    7. Application icons
    8. Describing your app
    9. Application identifier (appID)
    10. Packaging applications (desktop and mobile)
    11. Packaging for your current computer
    12. Packaging for a mobile device
    13. Installing your application
    14. Installing on your current computer
    15. Installing on a mobile device
    16. Cross-compiling with ease
    17. Using installed toolchains
    18. Using the fyne-cross tool
    19. Summary
  18. Chapter 10: Distribution – App Stores and Beyond
    1. Technical requirements
    2. Building your application for release
    3. Running the release command
    4. Sharing your app on the web
    5. Distributing apps to desktop app stores
    6. Mac App Store
    7. Microsoft Store
    8. Linux and BSD distributions
    9. Uploading apps to Google Play and the iOS App Store
    10. iOS App Store
    11. Google Play Store
    12. Summary
  19. Appendix A: Developer Tool Installation
    1. Installing on Apple macOS
    2. Installing on Microsoft Windows
  20. Appendix B: Installing Mobile Build Tools
    1. Preparing for Android
    2. Preparing for iOS and iPadOS
  21. Appendix C: Cross-Compiling
    1. Manually installing compilers
    2. Cross compiling for macOS
    3. Cross compiling for Windows
    4. Cross compiling for Linux
    5. Using fyne-cross
    6. Installing fyne-cross
    7. Using fyne-cross
    8. Why subscribe?
  22. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Leave a review - let other readers know what you think
3.16.70.101