<p align="center">
<a href="https://pkg.go.dev/fyne.io/fyne/v2?tab=doc" title="Go API Reference" rel="nofollow"><img src="https://img.shields.io/badge/go-documentation-blue.svg?style=flat" alt="Go API Reference"></a>
<a href="https://img.shields.io/github/v/release/fyne-io/fyne?include_prereleases" title="Latest Release" rel="nofollow"><img src="https://img.shields.io/github/v/release/fyne-io/fyne?include_prereleases" alt="Latest Release"></a>
<a href='https://gophers.slack.com/messages/fyne'><img src='https://img.shields.io/badge/join-us%20on%20slack-gray.svg?longCache=true&logo=slack&colorB=blue' alt='Join us on Slack' /></a>
<br />
<a href="https://goreportcard.com/report/fyne.io/fyne/v2"><img src="https://goreportcard.com/badge/fyne.io/fyne/v2" alt="Code Status" /></a>
<a href="https://github.com/fyne-io/fyne/actions"><img src="https://github.com/fyne-io/fyne/workflows/Platform%20Tests/badge.svg" alt="Build Status" /></a>
<a href='https://coveralls.io/github/fyne-io/fyne?branch=develop'><img src='https://coveralls.io/repos/github/fyne-io/fyne/badge.svg?branch=develop' alt='Coverage Status' /></a>
</p>
# About
[Fyne](https://fyne.io) is an easy-to-use UI toolkit and app API written in Go.
It is designed to build applications that run on desktop and mobile devices with a
single codebase.
Version 2.4 is the current release of the Fyne API, it added rounded corners, emoji,
layout debug support and table headers, along with a large number of
smaller feature additions.
We are now working towards the next big release, codenamed
[Elgin](https://github.com/fyne-io/fyne/milestone/21)
and more news will follow in our news feeds and GitHub project.
# Prerequisites
To develop apps using Fyne you will need Go version 1.17 or later, a C compiler and your system's development tools.
If you're not sure if that's all installed or you don't know how then check out our
[Getting Started](https://fyne.io/develop/) document.
Using the standard go tools you can install Fyne's core library using:
go get fyne.io/fyne/v2@latest
After importing a new module, run the following command before compiling the code for the first time. Avoid running it before writing code that uses the module to prevent accidental removal of dependencies:
go mod tidy
# Widget demo
To run a showcase of the features of Fyne execute the following:
go install fyne.io/fyne/v2/cmd/fyne_demo@latest
fyne_demo
And you should see something like this (after you click a few buttons):
<p align="center" markdown="1" style="max-width: 100%">
<img src="img/widgets-dark.png" width="752" alt="Fyne Demo Dark Theme" style="max-width: 100%" />
</p>
Or if you are using the light theme:
<p align="center" markdown="1" style="max-width: 100%">
<img src="img/widgets-light.png" width="752" alt="Fyne Demo Light Theme" style="max-width: 100%" />
</p>
And even running on a mobile device:
<p align="center" markdown="1" style="max-width: 100%">
<img src="img/widgets-mobile-light.png" width="348" alt="Fyne Demo Mobile Light Theme" style="max-width: 100%" />
</p>
# Getting Started
Fyne is designed to be really easy to code with.
If you have followed the prerequisite steps above then all you need is a
Go IDE (or a text editor).
Open a new file and you're ready to write your first app!
```go
package main
import (
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"
)
func main() {
a := app.New()
w := a.NewWindow("Hello")
hello := widget.NewLabel("Hello Fyne!")
w.SetContent(container.NewVBox(
hello,
widget.NewButton("Hi!", func() {
hello.SetText("Welcome :)")
}),
))
w.ShowAndRun()
}
```
And you can run that simply as:
go run main.go
> [!NOTE]
> The first compilation of Fyne on Windows _can_ take up to 10 minutes, depending on your hardware. Subsequent builds will be fast.
It should look like this:
<div align="center">
<table cellpadding="0" cellspacing="0" style="margin: auto; border-collapse: collapse;">
<tr style="border: none;"><td style="border: none;">
<img src="img/hello-light.png" width="207" alt="Fyne Hello Dark Theme" />
</td><td style="border: none;">
<img src="img/hello-dark.png" width="207" alt="Fyne Hello Dark Theme" />
</td></tr>
</table>
</div>
## Run in mobile simulation
There is a helpful mobile simulation mode that gives a hint of how your app would work on a mobile device:
go run -tags mobile main.go
Another option is to use `fyne` command, see [Packaging for mobile](#packaging-for-mobile).
# Installing
Using `go install` will copy the executable into your go `bin` dir.
To install the application with icons etc into your operating system's standard
application location you can use the fyne utility and the "install" subcommand.
go install fyne.io/fyne/v2/cmd/fyne@latest
fyne install
# Packaging for mobile
To run on a mobile device it is necessary to package up the application.
To do this we can use the fyne utility "package" subcommand.
You will need to add appropriate parameters as prompted, but the basic command is shown below.
Once packaged you can install using the platform development tools or the fyne "install" subcommand.
fyne package -os android -appID my.domain.appname
fyne install -os android
The built Android application can run either in a real device or an Android emulator.
However, building for iOS is slightly different.
If the "-os" argument is "ios", it is build only for a real iOS device.
Specify "-os" to "iossimulator" allows the application be able to run in an iOS simulator:
fyne package -os ios -appID my.domain.appname
fyne package -os iossimulator -appID my.domain.appname
# Preparing a release
Using the fyne utility "release" subcommand you can package up your app for release
to app stores and market places. Make sure you have the standard build tools installed
and have followed the platform documentation for setting up accounts and signing.
Then you can execute something like the following, notice the `-os ios` parameter allows
building an iOS app from macOS computer. Other combinations work as well :)
$ fyne release -os ios -certificate "Apple Distribution" -profile "My App Distribution" -appID "com.example.myapp"
The above command will create a '.ipa' file that can then be uploaded to the iOS App Store.
# Documentation
More documentation is available at the [Fyne developer website](https://developer.fyne.io/) or on [pkg.go.dev](https://pkg.go.dev/fyne.io/fyne/v2?tab=doc).
# Examples
You can find many example applications in the [examples repository](https://github.com/fyne-io/examples/).
Alternatively a list of applications using fyne can be found at [our website](https://apps.fyne.io/).
# Shipping the Fyne Toolkit
All Fyne apps will work without pre-installed libraries, this is one reason the apps are so portable.
However, if looking to support Fyne in a bigger way on your operating system then you can install some utilities that help to make a more complete experience.
## Additional apps
It is recommended that you install the following additional apps:
| app | go install | description |
| ------------- | ----------------------------------- | ---------------------------------------------------------------------- |
| fyne_settings | `fyne.io/fyne/v2/cmd/fyne_settings` | A GUI for managing your global Fyne settings like theme and scaling |
| apps | `github.com/fyne-io/apps` | A graphical installer for the Fyne apps listed at https://apps.fyne.io |
These are optional applications but can help to create a more complete desktop experience.
## FyneDesk (Linux / BSD)
To go all the way with Fyne on your desktop / laptop computer you could install [FyneDesk](https://github.com/fyshos/fynedesk) as well :)
![FyneDesk screenshopt in dark mode](https://fyshos.com/img/desktop.png)
没有合适的资源?快使用搜索试试~ 我知道了~
Fyne 是一个 Go 语言开发的易用的 UI工具包,提供基于 OpenGL 的跨平台图形界面应用开发支持.zip
共1684个文件
go:714个
xml:509个
png:237个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 30 浏览量
2024-05-11
06:54:15
上传
评论
收藏 15.97MB ZIP 举报
温馨提示
opengl OpenGL(Open Graphics Library)是一个跨平台、跨语言的图形编程接口(API)。它被广泛用于实现2D和3D图形渲染,并且是许多应用程序、游戏和网页浏览器的核心组件。 以下是对 OpenGL 的一些主要特性的概述: 1. 低层次的渲染 API:OpenGL 提供了直接与图形硬件进行交互的能力。这使得它非常强大,因为它可以充分利用图形处理器(GPU)的性能。然而,这也意味着使用 OpenGL 需要对计算机图形学有深入的理解。 2. 状态机:OpenGL 是一个状态机,这意味着你可以通过一系列的函数调用来改变它的内部状态,然后这些状态会影响后续的渲染操作。 3. 可扩展性:OpenGL 的一个重要特性是它的可扩展性。硬件制造商可以为他们的硬件特性定义新的 OpenGL 函数和参数。这些扩展可以通过 OpenGL 的扩展机制被查询和使用。 4. 跨平台和跨语言:OpenGL 可以在所有主要的操作系统(如 Windows、macOS 和 Linux)上运行,并且有各种编程语言的绑定,包括 C、C++、Python、Java 和许多其他语言。
资源推荐
资源详情
资源评论
收起资源包目录
Fyne 是一个 Go 语言开发的易用的 UI工具包,提供基于 OpenGL 的跨平台图形界面应用开发支持.zip (1684个子文件)
bootstrap.arsc 632B
AUTHORS 464B
bin 8KB
bin 8KB
bootstrap.bin 2KB
android.c 16KB
android.c 9KB
app_mobile_and.c 5KB
work.c 5KB
x11.c 4KB
staticcheck.conf 32B
dark.css 233B
light.css 233B
app.desktop 346B
round_rectangle_es.frag 2KB
round_rectangle.frag 1KB
rectangle_es.frag 902B
rectangle.frag 735B
line_es.frag 582B
line.frag 415B
simple_es.frag 298B
simple.frag 131B
spinner_dark.gif 267KB
spinner_light.gif 208KB
.gitignore 738B
.gitignore 48B
bundled-emoji.go 11.82MB
bundled-fonts.go 5.97MB
bundled.go 1.18MB
bundled.go 207KB
arsc.go 191KB
bundled-icons.go 94KB
window_test.go 63KB
entry_test.go 62KB
entry.go 52KB
table.go 42KB
icons.go 41KB
bindtrees.go 36KB
bindlists.go 33KB
richtext.go 30KB
scroller_test.go 29KB
binres.go 27KB
table_test.go 26KB
tree_internal_test.go 26KB
android.go 25KB
window.go 25KB
tree.go 25KB
richtext_test.go 23KB
gen.go 22KB
file.go 21KB
file_test.go 21KB
tabs.go 20KB
table.go 20KB
build_iosapp.go 20KB
list.go 20KB
window_desktop.go 19KB
uri.go 19KB
markup_renderer_test.go 19KB
package_test.go 18KB
canvas_test.go 18KB
list_test.go 18KB
gridwrap.go 18KB
release.go 18KB
dex.go 17KB
select_test.go 16KB
canvas_test.go 16KB
markup_renderer.go 16KB
menu_bar_test.go 16KB
scroller.go 15KB
popup_test.go 15KB
split_test.go 15KB
canvas.go 15KB
driver.go 14KB
util_test.go 14KB
textgrid.go 14KB
package.go 14KB
icons_test.go 14KB
richtext_objects.go 14KB
menu_desktop_test.go 14KB
accordion_test.go 14KB
widget.go 14KB
draw.go 13KB
build_androidapp.go 13KB
entry_internal_test.go 13KB
window_goxjs.go 13KB
file_test.go 13KB
button.go 13KB
test.go 13KB
doctabs_desktop_test.go 13KB
uri_test.go 13KB
doctabs_mobile_test.go 13KB
convert.go 13KB
doctabs.go 12KB
work_windows.go 12KB
build.go 12KB
font_internal_test.go 12KB
apptabs_desktop_test.go 12KB
apptabs_mobile_test.go 12KB
darwin_desktop.go 12KB
build.go 12KB
共 1684 条
- 1
- 2
- 3
- 4
- 5
- 6
- 17
资源评论
野生的狒狒
- 粉丝: 3387
- 资源: 2436
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功