mirror of
https://github.com/wavetermdev/wails.git
synced 2026-04-22 15:26:15 -07:00
Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f0930b73b5 | |||
| 839e42edde | |||
| f2c4ada1e2 | |||
| 126f17a266 | |||
| e4fd7df68b | |||
| c5381dce70 | |||
| 964abcc6bd | |||
| 5d22da4126 | |||
| e714dd92a8 | |||
| 3bf4ea5113 | |||
| 65cef2f206 | |||
| bff2258aea | |||
| 8145b0e0c5 | |||
| 57e6834bd2 | |||
| 9c3f91bb48 | |||
| d899621351 | |||
| 1957e2e86c | |||
| 1c8e2ee8fe | |||
| 741558532b | |||
| 772f870eb3 | |||
| e29b375de5 | |||
| 72e12ef398 | |||
| 9903ba70d5 | |||
| 9b35616a20 | |||
| a988691931 | |||
| ad7f7f76bc | |||
| 55a7d317bd | |||
| cec6551c5e | |||
| 3a230b563f | |||
| f9aa4d3b60 | |||
| b498cddcad | |||
| 3e5df3c7f1 | |||
| 9ccb17bfd0 | |||
| 12d6336421 | |||
| cf2d16c1fd | |||
| bf389e3914 | |||
| f7c19469a7 | |||
| f1265c527e | |||
| b083d1d41c | |||
| 56fb047d89 | |||
| ae4cb4e861 | |||
| 33172946ca | |||
| 3c7a2187db | |||
| 437ca0ffd5 | |||
| 162720423f |
@@ -1,140 +0,0 @@
|
||||
name: Build + Test v3 alpha
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [v3-alpha]
|
||||
paths-ignore:
|
||||
- 'mkdocs-website/**/*'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test_go:
|
||||
name: Run Go Tests
|
||||
if: github.repository == 'wailsapp/wails'
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest, macos-latest, ubuntu-latest]
|
||||
go-version: [1.22]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install linux dependencies
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev javascriptcoregtk-4.1-dev build-essential pkg-config
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
|
||||
- name: Install Task
|
||||
uses: arduino/setup-task@v1
|
||||
with:
|
||||
version: 3.x
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build Examples
|
||||
working-directory: ./v3
|
||||
run: task test:examples
|
||||
|
||||
- name: Run tests (mac)
|
||||
if: matrix.os == 'macos-latest'
|
||||
env:
|
||||
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
|
||||
working-directory: ./v3
|
||||
run: go test -v ./...
|
||||
|
||||
- name: Run tests (!mac)
|
||||
if: matrix.os != 'macos-latest'
|
||||
working-directory: ./v3
|
||||
run: go test -v ./...
|
||||
|
||||
test_js:
|
||||
name: Run JS Tests
|
||||
if: github.repository == 'wailsapp/wails'
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20.x]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
working-directory: v2/internal/frontend/runtime
|
||||
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
working-directory: v2/internal/frontend/runtime
|
||||
|
||||
test_templates:
|
||||
name: Test Templates
|
||||
needs: test_go
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
template:
|
||||
[
|
||||
svelte,
|
||||
svelte-ts,
|
||||
vue,
|
||||
vue-ts,
|
||||
react,
|
||||
react-ts,
|
||||
preact,
|
||||
preact-ts,
|
||||
lit,
|
||||
lit-ts,
|
||||
vanilla,
|
||||
vanilla-ts,
|
||||
]
|
||||
go-version: [1.22]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
|
||||
- name: Setup Golang caches
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cache/go-build
|
||||
~/go/pkg/mod
|
||||
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-golang-
|
||||
|
||||
- name: Install linux dependencies
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev javascriptcoregtk-4.1-dev build-essential pkg-config
|
||||
|
||||
- name: Build Wails3 CLI
|
||||
run: |
|
||||
cd ./v3/cmd/wails3
|
||||
go install
|
||||
wails3 -help
|
||||
|
||||
- name: Generate template '${{ matrix.template }}'
|
||||
run: |
|
||||
go install github.com/go-task/task/v3/cmd/task@latest
|
||||
mkdir -p ./test-${{ matrix.template }}
|
||||
cd ./test-${{ matrix.template }}
|
||||
wails3 init -n ${{ matrix.template }} -t ${{ matrix.template }}
|
||||
cd ${{ matrix.template }}
|
||||
wails3 build
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-11]
|
||||
go-version: ['1.22']
|
||||
go-version: ['1.20']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -47,7 +47,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20.x]
|
||||
node-version: [16.x]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -90,7 +90,7 @@ jobs:
|
||||
vanilla-ts,
|
||||
plain,
|
||||
]
|
||||
go-version: ['1.22']
|
||||
go-version: ['1.20']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
- name: Set Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 20.x
|
||||
node-version: 16.x
|
||||
|
||||
- name: Update Sponsors
|
||||
run: cd scripts/sponsors && chmod 755 ./generate-sponsor-image.sh && ./generate-sponsor-image.sh
|
||||
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Verify Changed files
|
||||
uses: tj-actions/verify-changed-files@v11.1
|
||||
uses: tj-actions/verify-changed-files@v17
|
||||
id: verify-changed-files
|
||||
with:
|
||||
files: |
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
go-version: ['1.22']
|
||||
go-version: ['1.20']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
- name: Setup Nodejs
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 20.x
|
||||
node-version: 18.x
|
||||
|
||||
- name: Install Task
|
||||
uses: arduino/setup-task@v1
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
|
||||
- name: Verify Changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v41
|
||||
with:
|
||||
files: |
|
||||
website/**/*.mdx
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
- name: Setup Nodejs
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 20.x
|
||||
node-version: 18.x
|
||||
|
||||
- name: Setup Task
|
||||
uses: arduino/setup-task@v1
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
name: v3 docs
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v3-alpha
|
||||
paths:
|
||||
- 'mkdocs-website/**/*'
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.repository.fork == false
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./mkdocs-website
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.x
|
||||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
key: mkdocs-material-${{ env.cache_id }}
|
||||
path: .cache
|
||||
restore-keys: |
|
||||
mkdocs-material-
|
||||
- run: sudo apt-get install pngquant
|
||||
- run: pip install pillow cairosvg mkdocs-table-reader-plugin mkdocs-static-i18n
|
||||
- run: pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
|
||||
- run: mkdocs build --config-file mkdocs.insiders.yml
|
||||
- run: mkdocs gh-deploy --force
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 2.x.x | :white_check_mark: |
|
||||
| 3.0.x-alpha | :x: |
|
||||
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you believe you have found a security vulnerability in our project, we encourage you to let us know right away.
|
||||
We will investigate all legitimate reports and do our best to quickly fix the problem.
|
||||
|
||||
Before reporting though, please review our security policy below.
|
||||
|
||||
### How to Report
|
||||
|
||||
To report a security vulnerability, please use GitHub's [private vulnerability reporting](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability) feature. If possible, please include as much information as possible.
|
||||
This may include steps to reproduce, impact of the vulnerability, and anything else you believe would help us understand the problem.
|
||||
**Please do not include any sensitive or personal information in your report**.
|
||||
|
||||
### What to Expect
|
||||
|
||||
When you report a vulnerability, here's what you can expect:
|
||||
|
||||
- **Acknowledgement**: We will acknowledge your email within 48 hours, and you'll receive a more detailed response to your email within 72 hours indicating the next steps in handling your report.
|
||||
|
||||
- **Updates**: After the initial reply to your report, our team will keep you informed of the progress being made towards a fix and full announcement. These updates will be sent at least once a week.
|
||||
|
||||
- **Confidentiality**: We will maintain strict confidentiality of your report until the security issue is resolved.
|
||||
|
||||
- **Issue Resolution**: If the issue is confirmed, we will release a patch as soon as possible depending on complexity of the fix.
|
||||
|
||||
- **Recognition**: We recognize and appreciate every individual who helps us identify and fix vulnerabilities in our project. While we do not currently have a bounty program, we would be happy to publicly acknowledge your responsible disclosure.
|
||||
|
||||
We strive to make Wails safe for everyone, and we greatly appreciate the assistance of security researchers and users in helping us identify and fix vulnerabilities. Thank you for your contribution to the security of this project.
|
||||
@@ -16,11 +16,6 @@ includes:
|
||||
dir: v3
|
||||
optional: true
|
||||
|
||||
docs:
|
||||
taskfile: mkdocs-website
|
||||
dir: mkdocs-website
|
||||
optional: true
|
||||
|
||||
tasks:
|
||||
contributors:check:
|
||||
cmds:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
v3alpha.wails.io
|
||||
@@ -1,5 +0,0 @@
|
||||
FROM squidfunk/mkdocs-material
|
||||
RUN pip install mkdocs-macros-plugin
|
||||
RUN pip install mkdocs-glightbox
|
||||
RUN pip install mkdocs-table-reader-plugin
|
||||
RUN pip install mkdocs-static-i18n
|
||||
@@ -1,42 +0,0 @@
|
||||
# v3 Docs
|
||||
|
||||
This is the documentation for Wails v3. It is currently a work in progress.
|
||||
|
||||
If you do not wish to build it locally, it is available online at
|
||||
[https://wailsapp.github.io/wails/](https://wailsapp.github.io/wails/).
|
||||
|
||||
## Setup Steps
|
||||
|
||||
1. Install the wails3 CLI if you haven't already:
|
||||
|
||||
```shell
|
||||
git clone https://github.com/wailsapp/wails.git
|
||||
cd wails
|
||||
git checkout v3-alpha
|
||||
cd v3/cmd/wails3
|
||||
go install
|
||||
```
|
||||
2. Install [docker](https://www.docker.com)
|
||||
3. Run the following command to build the docker container:
|
||||
|
||||
```shell
|
||||
wails3 task docs:setup
|
||||
```
|
||||
4. Serve the documentation locally:
|
||||
|
||||
```shell
|
||||
wails3 task docs:serve
|
||||
```
|
||||
|
||||
5. Open your browser to [http://127.0.0.1:8000](http://127.0.0.1:8000)
|
||||
|
||||
6. For a complete build, run:
|
||||
|
||||
```shell
|
||||
wails3 task docs:build
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
If you would like to contribute to the documentation, please feel free to open a
|
||||
PR!
|
||||
@@ -1,95 +0,0 @@
|
||||
# https://taskfile.dev
|
||||
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
|
||||
setup:
|
||||
summary: Setup the project
|
||||
preconditions:
|
||||
- sh: docker version
|
||||
msg: "Looks like docker isn't installed. Visit https://www.docker.com to download and install."
|
||||
cmds:
|
||||
- docker build -t squidfunk/mkdocs-material .
|
||||
|
||||
setup:insiders:
|
||||
summary: Setup the project (insiders)
|
||||
preconditions:
|
||||
- sh: python{{exeExt}} --version
|
||||
msg: "Looks like Python isn't installed. Python is required to build the documentation: https://www.python.org/downloads/"
|
||||
cmds:
|
||||
- python -m pip install -r requirements.insiders.txt --user
|
||||
|
||||
upgrade:insiders:
|
||||
summary: Upgrade the project (insiders)
|
||||
preconditions:
|
||||
- sh: python{{exeExt}} --version
|
||||
msg: "Looks like Python isn't installed. Python is required to build the documentation: https://www.python.org/downloads/"
|
||||
cmds:
|
||||
- python -m pip install -r requirements.insiders.txt --upgrade --user
|
||||
|
||||
build:
|
||||
summary: Builds the documentation
|
||||
preconditions:
|
||||
- sh: docker version
|
||||
msg: "Looks like docker isn't installed. Visit https://www.docker.com to download and install."
|
||||
cmds:
|
||||
- build:windows
|
||||
- build:unix
|
||||
|
||||
build:windows:
|
||||
summary: Builds the documentation (Windows)
|
||||
internal: true
|
||||
platforms:
|
||||
- windows
|
||||
cmds:
|
||||
- docker run --rm -v "%cd%":/docs squidfunk/mkdocs-material build
|
||||
|
||||
build:unix:
|
||||
summary: Builds the documentation (Unix)
|
||||
internal: true
|
||||
platforms:
|
||||
- darwin
|
||||
- linux
|
||||
cmds:
|
||||
- docker run --rm -v "$(pwd)":/docs squidfunk/mkdocs-material build
|
||||
|
||||
serve:
|
||||
summary: Builds the documentation and serves it locally
|
||||
preconditions:
|
||||
- sh: docker version
|
||||
msg: "Looks like docker isn't installed. Visit https://www.docker.com to download and install."
|
||||
cmds:
|
||||
- task: serve:windows
|
||||
- task: serve:unix
|
||||
|
||||
serve:windows:
|
||||
summary: Builds the documentation and serves it locally (Windows)
|
||||
internal: true
|
||||
platforms:
|
||||
- windows
|
||||
cmds:
|
||||
- docker run --rm -it -p 8000:8000 -v "%cd%":/docs squidfunk/mkdocs-material
|
||||
|
||||
serve:unix:
|
||||
summary: Builds the documentation and serves it locally (Unix)
|
||||
internal: true
|
||||
platforms:
|
||||
- darwin
|
||||
- linux
|
||||
cmds:
|
||||
- docker run --rm -it -p 8000:8000 -v "$(pwd)":/docs squidfunk/mkdocs-material
|
||||
|
||||
serve:insiders:
|
||||
summary: Builds the documentation and serves it locally
|
||||
preconditions:
|
||||
- sh: mkdocs --version
|
||||
msg: "Looks like mkdocs isn't installed. Run `wails3 task setup` or `task setup` in the documentation directory to install it."
|
||||
cmds:
|
||||
- mkdocs serve --config-file mkdocs.insiders.yml
|
||||
|
||||
update:api:
|
||||
summary: Updates the API documentation
|
||||
dir: generate
|
||||
cmds:
|
||||
- go run .
|
||||
@@ -1 +0,0 @@
|
||||
v3alpha.wails.io
|
||||
@@ -1,141 +0,0 @@
|
||||
# Cais
|
||||
|
||||
Mae'r API cais yn cynorthwyo i greu cais gan ddefnyddio fframwaith Wails.
|
||||
|
||||
### Newydd
|
||||
|
||||
API: `New(appOptions Options) *App`
|
||||
|
||||
`New(appOptions Options)` yn creu cais newydd gan ddefnyddio'r opsiynau cais a ddarperir. Mae'n cymhwyso gwerthoedd rhagosodedig ar gyfer opsiynau heb eu pennu, yn eu cyfuno â'r rhai a ddarparwyd, yn eu cychwyn a'n dychwelyd enghraifft o'r cais.
|
||||
|
||||
Os bydd gwall yn ystod y cychwyn, caiff y cais ei atal gyda'r neges gwall a ddarperir.
|
||||
|
||||
Dylid nodi, os oes enghraifft gyffredinol o gais yn bodoli eisoes, y bydd yr enghraifft honno'n cael ei dychwelyd yn hytrach na chreu un newydd.
|
||||
|
||||
```go title="main.go" hl_lines="6-9"
|
||||
package main
|
||||
|
||||
import "github.com/wailsapp/wails/v3/pkg/application"
|
||||
|
||||
func main() {
|
||||
app := application.New(application.Options{
|
||||
Name: "Demo Ffenestr Gweddarlunydd",
|
||||
// Opsiynau eraill
|
||||
})
|
||||
|
||||
// Gweddill y cais
|
||||
}
|
||||
```
|
||||
|
||||
### Cael
|
||||
|
||||
`Get()` yn dychwelyd yr enghraifft gyffredinol o'r cais. Mae'n ddefnyddiol pan fydd angen mynediad i'r cais o wahanol rannau o'ch cod.
|
||||
|
||||
```go
|
||||
// Cael enghraifft o'r cais
|
||||
app := application.Get()
|
||||
```
|
||||
|
||||
### Galluoedd
|
||||
|
||||
API: `Capabilities() capabilities.Capabilities`
|
||||
|
||||
`Capabilities()` yn adfer map o'r galluoedd sydd gan y cais ar hyn o bryd. Gall y galluoedd fod ynghylch y nodweddion gwahanol y system weithredu sy'n darparu, fel nodweddion gweddarlunydd.
|
||||
|
||||
```go
|
||||
// Cael galluoedd y cais
|
||||
capabilities := app.Capabilities()
|
||||
if capabilities.HasNativeDrag {
|
||||
// Gwneud rhywbeth
|
||||
}
|
||||
```
|
||||
|
||||
### GetPID
|
||||
|
||||
API: `GetPID() int`
|
||||
|
||||
`GetPID()` yn dychwelyd ID y Broses y cais.
|
||||
|
||||
```go
|
||||
pid := app.GetPID()
|
||||
```
|
||||
|
||||
### Rhedeg
|
||||
|
||||
API: `Run() error`
|
||||
|
||||
`Run()` yn dechrau gweithredu'r cais a'i gydrannau.
|
||||
|
||||
```go
|
||||
app := application.New(application.Options{
|
||||
//options
|
||||
})
|
||||
// Rhedeg y cais
|
||||
err := application.Run()
|
||||
if err != nil {
|
||||
// Ymdrin â'r gwall
|
||||
}
|
||||
```
|
||||
|
||||
### Gadael
|
||||
|
||||
API: `Quit()`
|
||||
|
||||
`Quit()` yn gadael y cais trwy ddinistrio ffenestri a rhai cydrannau eraill o bosibl.
|
||||
|
||||
```go
|
||||
// Gadael y cais
|
||||
app.Quit()
|
||||
```
|
||||
|
||||
### AydunDdyryslyd
|
||||
|
||||
API: `IsDarkMode() bool`
|
||||
|
||||
`IsDarkMode()` yn gwirio a yw'r cais yn rhedeg mewn modd tywyll. Mae'n dychwelyd gwerth boolean yn nodi a yw'r modd tywyll wedi'i alluogi.
|
||||
|
||||
```go
|
||||
// Gwiriwch a yw'r modd tywyll wedi'i alluogi
|
||||
if app.IsDarkMode() {
|
||||
// Gwneud rhywbeth
|
||||
}
|
||||
```
|
||||
|
||||
### Cuddio
|
||||
|
||||
API: `Hide()`
|
||||
|
||||
`Hide()` yn cuddio ffenestr y cais.
|
||||
|
||||
```go
|
||||
// Cuddio ffenestr y cais
|
||||
app.Hide()
|
||||
```
|
||||
|
||||
### Dangos
|
||||
|
||||
API: `Show()`
|
||||
|
||||
`Show()` yn dangos ffenestr y cais.
|
||||
|
||||
```go
|
||||
// Dangos ffenestr y cais
|
||||
app.Show()
|
||||
```
|
||||
|
||||
--8<--
|
||||
./docs/cy/API/application_window.md
|
||||
./docs/cy/API/application_menu.md
|
||||
./docs/cy/API/application_dialogs.md
|
||||
./docs/cy/API/application_events.md
|
||||
./docs/cy/API/application_screens.md
|
||||
--8<--
|
||||
|
||||
|
||||
## Opsiynau
|
||||
|
||||
```go title="pkg/application/application_options.go"
|
||||
--8<--
|
||||
../v3/pkg/application/application_options.go
|
||||
--8<--
|
||||
```
|
||||
@@ -1,67 +0,0 @@
|
||||
### Dangos Deialog Ynghylch
|
||||
|
||||
API: `ShowAboutDialog()`
|
||||
|
||||
Mae `ShowAboutDialog()` yn dangos blwch deialog "Ynghylch". Gall ddangos enw'r
|
||||
cymhwysiad, disgrifiad ac eicon.
|
||||
|
||||
```go
|
||||
// Dangos y deialog ynghylch
|
||||
app.ShowAboutDialog()
|
||||
```
|
||||
|
||||
### Gwybodaeth
|
||||
|
||||
API: `InfoDialog()`
|
||||
|
||||
Mae `InfoDialog()` yn creu ac yn dychwelyd esiampl newydd o `MessageDialog` gyda
|
||||
`InfoDialogType`. Defnyddir y deialog hon fel arfer i ddangos negeseuon
|
||||
gwybodaeth i'r defnyddiwr.
|
||||
|
||||
### Cwestiwn
|
||||
|
||||
API: `QuestionDialog()`
|
||||
|
||||
Mae `QuestionDialog()` yn creu ac yn dychwelyd esiampl newydd o `MessageDialog`
|
||||
gyda `QuestionDialogType`. Defnyddir y deialog hon yn aml i ofyn cwestiwn i'r
|
||||
defnyddiwr a disgwyl ymateb.
|
||||
|
||||
### Rhybudd
|
||||
|
||||
API: `WarningDialog()`
|
||||
|
||||
Mae `WarningDialog()` yn creu ac yn dychwelyd esiampl newydd o `MessageDialog`
|
||||
gyda `WarningDialogType`. Fel y mae'r enw yn awgrymu, defnyddir y deialog hon yn
|
||||
bennaf i ddangos negeseuon rhybudd i'r defnyddiwr.
|
||||
|
||||
### Gwall
|
||||
|
||||
API: `ErrorDialog()`
|
||||
|
||||
Mae `ErrorDialog()` yn creu ac yn dychwelyd esiampl newydd o `MessageDialog` gyda
|
||||
`ErrorDialogType`. Cynlluniwyd y deialog hon i'w defnyddio pan fydd angen
|
||||
dangos neges gwall i'r defnyddiwr.
|
||||
|
||||
### Agor Ffeil
|
||||
|
||||
API: `OpenFileDialog()`
|
||||
|
||||
Mae `OpenFileDialog()` yn creu ac yn dychwelyd esiampl newydd o
|
||||
`OpenFileDialogStruct`. Mae'r deialog hon yn annog y defnyddiwr i ddewis un neu
|
||||
ragor o ffeiliau o'u system ffeiliau.
|
||||
|
||||
### Cadw Ffeil
|
||||
|
||||
API: `SaveFileDialog()`
|
||||
|
||||
Mae `SaveFileDialog()` yn creu ac yn dychwelyd esiampl newydd o
|
||||
`SaveFileDialogStruct`. Mae'r deialog hon yn annog y defnyddiwr i ddewis lleoliad
|
||||
yn eu system ffeiliau lle y dylid cadw ffeil.
|
||||
|
||||
### Agor Cyfeiriadur
|
||||
|
||||
API: `OpenDirectoryDialog()`
|
||||
|
||||
Mae `OpenDirectoryDialog()` yn creu ac yn dychwelyd esiampl newydd o
|
||||
`MessageDialog` gyda `OpenDirectoryDialogType`. Mae'r deialog hon yn galluogi'r
|
||||
defnyddiwr i ddewis cyfeiriadur o'u system ffeiliau.
|
||||
@@ -1,13 +0,0 @@
|
||||
### Ar
|
||||
|
||||
API:
|
||||
`Ar(eventType digwyddiadau.DdigwyddiadweithgangeningApplicationEventType, atebydd func(digwyddiad *Digwyddiad)) func()`
|
||||
|
||||
Mae `Ar()` yn cofrestru gwrandäwr digwyddiad ar gyfer digwyddiadau cymhwysiad penodol. Bydd y swyddogaeth atebydd a ddarperir yn cael ei sbarduno pan fydd y digwyddiad cysylltiedig yn digwydd. Mae'r swyddogaeth yn dychwelyd swyddogaeth y gellir ei galw i dynnu'r gwrandäwr.
|
||||
|
||||
### CofrestruArgraffwyr
|
||||
|
||||
API:
|
||||
`CofrestruArgraffwyr(eventType digwyddiadau.DdigwyddiadweithgangeningApplicationEventType, atebydd func(digwyddiad *Digwyddiad)) func()`
|
||||
|
||||
Mae `CofrestruArgraffwyr()` yn cofrestru atebydd i'w redeg fel crocen yn ystod digwyddiadau penodol. Caiff y crocenau hyn eu rhedeg cyn gwrandawyr sy'n gysylltiedig ag `Ar()`. Mae'r swyddogaeth yn dychwelyd swyddogaeth y gellir ei galw i dynnu'r bâs.
|
||||
@@ -1,27 +0,0 @@
|
||||
### RegisterContextMenu
|
||||
|
||||
API: `RegisterContextMenu(name string, menu *Menu)`
|
||||
|
||||
Mae `RegisterContextMenu()` yn cofrestru dewislen cyd-destun gyda enw penodol. Gellir defnyddio'r dewislen hon yn ddiweddarach yn yr ap.
|
||||
|
||||
```go
|
||||
// Creu dewislen newydd
|
||||
ctxmenu := app.NewMenu()
|
||||
|
||||
// Cofrestru'r dewislen fel dewislen cyd-destun
|
||||
app.RegisterContextMenu("MyContextMenu", ctxmenu)
|
||||
```
|
||||
|
||||
### SetMenu
|
||||
|
||||
API: `SetMenu(menu *Menu)`
|
||||
|
||||
Mae `SetMenu()` yn gosod y ddewislen ar gyfer yr ap. Ar Mac, bydd hyn yn fod y ddewislen fyd-eang. Ar gyfer Windows a Linux, bydd hyn yn fod y ddewislen ddiofyn ar gyfer unrhyw ffenestr newydd a grëir.
|
||||
|
||||
```go
|
||||
// Creu dewislen newydd
|
||||
menu := app.NewMenu()
|
||||
|
||||
// Gosod y ddewislen ar gyfer yr ap
|
||||
app.SetMenu(menu)
|
||||
```
|
||||
@@ -1,13 +0,0 @@
|
||||
### GetPrimaryScreen
|
||||
|
||||
API: `GetPrimaryScreen() (*Sgrin, error)`
|
||||
|
||||
Mae `GetPrimaryScreen()` yn dychwelyd y sgrin brif y system.
|
||||
|
||||
### GetScreens
|
||||
|
||||
API: `GetScreens() ([]*Sgrin, error)`
|
||||
|
||||
Mae `GetScreens()` yn dychwelyd gwybodaeth am bob sgrin sydd wedi'i chysylltu â'r system.
|
||||
|
||||
Dyma grynodeb byr o'r dulliau allforio yn y `App` strwythur a ddarparwyd. Cofiwch, ar gyfer mwy o swyddogaethau neu ystyriaethau manwl, cyfeiriwch at y cod Go gwirioneddol neu ddogfennaeth fewnol bellach.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user