In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article focuses on "how to achieve Golang cross-platform GUI desktop application development", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let the editor take you to learn "how to achieve Golang cross-platform GUI desktop application development"!
Can golang develop desktop applications?
The answer is yes, with the development of business, there are many golang versions of GUI framework, such as Fyne,webview, which are commonly used, but combined with the actual needs of our project, after my research and analysis, fyne is particularly suitable for our project.
What is Fyne?
Fyne is an easy-to-use GUI toolkit developed by Golang language, which provides cross-platform graphical interface application development support based on OpenGL. Now follow me to learn how to use fyne to develop a web address Daquan example.
First, let's install Fyne
$go get fyne.io/fyne this is the most basic
Because I can't find the corresponding method of setting white here, I modified the source code and added a method of white theme, where you can pass the corresponding structure and configure the corresponding information on the outside.
Source code path fyne.io\ fyne\ theme\ theme.go
One's own method of writing separately
If your project has Chinese, then your running program may have garbled codes, what to do at this time? It is said on the Internet to configure an environmental variable, how is this possible? Isn't it troublesome to migrate how to do it, so let's directly use the following code to find the system font first. Generally, many fonts on PC are standard and we just choose them.
Chinese garbled code
Set the environment variable FYNE_FONT
Does the set style look better?
Finally, there is a core code that sets the corresponding box.
Set the corresponding view
Finally, we execute the fyne package command and package it as an exe.
At this point, I believe you have a deeper understanding of "how to achieve Golang cross-platform GUI desktop application development". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.