mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 04:42:00 +08:00
docs: sync documents (#1907)
* fix(website): fix command flag name * feat(website): sync translations
This commit is contained in:
parent
b1e04772d9
commit
5421f559df
@ -5,13 +5,13 @@ Wails includes support for obfuscating your application using [garble](https://g
|
|||||||
To produce an obfuscated build, you can use the `-obfuscate` flag with the `wails build` command:
|
To produce an obfuscated build, you can use the `-obfuscate` flag with the `wails build` command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wails build -obfuscate
|
wails build -obfuscated
|
||||||
```
|
```
|
||||||
|
|
||||||
To customise the obfuscation settings, you can use the `-garbleargs` flag:
|
To customise the obfuscation settings, you can use the `-garbleargs` flag:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wails build -obfuscate -garbleargs "-literals -tiny -seed=myrandomseed"
|
wails build -obfuscated -garbleargs "-literals -tiny -seed=myrandomseed"
|
||||||
```
|
```
|
||||||
|
|
||||||
These settings may be persisted in your [project config](../reference/project-config).
|
These settings may be persisted in your [project config](../reference/project-config).
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"message": "豊富な機能"
|
"message": "豊富な機能"
|
||||||
},
|
},
|
||||||
"homepage.Features.Description1": {
|
"homepage.Features.Description1": {
|
||||||
"message": "Build comprehensive cross-platform applications using native UI elements such as menus and dialogs."
|
"message": "メニューやダイアログといったネイティブUI要素を使用して、クロスプラットフォームアプリを構築しましょう。"
|
||||||
},
|
},
|
||||||
"homepage.Features.Title2": {
|
"homepage.Features.Title2": {
|
||||||
"message": "使い慣れた技術"
|
"message": "使い慣れた技術"
|
||||||
@ -147,7 +147,7 @@
|
|||||||
"description": "The ARIA label and title attribute for expand button of doc sidebar"
|
"description": "The ARIA label and title attribute for expand button of doc sidebar"
|
||||||
},
|
},
|
||||||
"theme.docs.sidebar.expandButtonAriaLabel": {
|
"theme.docs.sidebar.expandButtonAriaLabel": {
|
||||||
"message": "サイドバーを展開",
|
"message": "サイドバーを開く",
|
||||||
"description": "The ARIA label and title attribute for expand button of doc sidebar"
|
"description": "The ARIA label and title attribute for expand button of doc sidebar"
|
||||||
},
|
},
|
||||||
"theme.docs.paginator.navAriaLabel": {
|
"theme.docs.paginator.navAriaLabel": {
|
||||||
@ -167,7 +167,7 @@
|
|||||||
"description": "The title attribute for collapse button of doc sidebar"
|
"description": "The title attribute for collapse button of doc sidebar"
|
||||||
},
|
},
|
||||||
"theme.docs.sidebar.collapseButtonAriaLabel": {
|
"theme.docs.sidebar.collapseButtonAriaLabel": {
|
||||||
"message": "サイドバーを折りたたむ",
|
"message": "サイドバーをたたむ",
|
||||||
"description": "The title attribute for collapse button of doc sidebar"
|
"description": "The title attribute for collapse button of doc sidebar"
|
||||||
},
|
},
|
||||||
"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
|
"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
|
||||||
@ -242,7 +242,7 @@
|
|||||||
"description": "The label used by the button on the collapsible TOC component"
|
"description": "The label used by the button on the collapsible TOC component"
|
||||||
},
|
},
|
||||||
"theme.navbar.mobileLanguageDropdown.label": {
|
"theme.navbar.mobileLanguageDropdown.label": {
|
||||||
"message": "言語一覧",
|
"message": "言語",
|
||||||
"description": "The label for the mobile language switcher dropdown"
|
"description": "The label for the mobile language switcher dropdown"
|
||||||
},
|
},
|
||||||
"theme.SearchBar.seeAll": {
|
"theme.SearchBar.seeAll": {
|
||||||
|
@ -4,35 +4,35 @@
|
|||||||
"description": "The label for version current"
|
"description": "The label for version current"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Getting Started": {
|
"sidebar.docs.category.Getting Started": {
|
||||||
"message": "Getting Started",
|
"message": "はじめよう",
|
||||||
"description": "The label for category Getting Started in sidebar docs"
|
"description": "The label for category Getting Started in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Reference": {
|
"sidebar.docs.category.Reference": {
|
||||||
"message": "Reference",
|
"message": "リファレンス",
|
||||||
"description": "The label for category Reference in sidebar docs"
|
"description": "The label for category Reference in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Runtime": {
|
"sidebar.docs.category.Runtime": {
|
||||||
"message": "Runtime",
|
"message": "ランタイム",
|
||||||
"description": "The label for category Runtime in sidebar docs"
|
"description": "The label for category Runtime in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Community": {
|
"sidebar.docs.category.Community": {
|
||||||
"message": "Community",
|
"message": "コミュニティ",
|
||||||
"description": "The label for category Community in sidebar docs"
|
"description": "The label for category Community in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Showcase": {
|
"sidebar.docs.category.Showcase": {
|
||||||
"message": "Showcase",
|
"message": "事例紹介",
|
||||||
"description": "The label for category Showcase in sidebar docs"
|
"description": "The label for category Showcase in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Guides": {
|
"sidebar.docs.category.Guides": {
|
||||||
"message": "Guides",
|
"message": "ガイド",
|
||||||
"description": "The label for category Guides in sidebar docs"
|
"description": "The label for category Guides in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Tutorials": {
|
"sidebar.docs.category.Tutorials": {
|
||||||
"message": "Tutorials",
|
"message": "チュートリアル",
|
||||||
"description": "The label for category Tutorials in sidebar docs"
|
"description": "The label for category Tutorials in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.link.Contributing": {
|
"sidebar.docs.link.Contributing": {
|
||||||
"message": "Contributing",
|
"message": "コントリビューション",
|
||||||
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
Easy, Secure, and Free file sharing for everyone. Learn more at [Riftshare.app](https://riftshare.app)
|
Easy, Secure, and Free file sharing for everyone. Learn more at [Riftshare.app](https://riftshare.app)
|
||||||
|
|
||||||
## Features
|
## 機能
|
||||||
|
|
||||||
- Easy secure file sharing between computers both in the local network and through the internet
|
- Easy secure file sharing between computers both in the local network and through the internet
|
||||||
- Supports sending files or directories securely through the [magic wormhole protocol](https://magic-wormhole.readthedocs.io/en/latest/)
|
- Supports sending files or directories securely through the [magic wormhole protocol](https://magic-wormhole.readthedocs.io/en/latest/)
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
sidebar_position: 6
|
sidebar_position: 6
|
||||||
---
|
---
|
||||||
|
|
||||||
# Compiling your Project
|
# プロジェクトのコンパイル
|
||||||
|
|
||||||
From the project directory, run `wails build`. This will compile your project and save the production-ready binary in the `build/bin` directory.
|
プロジェクトディレクトリ上で、`wails build`コマンドを実行しましょう。 そうすることで、プロジェクトがコンパイルされ、`build/bin`ディレクトリ内に本番配布用のバイナリが出力されます。
|
||||||
|
|
||||||
If you run the binary, you should see the default application:
|
バイナリを起動すると、デフォルト仕様のアプリを確認することができます:
|
||||||
|
|
||||||
```mdx-code-block
|
```mdx-code-block
|
||||||
<div class="text--center">
|
<div class="text--center">
|
||||||
@ -19,4 +19,4 @@ If you run the binary, you should see the default application:
|
|||||||
<br />
|
<br />
|
||||||
```
|
```
|
||||||
|
|
||||||
For more details on compilation options, please refer to the [CLI Reference](../reference/cli.mdx#build).
|
コンパイルオプションについて詳しくは、[CLIリファレンス](../reference/cli.mdx#build)をご覧ください。
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
sidebar_position: 5
|
sidebar_position: 5
|
||||||
---
|
---
|
||||||
|
|
||||||
# Developing your Application
|
# アプリの開発
|
||||||
|
|
||||||
You can run your application in development mode by running `wails dev` from your project directory. This will do the following things:
|
プロジェクトディレクトリのルート上で`wails dev`コマンドを実行すると、アプリを開発モードで起動することができます。 コマンドを実行すると下記の処理が実行されます:
|
||||||
|
|
||||||
- Build your application and run it
|
- アプリをビルドしたのち、起動する
|
||||||
- Bind your Go code to the frontend so it can be called from Javascript
|
- Goのコードをフロントエンドにバインドし、Javascriptから呼び出せるようにする
|
||||||
- Using the power of [Vite](https://vitejs.dev/), will watch for modifications in your Go files and rebuild/re-run on change
|
- Using the power of [Vite](https://vitejs.dev/), will watch for modifications in your Go files and rebuild/re-run on change
|
||||||
- Sets up a [webserver](http://localhost:34115) that will serve your application over a browser. This allows you to use your favourite browser extensions. You can even call your Go code from the console
|
- ブラウザからアプリを操作できるようにする[Webサーバ](http://localhost:34115)を立ち上げる。 これにより、任意のブラウザ拡張機能を利用できる。 JavascriptのコンソールからGoのコードを呼び出すこともできる
|
||||||
|
|
||||||
To get started, run `wails dev` in the project directory. More information on this can be found [here](../reference/cli.mdx#dev).
|
アプリ開発を始めるときは、プロジェクトディレクトリ上で`wails dev`コマンドを実行しましょう。 詳しくは、[こちら](../reference/cli.mdx#dev)をご覧ください。
|
||||||
|
|
||||||
Coming soon: Tutorial
|
近日中にチュートリアルを公開予定です。
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
sidebar_position: 2
|
sidebar_position: 2
|
||||||
---
|
---
|
||||||
|
|
||||||
# Creating a Project
|
# プロジェクトの開始
|
||||||
|
|
||||||
## Project Generation
|
## プロジェクトの生成
|
||||||
|
|
||||||
Now that the CLI is installed, you can generate a new project by using the `wails init` command.
|
CLIのインストールが終わったら、`wails init`コマンドで新しいプロジェクトを生成しましょう。
|
||||||
|
|
||||||
Pick your favourite framework:
|
好きなフレームワークを選択してください:
|
||||||
|
|
||||||
```mdx-code-block
|
```mdx-code-block
|
||||||
import Tabs from "@theme/Tabs";
|
import Tabs from "@theme/Tabs";
|
||||||
@ -90,13 +90,13 @@ If you would rather use Typescript:<br/>
|
|||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
There are also [community templates](../community/templates.mdx) available that offer different capabilities and frameworks.
|
様々な機能やフレームワークを提供する[コミュニティテンプレート](../community/templates.mdx)を利用することもできます。
|
||||||
|
|
||||||
To see the other options available, you can run `wails init -help`. More details can be found in the [CLI Reference](../reference/cli.mdx#init).
|
プロジェクト生成時に使用可能なオプションを確認するには、`wails init -help`を実行してください。 詳しくは、[CLIリファレンス](../reference/cli.mdx#init)を参照してください。
|
||||||
|
|
||||||
## Project Layout
|
## プロジェクトのディレクトリ構成
|
||||||
|
|
||||||
Wails projects have the following layout:
|
Wailsのプロジェクトディレクトリの構成は次のとおりです:
|
||||||
|
|
||||||
```
|
```
|
||||||
.
|
.
|
||||||
@ -111,20 +111,20 @@ Wails projects have the following layout:
|
|||||||
└── wails.json
|
└── wails.json
|
||||||
```
|
```
|
||||||
|
|
||||||
### Project structure rundown
|
### プロジェクトの構造
|
||||||
|
|
||||||
- `/main.go` - The main application
|
- `/main.go` - アプリのメインコード
|
||||||
- `/frontend/` - Frontend project files
|
- `/frontend/` - フロントエンドのプロジェクトディレクトリ
|
||||||
- `/build/` - Project build directory
|
- `/build/` - ビルドディレクトリ
|
||||||
- `/build/appicon.png` - The application icon
|
- `/build/appicon.png` - アプリアイコン
|
||||||
- `/build/darwin/` - Mac specific project files
|
- `/build/darwin/` - Mac固有のプロジェクトディレクトリ
|
||||||
- `/build/windows/` - Windows specific project files
|
- `/build/windows/` - Windows固有のプロジェクトディレクトリ
|
||||||
- `/wails.json` - The project configuration
|
- `/wails.json` - プロジェクト構成ファイル
|
||||||
- `/go.mod` - Go module file
|
- `/go.mod` - Goモジュール定義ファイル
|
||||||
- `/go.sum` - Go module checksum file
|
- `/go.sum` - Goモジュールチェックサムファイル
|
||||||
|
|
||||||
The `frontend` directory has nothing specific to Wails and can be any frontend project of your choosing.
|
`frontend`ディレクトリ内は、Wailsで決まったファイル構成等は無く、お好きなフロントエンドプロジェクトを配置することができます。
|
||||||
|
|
||||||
The `build` directory is used during the build process. These files may be updated to customise your builds. If files are removed from the build directory, default versions will be regenerated.
|
`build`ディレクトリは、アプリのビルド時に使用されます。 この中のファイルは、ビルドの挙動をカスタマイズするために、適宜ファイル内容を書き換えることができます。 buildディレクトリ内のファイルを削除すると、デフォルトのファイルが再生成されます。
|
||||||
|
|
||||||
The default module name in `go.mod` is "changeme". You should change this to something more appropriate.
|
`go.mod`のモジュール名は、最初は"changeme"になっています。 このモジュール名は、あなたのプロジェクトに適切な名前に変更しましょう。
|
||||||
|
@ -2,18 +2,18 @@
|
|||||||
sidebar_position: 1
|
sidebar_position: 1
|
||||||
---
|
---
|
||||||
|
|
||||||
# Installation
|
# インストール
|
||||||
|
|
||||||
## Supported Platforms
|
## サポートされているプラットフォーム
|
||||||
|
|
||||||
- Windows 10/11 AMD64/ARM64
|
- Windows 10/11 AMD64/ARM64
|
||||||
- MacOS 10.13+ AMD64
|
- MacOS 10.13+ AMD64
|
||||||
- MacOS 11.0+ ARM64
|
- MacOS 11.0+ ARM64
|
||||||
- Linux AMD64/ARM64
|
- Linux AMD64/ARM64
|
||||||
|
|
||||||
## Dependencies
|
## 依存関係
|
||||||
|
|
||||||
Wails has a number of common dependencies that are required before installation:
|
Wailsをインストールする前に、下記のものを導入しておく必要があります。
|
||||||
|
|
||||||
- Go 1.18+
|
- Go 1.18+
|
||||||
- NPM (Node 15+)
|
- NPM (Node 15+)
|
||||||
@ -22,20 +22,20 @@ Wails has a number of common dependencies that are required before installation:
|
|||||||
|
|
||||||
Download Go from the [Go Downloads Page](https://go.dev/dl/).
|
Download Go from the [Go Downloads Page](https://go.dev/dl/).
|
||||||
|
|
||||||
Ensure that you follow the official [Go installation instructions](https://go.dev/doc/install). You will also need to ensure that your `PATH` environment variable also includes the path to your `~/go/bin` directory. Restart your terminal and do the following checks:
|
公式の[Goインストール手順](https://go.dev/doc/install)に従って、Goをインストールしてください。 その際、`PATH`環境変数に`~/go/bin`ディレクトリへのパスが含まれていることも確認してください。 それらが終わったら、ターミナルを再起動し、以下の確認をしてください:
|
||||||
|
|
||||||
- Check Go is installed correctly: `go version`
|
- Goが正しくインストールされているかを確認する: `go version`
|
||||||
- Check "~/go/bin" is in your PATH variable: `echo $PATH | grep go/bin`
|
- "~/go/bin"のディレクトリパスがPATH環境変数に含まれているか確認する: `echo $PATH | grep go/bin`
|
||||||
|
|
||||||
### NPM
|
### NPM
|
||||||
|
|
||||||
Download NPM from the [Node Downloads Page](https://nodejs.org/en/download/). It is best to use the latest release as that is what we generally test against.
|
[Nodeダウンロードページ](https://nodejs.org/ja/download/)からNPMをダウンロードしてください。 最新版を利用することをお勧めします。なぜなら、私たちは最新版に対してテストを実施しているためです。
|
||||||
|
|
||||||
Run `npm --version` to verify.
|
`npm --version`を実行して、インストールが完了しているかを確認してください。
|
||||||
|
|
||||||
## Platform Specific Dependencies
|
## プラットフォーム固有の依存関係
|
||||||
|
|
||||||
You will also need to install platform specific dependencies:
|
開発作業を行うプラットフォームによって、必要な依存関係が存在します:
|
||||||
|
|
||||||
```mdx-code-block
|
```mdx-code-block
|
||||||
import Tabs from "@theme/Tabs";
|
import Tabs from "@theme/Tabs";
|
||||||
@ -62,18 +62,18 @@ import TabItem from "@theme/TabItem";
|
|||||||
</Tabs>
|
</Tabs>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Optional Dependencies
|
## 任意の依存関係
|
||||||
|
|
||||||
- [UPX](https://upx.github.io/) for compressing your applications.
|
- [UPX](https://upx.github.io/)を導入することで、構築したアプリを圧縮できます。
|
||||||
|
|
||||||
## Installing Wails
|
## Wailsのインストール
|
||||||
|
|
||||||
Run `go install github.com/wailsapp/wails/v2/cmd/wails@latest` to install the Wails CLI.
|
`go install github.com/wailsapp/wails/v2/cmd/wails@latest`を実行して、Wails CLIをインストールしてください。
|
||||||
|
|
||||||
## System Check
|
## システムチェック
|
||||||
|
|
||||||
Running `wails doctor` will check if you have the correct dependencies installed. If not, it will advise on what is missing and help on how to rectify any problems.
|
`wails doctor`を実行すると、必要な依存関係が正しくインストールされているかを確認することができます。 正しくインストールされていない場合は、その内容をあなたにお知らせして、どうすれば解決できるかを教えてくれます。
|
||||||
|
|
||||||
## The `wails` command appears to be missing?
|
## `wails`コマンドが見つからないのですが?
|
||||||
|
|
||||||
If your system is reporting that the `wails` command is missing, make sure you have followed the Go installation guide correctly. Normally, it means that the `go/bin` directory in your User's home directory is not in the `PATH` environment variable. You will also normally need to close and reopen any open command prompts so that changes to the environment made by the installer are reflected at the command prompt.
|
`wails`コマンドが見つからないとシステムに怒られた場合は、Goが、公式のGoインストール手順に従って導入されているかを確認してください。 コマンドが見つからないほとんどの理由は、あなたのホームディレクトリ配下にある`go/bin`ディレクトリのパスが、`PATH`環境変数に含まれていないからです。 また、インストールによって行われた環境変更を反映させるために、もともと開いていたコマンドプロンプト(ターミナル)がある場合はそれらをいったん閉じて、再度開きなおしてください。
|
||||||
|
@ -39,7 +39,7 @@ To provide more flexibility to developers, there is a meta tag that may be used
|
|||||||
|
|
||||||
The options are as follows:
|
The options are as follows:
|
||||||
|
|
||||||
| Value | Description |
|
| 値 | Description |
|
||||||
| ------------------- | ------------------------------------------------ |
|
| ------------------- | ------------------------------------------------ |
|
||||||
| noautoinjectruntime | Disable the autoinjection of `/wails/runtime.js` |
|
| noautoinjectruntime | Disable the autoinjection of `/wails/runtime.js` |
|
||||||
| noautoinjectipc | Disable the autoinjection of `/wails/ipc.js` |
|
| noautoinjectipc | Disable the autoinjection of `/wails/ipc.js` |
|
||||||
|
@ -5,13 +5,13 @@ Wails includes support for obfuscating your application using [garble](https://g
|
|||||||
To produce an obfuscated build, you can use the `-obfuscate` flag with the `wails build` command:
|
To produce an obfuscated build, you can use the `-obfuscate` flag with the `wails build` command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wails build -obfuscate
|
wails build -obfuscated
|
||||||
```
|
```
|
||||||
|
|
||||||
To customise the obfuscation settings, you can use the `-garbleargs` flag:
|
To customise the obfuscation settings, you can use the `-garbleargs` flag:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wails build -obfuscate -garbleargs "-literals -tiny -seed=myrandomseed"
|
wails build -obfuscated -garbleargs "-literals -tiny -seed=myrandomseed"
|
||||||
```
|
```
|
||||||
|
|
||||||
These settings may be persisted in your [project config](../reference/project-config).
|
These settings may be persisted in your [project config](../reference/project-config).
|
||||||
|
@ -22,7 +22,7 @@ const router = createRouter({
|
|||||||
The recommended approach for routing in Angular is [HashLocationStrategy](https://codecraft.tv/courses/angular/routing/routing-strategies#_hashlocationstrategy):
|
The recommended approach for routing in Angular is [HashLocationStrategy](https://codecraft.tv/courses/angular/routing/routing-strategies#_hashlocationstrategy):
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
RouterModule.forRoot(routes, {useHash: true})
|
RouterModule.forRoot(routes, { useHash: true });
|
||||||
```
|
```
|
||||||
|
|
||||||
## React
|
## React
|
||||||
|
@ -16,23 +16,24 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
# This Action only starts when you go to Actions and manually run the workflow.
|
# This Action only starts when you go to Actions and manually run the workflow.
|
||||||
|
|
||||||
- name: Get Wails
|
jobs:
|
||||||
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
package:
|
||||||
- name: Build Wails app
|
strategy:
|
||||||
run: |
|
matrix:
|
||||||
wails build
|
platform: [windows-latest, macos-latest]
|
||||||
- name: upload artifacts macOS
|
go-version: [1.18]
|
||||||
if: matrix.platform == 'macos-latest'
|
runs-on: ${{ matrix.platform }}
|
||||||
uses: actions/upload-artifact@v2
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
name: wails-binaries-macos
|
go-version: ${{ matrix.go-version }}
|
||||||
path: build/bin/*
|
- name: setup node
|
||||||
- name: upload artifacts windows
|
uses: actions/setup-node@v2
|
||||||
if: matrix.platform == 'windows-latest'
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
with:
|
||||||
name: wails-binaries-windows
|
node-version: 14
|
||||||
path: build/bin/*
|
# You may need to manually build you frontend manually here, unless you have configured frontend build and install commands in wails.json.
|
||||||
- name: Get Wails
|
- name: Get Wails
|
||||||
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
||||||
- name: Build Wails app
|
- name: Build Wails app
|
||||||
@ -58,7 +59,7 @@ Next we need to give the GitHub workflow access to our signing certificate. This
|
|||||||
certutil -encode .\my-cert.p12 my-cert-base64.txt
|
certutil -encode .\my-cert.p12 my-cert-base64.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
You should now have your .txt file with the base64 encoded certificate. Now you need to make two action secrets on GitHub. Now you need to make two action secrets on GitHub. Navigate to *Settings -> Secrets -> Actions* and create the two following secrets:
|
You should now have your .txt file with the base64 encoded certificate. It should start with _-----BEGIN CERTIFICATE-----_ and end with _-----END CERTIFICATE-----_. Now you need to make two action secrets on GitHub. Navigate to _Settings -> Secrets -> Actions_ and create the two following secrets:
|
||||||
|
|
||||||
- **WIN_SIGNING_CERT** with the contents of your base64 encoded certificate text.
|
- **WIN_SIGNING_CERT** with the contents of your base64 encoded certificate text.
|
||||||
- **WIN_SIGNING_CERT_PASSWORD** with the contents of your certificate password.
|
- **WIN_SIGNING_CERT_PASSWORD** with the contents of your certificate password.
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
An assortment of troubleshooting tips.
|
An assortment of troubleshooting tips.
|
||||||
|
|
||||||
## The `wails` command appears to be missing?
|
## `wails`コマンドが見つからないのですが?
|
||||||
|
|
||||||
If your system is reporting that the `wails` command is missing, make sure you have followed the Go installation guide correctly. Normally, it means that the `go/bin` directory in your User's home directory is not in the `PATH` environment variable. You will also normally need to close and reopen any open command prompts so that changes to the environment made by the installer are reflected at the command prompt.
|
`wails`コマンドが見つからないとシステムに怒られた場合は、Goが、公式のGoインストール手順に従って導入されているかを確認してください。 コマンドが見つからないほとんどの理由は、あなたのホームディレクトリ配下にある`go/bin`ディレクトリのパスが、`PATH`環境変数に含まれていないからです。 また、インストールによって行われた環境変更を反映させるために、もともと開いていたコマンドプロンプト(ターミナル)がある場合はそれらをいったん閉じて、再度開きなおしてください。
|
||||||
|
|
||||||
## My application is displaying a white/blank screen
|
## My application is displaying a white/blank screen
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ If you use the chocolatey package manager, run the following script:
|
|||||||
choco install nsis
|
choco install nsis
|
||||||
```
|
```
|
||||||
|
|
||||||
If you install NSIS manually, you need to add the *Bin* folder, which contains `makensis.exe`, in your NSIS installation to your path. [Here](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/) is a good tutorial on how to add to path on Windows.
|
If you install NSIS manually, you need to add the _Bin_ folder, which contains `makensis.exe`, in your NSIS installation to your path. [Here](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/) is a good tutorial on how to add to path on Windows.
|
||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
sidebar_position: 20
|
sidebar_position: 20
|
||||||
---
|
---
|
||||||
|
|
||||||
# How does it work?
|
# どうやって動いているの?
|
||||||
|
|
||||||
A Wails application is a standard Go application, with a webkit frontend. The Go part of the application consists of the application code and a runtime library that provides a number of useful operations, like controlling the application window. The frontend is a webkit window that will display the frontend assets. Also available to the frontend is a Javascript version of the runtime library. Finally, it is possible to bind Go methods to the frontend, and these will appear as Javascript methods that can be called, just as if they were local Javascript methods.
|
Wailsは、webkitフロントエンドを備えた、何の変哲もないGoアプリです。 アプリ全体のうちGoの部分は、アプリのコードと、ウィンドウ制御などの便利な機能を提供するランタイムライブラリで構成されています。 フロントエンドはwebkitウィンドウであり、フロンドエンドアセットをウィンドウ上に表示します。 フロントエンドからも、Javascriptでランタイムライブラリを呼び出すことができます。 そして最終的に、Goのメソッドはフロントエンドにバインドされ、ローカルのJavascriptメソッドであるかのように、フロントエンドから呼び出すことができます。
|
||||||
|
|
||||||
```mdx-code-block
|
```mdx-code-block
|
||||||
<div className="text--center">
|
<div className="text--center">
|
||||||
@ -12,11 +12,11 @@ A Wails application is a standard Go application, with a webkit frontend. The Go
|
|||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
## The Main Application
|
## アプリのメインコード
|
||||||
|
|
||||||
### Overview
|
### Overview
|
||||||
|
|
||||||
The main application consists of a single call to `wails.Run()`. It accepts the application configuration which describes the size of the application window, the window title, what assets to use, etc. A basic application might look like this:
|
アプリは、`wails.Run()`メソッドを1回呼び出すことで、構成することができます。 このメソッドで、アプリのウィンドウサイズやウィンドウタイトル、使用アセットなどを指定することができます。 基本的なアプリを作るコードは次のとおりです:
|
||||||
|
|
||||||
```go title="main.go"
|
```go title="main.go"
|
||||||
package main
|
package main
|
||||||
@ -68,45 +68,45 @@ func (b *App) Greet(name string) string {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options rundown
|
### オプション
|
||||||
|
|
||||||
This example has the following options set:
|
上記のコードでは、次のオプションが指定されています:
|
||||||
|
|
||||||
- `Title` - The text that should appear in the window's title bar
|
- `Title` - ウィンドウのタイトルバーに表示されるテキスト
|
||||||
- `Width` & `Height` - The dimensions of the window
|
- `Width` & `Height` - ウィンドウの大きさ
|
||||||
- `Assets` - The application's frontend assets
|
- `Assets` - アプリのフロントエンドアセット
|
||||||
- `OnStartup` - A callback for when the window is created and is about to start loading the frontend assets
|
- `OnStartup` - ウィンドウが作成され、フロントエンドの読み込みを開始しようとする時のコールバック
|
||||||
- `OnShutdown` - A callback for when the application is about to quit
|
- `OnShutdown` - アプリを終了しようとするときのコールバック
|
||||||
- `Bind` - A slice of struct instances that we wish to expose to the frontend
|
- `Bind` - フロントエンドにバインドさせたい構造体インスタンスのスライス
|
||||||
|
|
||||||
A full list of application options can be found in the [Options Reference](reference/options).
|
設定可能なすべてのオプションについては、[オプションのリファレンス](reference/options)をご覧ください。
|
||||||
|
|
||||||
#### Assets
|
#### Assets
|
||||||
|
|
||||||
The `Assets` option is mandatory as you can't have a Wails application without frontend assets. Those assets can be any files you would expect to find in a web application - html, js, css, svg, png, etc. **There is no requirement to generate asset bundles** - plain files will do. When the application starts, it will attempt to load `index.html` from your assets and the frontend will essentially work as a browser from that point on. It is worth noting that there is no requirement on where in the `embed.FS` the files live. It is likely that the embed path uses a nested directory relative to your main application code, such as `frontend/dist`:
|
Wailsでフロントエンドアセット無しのアプリを作成することはできないため、`Assets`オプションは必須オプションです。 アセットには、一般的なWebアプリケーションでよく見かけるような、html、js、css、svg、pngなどのファイルを含めることができます。**アセットバンドルを生成する必要は一切なく**、そのままのファイルを使用できます。 アプリが起動すると、アセット内の`index.html`が読み込まれます。この時点で、フロントエンドはブラウザとして動作するようになります。 `embed.FS`を使ってアセットファイルが格納されたディレクトリを指定しますが、ディレクトリの場所はどこでも構いません。 embedで指定するパスは、`frontend/dist`のように、アプリのメインコードから相対的に見たディレクトリパスになります:
|
||||||
|
|
||||||
```go title="main.go"
|
```go title="main.go"
|
||||||
//go:embed all:frontend/dist
|
//go:embed all:frontend/dist
|
||||||
var assets embed.FS
|
var assets embed.FS
|
||||||
```
|
```
|
||||||
|
|
||||||
At startup, Wails will iterate the embedded files looking for the directory containing `index.html`. All other assets will be loaded relative to this directory.
|
起動時に、Wailsは`index.html`が含まれるディレクトリを再帰的に探します。 他のすべてのアセットは、当該ディレクトリから相対的に読み込まれます。
|
||||||
|
|
||||||
As production binaries use the files contained in `embed.FS`, there are no external files required to be shipped with the application.
|
本番用のバイナリファイルには、`embed.FS`で指定されたアセットファイルが含まれるため、アプリ配布時に、バイナリファイルとは別にアセットファイルを付加させる必要はありません。
|
||||||
|
|
||||||
When running in development mode using the `wails dev` command, the assets are loaded off disk, and any changes result in a "live reload". The location of the assets will be inferred from the `embed.FS`.
|
`wails dev`コマンドを使って開発モードでアプリを起動した場合、アセットはディスクから読み込まれ、アセットファイルが更新されると、自動的にアプリがライブリロードされます。 アセットの場所は、`embed.FS`での指定値から推定されます。
|
||||||
|
|
||||||
More details can be found in the [Application Development Guide](guides/application-development.mdx).
|
詳細は、[アプリ開発ガイド](guides/application-development.mdx)をご覧ください。
|
||||||
|
|
||||||
#### Application Lifecycle Callbacks
|
#### アプリのライフサイクル
|
||||||
|
|
||||||
Just before the frontend is about to load `index.html`, a callback is made to the function provided in [OnStartup](reference/options.mdx#onstartup). A standard Go context is passed to this method. This context is required when calling the runtime so a standard pattern is to save a reference to in this method. Just before the application shuts down, the [OnShutdown](reference/options.mdx#onshutdown) callback is called in the same way, again with the context. There is also an [OnDomReady](reference/options.mdx#ondomready) callback for when the frontend has completed loading all assets in `index.html` and is equivalent of the [`body onload`](https://www.w3schools.com/jsref/event_onload.asp) event in Javascript. It is also possible to hook into the window close (or application quit) event by setting the option [OnBeforeClose](reference/options.mdx#onbeforeclose).
|
フロントエンドが`index.html`を読み込もうとする直前に、[OnStartup](reference/options.mdx#onstartup)で指定されたメソッドがコールバックされます。 A standard Go context is passed to this method. このメソッドに引数で渡されるContextは、今後、Wailsのラインタイムを呼び出すときに必要になるため、通常は、このContextへの参照を保持しておいてください。 同様に、アプリがシャットダウンされる直前には、[OnShutdown](reference/options.mdx#onshutdown)で指定されたコールバックが呼び出され、Contextも渡されます。 `index.html`に含まれるすべてのアセットが読み込み終わったときに呼び出される[OnDomReady](reference/options.mdx#ondomready)コールバックもあります。これは、Javascriptの[`body onload`](https://www.w3schools.com/jsref/event_onload.asp)イベントと同等のものです。 また、[OnBeforeClose](reference/options.mdx#onbeforeclose)を指定すると、ウィンドウを閉じる(またはアプリを終了する)イベントにフックさせることもできます。
|
||||||
|
|
||||||
#### Method Binding
|
#### メソッドのバインド
|
||||||
|
|
||||||
The `Bind` option is one of the most important options in a Wails application. It specifies which struct methods to expose to the frontend. Think of structs like "controllers" in a traditional web application. When the application starts, it examines the struct instances listed in the `Bind` field in the options, determines which methods are public (starts with an uppercase letter) and will generate Javascript versions of those methods that can be called by the frontend code.
|
`Bind`オプションは、Wailsアプリで最も重要なオプションの1つです。 このオプションでは、フロントエンドに公開する、構造体のメソッドを指定することができます。 構造体は、従来のWebアプリにおける"コントローラ"の立ち位置であるとお考えください。 アプリが起動すると、`Bind`オプションで指定されている構造体を対象に、その中にあるパブリックメソッド(大文字で始まるメソッド名)を探します。そして、フロントエンドのコードからそれらのメソッドを呼び出せるJavascriptが生成されます。
|
||||||
|
|
||||||
:::info Note
|
:::info 備考
|
||||||
|
|
||||||
|
|
||||||
Wailsで構造体を正しくバインドするためには、構造体の*インスタンス*をオプションで指定してください。
|
Wailsで構造体を正しくバインドするためには、構造体の*インスタンス*をオプションで指定してください。
|
||||||
@ -114,7 +114,7 @@ Wailsで構造体を正しくバインドするためには、構造体の*イ
|
|||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
In this example, we create a new `App` instance and then add this instance to the `Bind` option in `wails.Run`:
|
下記のコードでは、新しく`App`インスタンスを作成し、`wails.Run`関数の`Bind`オプションの中で、そのインスタンスを追加しています:
|
||||||
|
|
||||||
```go {16,24} title="main.go"
|
```go {16,24} title="main.go"
|
||||||
package main
|
package main
|
||||||
@ -158,7 +158,7 @@ func (a *App) Greet(name string) string {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
You may bind as many structs as you like. Just make sure you create an instance of it and pass it in `Bind`:
|
構造体は、好きな数だけバインドできます。 `Bind`には、構造体のインスタンスを渡すようにしてください:
|
||||||
|
|
||||||
```go {8-10}
|
```go {8-10}
|
||||||
//...
|
//...
|
||||||
@ -176,26 +176,26 @@ You may bind as many structs as you like. Just make sure you create an instance
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
When you run `wails dev` (or `wails generate module`), a frontend module will be generated containing the following:
|
`wails dev`コマンド(または、`wails generate module`コマンド)を実行すると、以下のものを含むフロントエンドモジュールが生成されます:
|
||||||
|
|
||||||
- Javascript bindings for all bound methods
|
- バインドされたすべてのメソッドのJavascript
|
||||||
- Typescript declarations for all bound methods
|
- バインドされたすべてのメソッドのTypescript宣言
|
||||||
- Typescript definitions for all Go structs used as inputs or outputs by the bound methods
|
- バインドされたメソッドの引数または返り値で使用されているGoの構造体のTypescript宣言
|
||||||
|
|
||||||
This makes it incredibly simple to call Go code from the frontend, using the same strongly typed datastructures.
|
これにより、強力な型付けがなされたデータ構造を使用して、フロントエンドから簡単にGoのコードを呼び出すことができます。
|
||||||
|
|
||||||
## The Frontend
|
## フロントエンド
|
||||||
|
|
||||||
### Overview
|
### Overview
|
||||||
|
|
||||||
The frontend is a collection of files rendered by webkit. It's like a browser and webserver in one. There is virtually[^1] no limit to which frameworks or libraries you can use. The main points of interaction between the frontend and your Go code are:
|
フロントエンドは、webkitによってレンダリングされるファイル群です。 ブラウザとWebサーバが一体となったような動きをします。 使用できるフレームワークやライブラリの制限はほぼありません[^1]。 フロントエンドとGoコードとの相互のやり取りについて、主なポイントは次のとおりです:
|
||||||
|
|
||||||
- Calling bound Go methods
|
- バインドされたGoメソッドの呼び出し
|
||||||
- Calling runtime methods
|
- ランタイムメソッドの呼び出し
|
||||||
|
|
||||||
### Calling bound Go methods
|
### バインドされたGoメソッドの呼び出し
|
||||||
|
|
||||||
When you run your application with `wails dev`, it will automatically generate Javascript bindings for your structs in a directory called `wailsjs/go` (You can also do this by running `wails generate module`). The generated files mirror the package names in your application. In the example above, we bind `app`, which has one public method `Greet`. This will lead to the generation of the following files:
|
`wails dev`コマンドでアプリを起動すると、Go構造体のJavascriptバインディングが`wailsjs/go`ディレクトリに自動的に生成されます(`wails generate module`コマンドでも生成可能)。 生成されたファイルには、アプリ内のGoパッケージ名が反映されています。 先の例では、`Greet`というパブリックメソッドを持つ`app`をバインドしていました。 この場合、次のようなファイルが生成されることになります:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wailsjs
|
wailsjs
|
||||||
@ -205,7 +205,7 @@ wailsjs
|
|||||||
└─App.js
|
└─App.js
|
||||||
```
|
```
|
||||||
|
|
||||||
Here we can see that there is a `main` package that contains the Javascript bindings for the bound `App` struct, as well as the Typescript declaration file for those methods. To call `Greet` from our frontend, we simply import the method and call it like a regular Javascript function:
|
ご覧のとおり、`main`パッケージ内の`App`構造体Javascriptバインディングが、それらのメソッドのTypescript型定義と並んで生成されていることが分かります。 フロントエンドから`Greet`メソッドを呼び出すには、単純にメソッドをインポートし、通常のJavascript関数と同じように呼び出してください:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// ...
|
// ...
|
||||||
@ -218,29 +218,31 @@ import {Greet} from '../wailsjs/go/main/App'
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The Typescript declaration file gives you the correct types for the bound methods:
|
Typescript型定義ファイルは、バインドされたメソッドの正しい型を提供します:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
export function Greet(arg1:string):Promise<string>;
|
export function Greet(arg1:string):Promise<string>;
|
||||||
```
|
```
|
||||||
|
|
||||||
The generated methods return a Promise. A successful call will result in the first return value from the Go call to be passed to the `resolve` handler. An unsuccessful call is when a Go method that has an error type as it's second return value, passes an error instance back to the caller. This is passed back via the `reject` handler. In the example above, `Greet` only returns a `string` so the Javascript call will never reject - unless invalid data is passed to it.
|
生成されたメソッドはPromiseを返すようになっています。 呼び出しが成功すると、Goからの1番目の返り値が`resolve`ハンドラに渡されます。 呼び出しに失敗したとみなされるのは、Goメソッドの2番目の返り値がerror型で、それがerrorインスタンスを返したときです。 これは、`reject`ハンドラを介して返されます。 先の例では、`Greet`メソッドは`string`型の返り値のみであるため、無効なデータが渡されない限り、Javascript側でrejectハンドラが呼ばれることはありません。
|
||||||
|
|
||||||
All data types are correctly translated between Go and Javascript. Even structs. If you return a struct from a Go call, it will be returned to your frontend as a Javascript class. Note: If you wish to use structs, you **must** define `json` struct tags for your fields!
|
すべてのデータ型は、GoとJavascriptの間で正しく解釈されます。 もちろん構造体も正しく解釈されます。 Goから構造体が返された場合、フロントエンドにはJavascriptのクラスとして返されます。
|
||||||
|
|
||||||
:::info Note
|
:::info 備考
|
||||||
|
|
||||||
|
|
||||||
|
Struct fields *must* have a valid `json` tag to be included in the generated Typescript.
|
||||||
|
|
||||||
Anonymous nested structs are not supported at this time.
|
Anonymous nested structs are not supported at this time.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
It is possible to send structs back to Go. Any Javascript map/class passed as an argument that is expecting a struct, will be converted to that struct type. To make this process a lot easier, in `dev` mode, a TypeScript module is generated, defining all the struct types used in bound methods. Using this module, it's possible to construct and send native Javascript objects to the Go code.
|
Goに対して引数として構造体を渡すこともできます。 構造体として取り扱ってほしいJavascriptのマップやクラスを渡すと、構造体に変換されます。 あなたが簡単にこれらのことを把握できるように、`dev`モードでは、バウンドされたGoメソッドで使用されている全構造体の型が定義された、Typescriptモジュールが生成されます。 このモジュールを使用すると、Javascriptネイティブなオブジェクトを構築し、Goコードへ送信することができます。
|
||||||
|
|
||||||
There is also support for Go methods that use structs in their signature. All Go structs specified by a bound method (either as parameters or return types) will have Typescript versions auto generated as part of the Go code wrapper module. Using these, it's possible to share the same data model between Go and Javascript.
|
There is also support for Go methods that use structs in their signature. バインドされたメソッドで、引数または返り値として指定されているすべてのGo構造体は、Goのコードラッパーモジュールの一部として生成されたTypescript定義を持っています。 これらを使用することで、GoとJavascriptの間で、同じデータモデルを共有できます。
|
||||||
|
|
||||||
Example: We update our `Greet` method to accept a `Person` instead of a string:
|
例: `Greet`メソッドを更新して、文字列型の代わりに`Person`型を引数で受け付けてみる:
|
||||||
|
|
||||||
```go title="main.go"
|
```go title="main.go"
|
||||||
type Person struct {
|
type Person struct {
|
||||||
@ -259,7 +261,7 @@ func (a *App) Greet(p Person) string {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The `wailsjs/go/main/App.js` file will still have the following code:
|
`wailsjs/go/main/App.js`ファイルには、次のコードが出力されます:
|
||||||
|
|
||||||
```js title="App.js"
|
```js title="App.js"
|
||||||
export function Greet(arg1) {
|
export function Greet(arg1) {
|
||||||
@ -267,98 +269,97 @@ export function Greet(arg1) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
But the `wailsjs/go/main/App.d.ts` file will be updated with the following code:
|
しかし、`wailsjs/go/main/App.d.ts`ファイルは次のコードが出力されます:
|
||||||
|
|
||||||
```ts title="App.d.ts"
|
```ts title="App.d.ts"
|
||||||
import {main} from '../models';
|
import { main } from "../models";
|
||||||
|
|
||||||
export function Greet(arg1:main.Person):Promise<string>;
|
export function Greet(arg1: main.Person): Promise<string>;
|
||||||
```
|
```
|
||||||
|
|
||||||
As we can see, the "main" namespace is imported from a new "models.ts" file. This file contains all the struct definitions used by our bound methods. In this example, this is a `Person` struct. If we look at `models.ts`, we can see how the models are defined:
|
見ると分かるように、"main"名前空間は、新しく生成された"models.ts"ファイルからインポートされています。 このファイルには、バインドされたメソッドで使用されるすべての構造体の型定義が含まれています。 この例では、`Person`構造体の型定義が含まれています。 `models.ts`を確認すれば、モデルがどのように定義されているかが分かります。
|
||||||
|
|
||||||
```ts title="models.ts"
|
```ts title="models.ts"
|
||||||
export namespace main {
|
export namespace main {
|
||||||
|
export class Address {
|
||||||
|
street: string;
|
||||||
|
postcode: string;
|
||||||
|
|
||||||
export class Address {
|
static createFrom(source: any = {}) {
|
||||||
street: string;
|
return new Address(source);
|
||||||
postcode: string;
|
|
||||||
|
|
||||||
static createFrom(source: any = {}) {
|
|
||||||
return new Address(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(source: any = {}) {
|
|
||||||
if ('string' === typeof source) source = JSON.parse(source);
|
|
||||||
this.street = source["street"];
|
|
||||||
this.postcode = source["postcode"];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
export class Person {
|
|
||||||
name: string;
|
|
||||||
age: number;
|
|
||||||
address?: Address;
|
|
||||||
|
|
||||||
static createFrom(source: any = {}) {
|
constructor(source: any = {}) {
|
||||||
return new Person(source);
|
if ("string" === typeof source) source = JSON.parse(source);
|
||||||
}
|
this.street = source["street"];
|
||||||
|
this.postcode = source["postcode"];
|
||||||
constructor(source: any = {}) {
|
|
||||||
if ('string' === typeof source) source = JSON.parse(source);
|
|
||||||
this.name = source["name"];
|
|
||||||
this.age = source["age"];
|
|
||||||
this.address = this.convertValues(source["address"], Address);
|
|
||||||
}
|
|
||||||
|
|
||||||
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
|
||||||
if (!a) {
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
if (a.slice) {
|
|
||||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
|
||||||
} else if ("object" === typeof a) {
|
|
||||||
if (asMap) {
|
|
||||||
for (const key of Object.keys(a)) {
|
|
||||||
a[key] = new classs(a[key]);
|
|
||||||
}
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
return new classs(a);
|
|
||||||
}
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
export class Person {
|
||||||
|
name: string;
|
||||||
|
age: number;
|
||||||
|
address?: Address;
|
||||||
|
|
||||||
|
static createFrom(source: any = {}) {
|
||||||
|
return new Person(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(source: any = {}) {
|
||||||
|
if ("string" === typeof source) source = JSON.parse(source);
|
||||||
|
this.name = source["name"];
|
||||||
|
this.age = source["age"];
|
||||||
|
this.address = this.convertValues(source["address"], Address);
|
||||||
|
}
|
||||||
|
|
||||||
|
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
||||||
|
if (!a) {
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
if (a.slice) {
|
||||||
|
return (a as any[]).map((elem) => this.convertValues(elem, classs));
|
||||||
|
} else if ("object" === typeof a) {
|
||||||
|
if (asMap) {
|
||||||
|
for (const key of Object.keys(a)) {
|
||||||
|
a[key] = new classs(a[key]);
|
||||||
|
}
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
return new classs(a);
|
||||||
|
}
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
So long as you have TypeScript as part of your frontend build configuration, you can use these models in the following way:
|
フロントエンドのビルド構成にTypescriptを使用している限り、これらのモデルを次のように使用できます:
|
||||||
|
|
||||||
```js title="mycode.js"
|
```js title="mycode.js"
|
||||||
import {Greet} from '../wailsjs/go/main/App'
|
import { Greet } from "../wailsjs/go/main/App";
|
||||||
import {main} from '../wailsjs/go/models'
|
import { main } from "../wailsjs/go/models";
|
||||||
|
|
||||||
function generate() {
|
function generate() {
|
||||||
let person = new main.Person()
|
let person = new main.Person();
|
||||||
person.name = "Peter"
|
person.name = "Peter";
|
||||||
person.age = 27
|
person.age = 27;
|
||||||
Greet(person).then((result) => {
|
Greet(person).then((result) => {
|
||||||
console.log(result)
|
console.log(result);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The combination of generated bindings and TypeScript models makes for a powerful development environment.
|
生成されたバインディングとTypescriptモデルの組み合わせによって、強力な開発環境を実現させています。
|
||||||
|
|
||||||
More information on Binding can be found in the [Binding Methods](guides/application-development.mdx#binding-methods) section of the [Application Development Guide](guides/application-development.mdx).
|
バインディングの詳細については、[アプリ開発ガイド](guides/application-development.mdx)の[バインディングメソッド](guides/application-development.mdx#binding-methods)をご覧ください。
|
||||||
|
|
||||||
### Calling runtime methods
|
### ランタイムメソッドの呼び出し
|
||||||
|
|
||||||
The Javascript runtime is located at `window.runtime` and contains many methods to do various tasks such as emit an event or perform logging operations:
|
Javascriptランタイムは`window.runtime`に存在し、イベント発行やロギングなど、さまざまなタスクを実行するためのメソッドが含まれています:
|
||||||
|
|
||||||
```js title="mycode.js"
|
```js title="mycode.js"
|
||||||
window.runtime.EventsEmit("my-event", 1);
|
window.runtime.EventsEmit("my-event", 1);
|
||||||
```
|
```
|
||||||
|
|
||||||
More details about the JS runtime can be found in the [Runtime Reference](reference/runtime/intro).
|
Javascriptランタイムの詳細については、[ランタイムリファレンス](reference/runtime/intro)をご覧ください。
|
||||||
|
|
||||||
[^1]: There is a very small subset of libraries that use features unsupported in WebViews. There are often alternatives and workarounds for such cases.
|
[^1]: まれに、WebViewでサポートされていない機能を使用するライブラリがあります。 ほとんどの場合、それらは代替手段や回避方法がありますので、それらを検討してください。
|
||||||
|
@ -2,26 +2,26 @@
|
|||||||
sidebar_position: 1
|
sidebar_position: 1
|
||||||
---
|
---
|
||||||
|
|
||||||
# Introduction
|
# イントロダクション
|
||||||
|
|
||||||
Wails is a project that enables you to write desktop apps using Go and web technologies.
|
Wailsは、Go言語とWeb技術を使用して、デスクトップアプリの構築を可能にするプロジェクトです。
|
||||||
|
|
||||||
Consider it a lightweight and fast Electron alternative for Go. You can easily build applications with the flexibility and power of Go, combined with a rich, modern frontend.
|
"Goの力によって、Electronが軽量かつ高速になったようなもの"、と考えるとよいでしょう。 Goの柔軟性とパワーに、リッチでモダンなフロントエンドを組み合わせたアプリを、簡単に構築することができます。
|
||||||
|
|
||||||
### Features
|
### 機能
|
||||||
|
|
||||||
- Native Menus, Dialogs, Theming and Translucency
|
- ネイティブなメニュー、ダイアログ、テーマ、透過を使用できます
|
||||||
- Windows, macOS and linux support
|
- Windows、macOS、Linuxをサポートしています
|
||||||
- Built in templates for Svelte, React, Preact, Vue, Lit and Vanilla JS
|
- Svelte、React、Preact、Vue、Lit、Vanilla JS向けのテンプレートを用意しています
|
||||||
- Easily call Go methods from Javascript
|
- JavascriptからGoのメソッドを簡単に呼び出せます
|
||||||
- Automatic Go struct to Typescript model generation
|
- Go構造体からTypescriptの型を自動的に生成します
|
||||||
- No CGO or external DLLs required on Windows
|
- Windowsでは、CGOや外部DLLを用意する必要はありません
|
||||||
- Live development mode using the power of [Vite](https://vitejs.dev/)
|
- [Vite](https://vitejs.dev/)の力を利用したライブ開発が可能です
|
||||||
- Powerful CLI to easily Create, Build and Package applications
|
- 簡単にアプリを生成、ビルド、パッケージ化できる強力なCLIを用意しています
|
||||||
- A rich [runtime library](/docs/reference/runtime/intro)
|
- 豊富な[ランタイムライブラリ](/docs/reference/runtime/intro)を用意しています
|
||||||
- Applications built with Wails are Apple & Microsoft Store compliant
|
- Wailsで構築されたアプリケーションは、Apple StoreおよびMicrosoft Storeに準拠しています
|
||||||
|
|
||||||
This is [varly](https://varly.app) - a desktop application for MacOS & Windows written using Wails. Not only does it look great, it uses native menus and translucency - everything you'd expect from a modern native app.
|
例えば [varly](https://varly.app) は、Wailsで構築されたMacOS・Windows向けのデスクトップアプリです。 見栄えが良いだけではなく、ネイティブメニューや半透明効果を使用しています。これらは、モダンなネイティブアプリに期待されるものです。
|
||||||
|
|
||||||
```mdx-code-block
|
```mdx-code-block
|
||||||
<p class="text--center">
|
<p class="text--center">
|
||||||
@ -34,42 +34,42 @@ This is [varly](https://varly.app) - a desktop application for MacOS & Windows w
|
|||||||
</p>
|
</p>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Quick Start Templates
|
### クイックスタートテンプレート
|
||||||
|
|
||||||
Wails comes with a number of pre-configured templates that allow you to get your application up and running quickly. There are templates for the following frameworks: Svelte, React, Vue, Preact, Lit and Vanilla. There are both Javascript and Typescript versions for each template.
|
Wailsには、アプリの開発をすばやく始められるように、多数のテンプレートが用意されています。 Svelte、React、Vue、Preact、LitおよびVanilla用で、それぞれのテンプレートがあります。 各テンプレートには、Javascript版とTypescript版が用意されています。
|
||||||
|
|
||||||
### Native Elements
|
### ネイティブ要素
|
||||||
|
|
||||||
Wails uses a purpose built library for handling native elements such as Window, Menus, Dialogs, etc, so you can build good-looking, feature rich desktop applications.
|
Wailsは、ウィンドウ、メニュー、ダイアログなどのネイティブ要素を処理する専用ライブラリを使用するため、見栄えが良く、リッチな機能を備えたデスクトップアプリを構築できます。
|
||||||
|
|
||||||
**It does not embed a browser**, so it is resource efficient. Instead, it uses the native rendering engine for the platform. On Windows, this is the new Microsoft Webview2 library, built on Chromium.
|
**ブラウザを埋め込まないため**、無駄なリソースを割きません。 ブラウザを埋め込まない代わりに、OSプラットフォームのネイティブなレンダリングエンジンを使用します。 例えばWindowsの場合、Chromium上でビルトされているMicrosoft Webview2ライブラリを使用します。
|
||||||
|
|
||||||
### Go & Javascript Interoperability
|
### GoとJavascriptのやり取り
|
||||||
|
|
||||||
Wails automatically makes your Go methods available to Javascript, so you can call them by name from your frontend! It even generates Typescript models for the structs used by your Go methods, so you can pass the same data structures between Go and Javascript.
|
Wailsは自動的に、GoのメソッドをJavascriptから利用できるようにするので、フロントエンドからGoのメソッド名を呼び出すことができます。 It even generates Typescript models for the structs used by your Go methods, so you can pass the same data structures between Go and Javascript.
|
||||||
|
|
||||||
### Runtime Library
|
### ランタイムライブラリ
|
||||||
|
|
||||||
Wails provides a runtime library, for both Go and Javascript, that handles a lot of the things modern applications need, like Eventing, Logging, Dialogs, etc.
|
WailsはGoとJavascriptの両方にランタイムライブラリを提供し、イベント、ロギング、ダイアログなど、モダンなアプリに必要な多くの機能を使うことができます。
|
||||||
|
|
||||||
### Live Development Experience
|
### ライブ開発
|
||||||
|
|
||||||
#### Automatic Rebuilds
|
#### 自動リビルド
|
||||||
|
|
||||||
When you run your application in "dev" mode, Wails will build your application as a native desktop application, but will read your assets from disk. It will detect any changes to your Go code and automatically rebuild and relaunch your application.
|
アプリを"dev"モードで起動すると、Wailsはあなたが書いたコードをネイティブデスクトップアプリとしてビルドしますが、プログラムアセットは常にディスクから読み込む状態になります。 その仕組みにより、アプリ起動中にGoコードが書き換えられると、変更を検出して自動的にアプリがリビルドされ、再起動します。
|
||||||
|
|
||||||
#### Automatic Reloads
|
#### 自動リロード
|
||||||
|
|
||||||
When changes to your application assets are detected, your running application will "reload", reflecting your changes almost immediately.
|
フロントエンドアセットの変更が検出された場合、起動中のアプリは自動的にリロードされ、変更がすぐに反映されます。
|
||||||
|
|
||||||
#### Develop your application in a Browser
|
#### ブラウザを使った開発
|
||||||
|
|
||||||
If you prefer to debug and develop in a browser then Wails has you covered. The running application also has a webserver that will run your application in any browser that connects to it. It will even refresh when your assets change on disk.
|
If you prefer to debug and develop in a browser then Wails has you covered. ブラウザでのデバッグや開発も、Wailsにお任せください。 起動中のアプリはWebサーバを兼ねており、お好きなブラウザから接続してアプリを操作することができます。 プログラムアセットが書き換わった時はすぐに更新されます。
|
||||||
|
|
||||||
### Production-ready Native Binaries
|
### 本番用のネイティブバイナリ
|
||||||
|
|
||||||
When you're ready to do the final build of your application, the CLI will compile it down to a single executable, with all the assets bundled into it. On Windows and MacOS, it is possible to create a native package for distribution. The assets used in packaging (icon, info.plist, manifest file, etc) are part of your project and may be customised, giving you total control over how your applications are built.
|
アプリを本番用にビルドする準備ができたら、CLIが、アプリを単一の実行可能ファイルへコンパイルし、すべてのアセットをバンドルしてくれます。 WindowsおよびMacOSでは、配布用のネイティブパッケージを作成できます。 パッケージ化に必要なアイコン、info.plist、マニフェストファイルなどは、プロジェクトの一部としてカスタマイズできるため、アプリのビルド方法をフルコントロールできます。
|
||||||
|
|
||||||
### Tooling
|
### ツール
|
||||||
|
|
||||||
The Wails CLI provides a hassle-free way to generate, build and bundle your applications. It will do the heavy lifting of creating icons, compiling your application with optimal settings and delivering a distributable, production ready binary. Choose from a number of starter templates to get up and running quickly!
|
Wails CLIを使うことで、簡単にアプリを生成、ビルド、バンドルすることができます。 アイコンの作成、最適なコンパイル構成の設定、本番向けのバイナリ配布など、面倒なことをあなたの代わりに引き受けてくれます。 多数のテンプレートの中から、あなたに合ったものを選んで、すぐに開発を始めましょう!
|
||||||
|
@ -23,7 +23,7 @@ The Wails CLI has a number of commands that are used for managing your projects.
|
|||||||
| -ide | Generate IDE project files | |
|
| -ide | Generate IDE project files | |
|
||||||
| -f | Force build application | false |
|
| -f | Force build application | false |
|
||||||
|
|
||||||
Example: `wails init -n test -d mytestproject -g -ide vscode -q`
|
例: `wails init -n test -d mytestproject -g -ide vscode -q`
|
||||||
|
|
||||||
This will generate a a project called "test" in the "mytestproject" directory, initialise git, generate vscode project files and do so silently.
|
This will generate a a project called "test" in the "mytestproject" directory, initialise git, generate vscode project files and do so silently.
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ More information on using IDEs with Wails can be found [here](../guides/ides.mdx
|
|||||||
|
|
||||||
Remote templates (hosted on GitHub) are supported and can be installed by using the template's project URL.
|
Remote templates (hosted on GitHub) are supported and can be installed by using the template's project URL.
|
||||||
|
|
||||||
Example: `wails init -n test -t https://github.com/leaanthony/testtemplate[@v1.0.0]`
|
例: `wails init -n test -t https://github.com/leaanthony/testtemplate[@v1.0.0]`
|
||||||
|
|
||||||
A list of community maintained templates can be found [here](../community/templates.mdx)
|
A list of community maintained templates can be found [here](../community/templates.mdx)
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for
|
|||||||
| -o filename | Output filename | |
|
| -o filename | Output filename | |
|
||||||
| -s | Skip building the frontend | false |
|
| -s | Skip building the frontend | false |
|
||||||
| -f | Force build application | false |
|
| -f | Force build application | false |
|
||||||
| -tags "extra tags" | Build tags to pass to Go compiler. Must be quoted. Space or comma (but not both) separated | |
|
| -tags "extra tags" | Goコンパイラに渡すビルドタグ。 値は引用符で囲んでください。 また、スペースまたはカンマで区切ってください(両方は使用しないでください)。 | |
|
||||||
| -upx | Compress final binary using "upx" | |
|
| -upx | Compress final binary using "upx" | |
|
||||||
| -upxflags | Flags to pass to upx | |
|
| -upxflags | Flags to pass to upx | |
|
||||||
| -v int | Verbosity level (0 - silent, 1 - default, 2 - verbose) | 1 |
|
| -v int | Verbosity level (0 - silent, 1 - default, 2 - verbose) | 1 |
|
||||||
@ -71,8 +71,8 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for
|
|||||||
| -trimpath | Remove all file system paths from the resulting executable. | false |
|
| -trimpath | Remove all file system paths from the resulting executable. | false |
|
||||||
| -race | Build with Go's race detector | false |
|
| -race | Build with Go's race detector | false |
|
||||||
| -windowsconsole | Keep the console window for Windows builds | |
|
| -windowsconsole | Keep the console window for Windows builds | |
|
||||||
| -obfuscate | Obfuscate the application using [garble](https://github.com/burrowers/garble) | false |
|
| -obfuscate | [garble](https://github.com/burrowers/garble)を使用してアプリケーションを難読化する | false |
|
||||||
| -garbleargs | Arguments to pass to garble | `-literals -tiny -seed=random` |
|
| -garbleargs | garbleへ渡す引数 | `-literals -tiny -seed=random` |
|
||||||
|
|
||||||
For a detailed description of the `webview2` flag, please refer to the [Windows](../guides/windows.mdx) Guide.
|
For a detailed description of the `webview2` flag, please refer to the [Windows](../guides/windows.mdx) Guide.
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ Your system is ready for Wails development!
|
|||||||
| -reloaddirs | Additional directories to trigger reloads (comma separated) | Value in `wails.json` |
|
| -reloaddirs | Additional directories to trigger reloads (comma separated) | Value in `wails.json` |
|
||||||
| -ldflags "flags" | Additional ldflags to pass to the compiler | |
|
| -ldflags "flags" | Additional ldflags to pass to the compiler | |
|
||||||
| -tags "extra tags" | Build tags to pass to compiler (quoted and space separated) | |
|
| -tags "extra tags" | Build tags to pass to compiler (quoted and space separated) | |
|
||||||
| -loglevel "loglevel" | Loglevel to use - Trace, Debug, Info, Warning, Error | Debug |
|
| -loglevel "loglevel" | Loglevel to use - Trace, Debug, Info, Warning, Error | デバッグ |
|
||||||
| -noreload | Disable automatic reload when assets change | |
|
| -noreload | Disable automatic reload when assets change | |
|
||||||
| -nogen | Disable generate module | |
|
| -nogen | Disable generate module | |
|
||||||
| -v | Verbosity level (0 - silent, 1 - standard, 2 - verbose) | 1 |
|
| -v | Verbosity level (0 - silent, 1 - standard, 2 - verbose) | 1 |
|
||||||
|
@ -33,18 +33,13 @@ An example of how to create a menu:
|
|||||||
// ...
|
// ...
|
||||||
```
|
```
|
||||||
|
|
||||||
```` It is also possible to dynamically update the menu, by updating the menu struct and calling \[MenuUpdateApplicationMenu\](../reference/runtime/menu.mdx#menuupdateapplicationmenu).
|
Menu構造体を更新し、[MenuUpdateApplicationMenu](../reference/runtime/menu.mdx#menuupdateapplicationmenu)メソッドを呼び出すことで、メニューを動的に更新することも可能です。
|
||||||
|
|
||||||
The example above uses helper methods, however it's possible to build the menu structs manually.
|
The example above uses helper methods, however it's possible to build the menu structs manually.
|
||||||
|
|
||||||
## Menu
|
## Menu
|
||||||
|
|
||||||
A Menu is a collection of MenuItems:
|
Menuは、MenuItemのコレクションです。
|
||||||
|
|
||||||
```go title="Package: github.com/wailsapp/wails/v2/pkg/menu"
|
|
||||||
## Menu
|
|
||||||
|
|
||||||
A Menu is a collection of MenuItems:
|
|
||||||
|
|
||||||
```go title="Package: github.com/wailsapp/wails/v2/pkg/menu"
|
```go title="Package: github.com/wailsapp/wails/v2/pkg/menu"
|
||||||
type Menu struct {
|
type Menu struct {
|
||||||
@ -126,7 +121,7 @@ Keys are any single character on a keyboard with the exception of `+`, which is
|
|||||||
|
|
||||||
Wails also supports parsing accelerators using the same syntax as Electron. This is useful for storing accelerators in config files.
|
Wails also supports parsing accelerators using the same syntax as Electron. This is useful for storing accelerators in config files.
|
||||||
|
|
||||||
Example:
|
例:
|
||||||
|
|
||||||
```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys"
|
```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys"
|
||||||
// Defines cmd+o on Mac and ctrl-o on Window/Linux
|
// Defines cmd+o on Mac and ctrl-o on Window/Linux
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
sidebar_position: 3
|
sidebar_position: 3
|
||||||
---
|
---
|
||||||
|
|
||||||
# Options
|
# オプション
|
||||||
|
|
||||||
## Application Options
|
## Application Options
|
||||||
|
|
||||||
@ -101,93 +101,93 @@ func main() {
|
|||||||
|
|
||||||
The text shown in the window's title bar.
|
The text shown in the window's title bar.
|
||||||
|
|
||||||
Name: Title<br/> Type: `string`
|
名前: Title<br/> データ型: `string`
|
||||||
|
|
||||||
### Width
|
### Width
|
||||||
|
|
||||||
The initial width of the window.
|
The initial width of the window.
|
||||||
|
|
||||||
Name: Width<br/> Type: `int`<br/> Default: 1024.
|
名前: Width<br/> データ型: `int`<br/> デフォルト値: 1024
|
||||||
|
|
||||||
### Height
|
### Height
|
||||||
|
|
||||||
The initial height of the window.
|
The initial height of the window.
|
||||||
|
|
||||||
Name: Height<br/> Type: `int`<br/> Default: 768
|
名前: Height<br/> データ型: `int`<br/> デフォルト値: 768
|
||||||
|
|
||||||
### DisableResize
|
### DisableResize
|
||||||
|
|
||||||
By default, the main window is resizable. Setting this to `true` will keep it a fixed size.
|
By default, the main window is resizable. Setting this to `true` will keep it a fixed size.
|
||||||
|
|
||||||
Name: DisableResize<br/> Type: `bool`
|
名前: DisableResize<br/> データ型: `bool`
|
||||||
|
|
||||||
### Fullscreen
|
### Fullscreen
|
||||||
|
|
||||||
Setting this to `true` will make the window fullscreen at startup.
|
Setting this to `true` will make the window fullscreen at startup.
|
||||||
|
|
||||||
Name: Fullscreen<br/> Type: `bool`
|
名前: Fullscreen<br/> データ型: `bool`
|
||||||
|
|
||||||
### Frameless
|
### Frameless
|
||||||
|
|
||||||
When set to `true`, the window will have no borders or title bar. Also see [Frameless Windows](../guides/frameless.mdx).
|
When set to `true`, the window will have no borders or title bar. Also see [Frameless Windows](../guides/frameless.mdx).
|
||||||
|
|
||||||
Name: Frameless<br/> Type: `bool`
|
名前: Frameless<br/> データ型: `bool`
|
||||||
|
|
||||||
### MinWidth
|
### MinWidth
|
||||||
|
|
||||||
This sets the minimum width for the window. If the value given in `Width` is less than this value, the window will be set to `MinWidth` by default.
|
This sets the minimum width for the window. If the value given in `Width` is less than this value, the window will be set to `MinWidth` by default.
|
||||||
|
|
||||||
Name: MinWidth<br/> Type: `int`
|
名前: MinWidth<br/> データ型: `int`
|
||||||
|
|
||||||
### MinHeight
|
### MinHeight
|
||||||
|
|
||||||
This sets the minimum height for the window. If the value given in `Height` is less than this value, the window will be set to `MinHeight` by default.
|
This sets the minimum height for the window. If the value given in `Height` is less than this value, the window will be set to `MinHeight` by default.
|
||||||
|
|
||||||
Name: MinHeight<br/> Type: `int`
|
名前: MinHeight<br/> データ型: `int`
|
||||||
|
|
||||||
### MaxWidth
|
### MaxWidth
|
||||||
|
|
||||||
This sets the maximum width for the window. If the value given in `Width` is more than this value, the window will be set to `MaxWidth` by default.
|
This sets the maximum width for the window. If the value given in `Width` is more than this value, the window will be set to `MaxWidth` by default.
|
||||||
|
|
||||||
Name: MaxWidth<br/> Type: `int`
|
名前: MaxWidth<br/> データ型: `int`
|
||||||
|
|
||||||
### MaxHeight
|
### MaxHeight
|
||||||
|
|
||||||
This sets the maximum height for the window. If the value given in `Height` is more than this value, the window will be set to `MaxHeight` by default.
|
This sets the maximum height for the window. If the value given in `Height` is more than this value, the window will be set to `MaxHeight` by default.
|
||||||
|
|
||||||
Name: MaxHeight<br/> Type: `int`
|
名前: MaxHeight<br/> データ型: `int`
|
||||||
|
|
||||||
### StartHidden
|
### StartHidden
|
||||||
|
|
||||||
When set to `true`, the application will be hidden until [WindowShow](../reference/runtime/window.mdx#windowshow) is called.
|
When set to `true`, the application will be hidden until [WindowShow](../reference/runtime/window.mdx#windowshow) is called.
|
||||||
|
|
||||||
Name: StartHidden<br/> Type: `bool`
|
名前: StartHidden<br/> データ型: `bool`
|
||||||
|
|
||||||
### HideWindowOnClose
|
### HideWindowOnClose
|
||||||
|
|
||||||
By default, closing the window will close the application. Setting this to `true` means closing the window will hide the window instead.
|
By default, closing the window will close the application. この設定を`true`にすると、ウィンドウを閉じる操作をした際に、
|
||||||
|
|
||||||
hide the window instead.
|
ウィンドウが非表示の状態になります。
|
||||||
|
|
||||||
Name: HideWindowOnClose<br/> Type: `bool`
|
名前: HideWindowOnClose<br/> データ型: `bool`
|
||||||
|
|
||||||
### BackgroundColour
|
### BackgroundColour
|
||||||
|
|
||||||
This value is the default background colour of the window. Default: white
|
This value is the default background colour of the window. 例: options.NewRGBA(255,0,0,128) - 50%透過された赤色
|
||||||
|
|
||||||
Name: BackgroundColour<br/> Type: `*options.RGBA`<br/> Default: white
|
名前: BackgroundColour<br/> データ型: `*options.RGBA`<br/> デフォルト値: white
|
||||||
|
|
||||||
### AlwaysOnTop
|
### AlwaysOnTop
|
||||||
|
|
||||||
Indicates that the window should stay above other windows when losing focus.
|
Indicates that the window should stay above other windows when losing focus.
|
||||||
|
|
||||||
Name: AlwaysOnTop<br/> Type: `bool`
|
名前: AlwaysOnTop<br/> データ型: `bool`
|
||||||
|
|
||||||
### Assets
|
### Assets
|
||||||
|
|
||||||
The frontend assets to be used by the application. Requires an `index.html` file.
|
The frontend assets to be used by the application. Requires an `index.html` file.
|
||||||
|
|
||||||
Name: Assets<br/> Type: `embed.FS`
|
名前: Assets<br/> データ型: `embed.FS`
|
||||||
|
|
||||||
### AssetsHandler
|
### AssetsHandler
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ Name: Assets<br/> Type: `embed.FS`
|
|||||||
|
|
||||||
The assets handler is a generic `http.Handler` which will be called for any non GET request on the assets server and for GET requests which can not be served from the `assets` because the file is not found.
|
The assets handler is a generic `http.Handler` which will be called for any non GET request on the assets server and for GET requests which can not be served from the `assets` because the file is not found.
|
||||||
|
|
||||||
| Value | Win | Mac | Lin |
|
| 値 | Win | Mac | Lin |
|
||||||
| ----------------------- | --- | --- | --- |
|
| ----------------------- | --- | --- | --- |
|
||||||
| GET | ✅ | ✅ | ✅ |
|
| GET | ✅ | ✅ | ✅ |
|
||||||
| POST | ✅ | ✅ | ❌ |
|
| POST | ✅ | ✅ | ❌ |
|
||||||
@ -214,7 +214,7 @@ NOTE: Linux is currently very limited due to targeting a WebKit2GTK Version < 2.
|
|||||||
|
|
||||||
NOTE: When used in combination with a Frontend DevServer there might be limitations, eg. Vite serves the index.html on every path, that does not contain a file extension.
|
NOTE: When used in combination with a Frontend DevServer there might be limitations, eg. Vite serves the index.html on every path, that does not contain a file extension.
|
||||||
|
|
||||||
Name: AssetsHandler<br/> Type: `http.Handler`
|
名前: AssetsHandler<br/> データ型: `http.Handler`
|
||||||
|
|
||||||
### Menu
|
### Menu
|
||||||
|
|
||||||
@ -223,48 +223,48 @@ The menu to be used by the application. More details about Menus in the [Menu Re
|
|||||||
:::note
|
:::note
|
||||||
|
|
||||||
|
|
||||||
On Mac, if no menu is specified, a default menu will be created.
|
Macでは、メニューが指定されていない場合、デフォルトメニューが作成されます。
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
Name: Menu<br/> Type: `*menu.Menu`
|
名前: Menu<br/> データ型: `*menu.Menu`
|
||||||
|
|
||||||
### Logger
|
### Logger
|
||||||
|
|
||||||
The logger to be used by the application. More details about logging in the [Log Reference](../reference/runtime/log.mdx).
|
The logger to be used by the application. More details about logging in the [Log Reference](../reference/runtime/log.mdx).
|
||||||
|
|
||||||
Name: Logger<br/> Type: `logger.Logger`<br/> Default: Logs to Stdout
|
名前: Logger<br/> データ型: `logger.Logger`<br/> デフォルト値: 標準出力へのロガー
|
||||||
|
|
||||||
### LogLevel
|
### LogLevel
|
||||||
|
|
||||||
The default log level. More details about logging in the [Log Reference](../reference/runtime/log.mdx).
|
The default log level. More details about logging in the [Log Reference](../reference/runtime/log.mdx).
|
||||||
|
|
||||||
Name: LogLevel<br/> Type: `logger.LogLevel`<br/> Default: `Info` in dev mode, `Error` in production mode
|
名前: LogLevel<br/> データ型: `logger.LogLevel`<br/> デフォルト値: 開発モードの場合は`Info`、本番モードの場合は`Error`
|
||||||
|
|
||||||
### LogLevelProduction
|
### LogLevelProduction
|
||||||
|
|
||||||
The default log level for production builds. More details about logging in the [Log Reference](../reference/runtime/log.mdx).
|
The default log level for production builds. More details about logging in the [Log Reference](../reference/runtime/log.mdx).
|
||||||
|
|
||||||
Name: LogLevelProduction<br/> Type: `logger.LogLevel`<br/> Default: `Error`
|
名前: LogLevelProduction<br/> データ型: `logger.LogLevel`<br/> デフォルト値: `Error`
|
||||||
|
|
||||||
### OnStartup
|
### OnStartup
|
||||||
|
|
||||||
This callback is called after the frontend has been created, but before `index.html` has been loaded. It is given the application context.
|
This callback is called after the frontend has been created, but before `index.html` has been loaded. It is given the application context.
|
||||||
|
|
||||||
Name: OnStartup<br/> Type: `func(ctx context.Context)`
|
名前: OnStartup<br/> データ型: `func(ctx context.Context)`
|
||||||
|
|
||||||
### OnDomReady
|
### OnDomReady
|
||||||
|
|
||||||
This callback is called after the frontend has loaded `index.html` and its resources. It is given the application context.
|
This callback is called after the frontend has loaded `index.html` and its resources. It is given the application context.
|
||||||
|
|
||||||
Name: OnDomReady<br/> Type: `func(ctx context.Context)`
|
名前: OnDomReady<br/> データ型: `func(ctx context.Context)`
|
||||||
|
|
||||||
### OnShutdown
|
### OnShutdown
|
||||||
|
|
||||||
This callback is called after the frontend has been destroyed, just before the application terminates. It is given the application context.
|
This callback is called after the frontend has been destroyed, just before the application terminates. It is given the application context.
|
||||||
|
|
||||||
Name: OnShutdown<br/> Type: `func(ctx context.Context)`
|
名前: OnShutdown<br/> データ型: `func(ctx context.Context)`
|
||||||
|
|
||||||
### OnBeforeClose
|
### OnBeforeClose
|
||||||
|
|
||||||
@ -287,99 +287,99 @@ func (b *App) beforeClose(ctx context.Context) (prevent bool) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Name: OnBeforeClose<br/> Type: `func(ctx context.Context) bool`
|
名前: OnBeforeClose<br/> データ型: `func(ctx context.Context) bool`
|
||||||
|
|
||||||
### WindowStartState
|
### WindowStartState
|
||||||
|
|
||||||
Defines how the window should present itself at startup.
|
Defines how the window should present itself at startup.
|
||||||
|
|
||||||
| Value | Win | Mac | Lin |
|
| 値 | Win | Mac | Lin |
|
||||||
| ---------- | --- | --- | --- |
|
| ---------- | --- | --- | --- |
|
||||||
| Fullscreen | ✅ | ✅ | ✅ |
|
| Fullscreen | ✅ | ✅ | ✅ |
|
||||||
| Maximised | ✅ | ✅ | ✅ |
|
| Maximised | ✅ | ✅ | ✅ |
|
||||||
| Minimised | ✅ | ❌ | ✅ |
|
| Minimised | ✅ | ❌ | ✅ |
|
||||||
|
|
||||||
Name: WindowStartState<br/> Type: `options.WindowStartState`
|
名前: WindowStartState<br/> データ型: `options.WindowStartState`
|
||||||
|
|
||||||
### CSSDragProperty
|
### CSSDragProperty
|
||||||
|
|
||||||
Indicates the CSS property to use to identify which elements can be used to drag the window. Default: `--wails-draggable`.
|
ウィンドウをドラッグできる要素を特定するためのCSSプロパティ名を設定します。 デフォルト値: `--wails-draggable`
|
||||||
|
|
||||||
Name: CSSDragProperty<br/> Type: `string`
|
名前: CSSDragProperty<br/> データ型: `string`
|
||||||
|
|
||||||
### CSSDragValue
|
### CSSDragValue
|
||||||
|
|
||||||
Indicates what value the `CSSDragProperty` style should have to drag the window. Default: `drag`.
|
Indicates what value the `CSSDragProperty` style should have to drag the window. デフォルト値: `drag`
|
||||||
|
|
||||||
Name: CSSDragValue<br/> Type: `string`
|
名前: CSSDragValue<br/> データ型: `string`
|
||||||
|
|
||||||
### Bind
|
### Bind
|
||||||
|
|
||||||
A slice of struct instances defining methods that need to be bound to the frontend.
|
A slice of struct instances defining methods that need to be bound to the frontend.
|
||||||
|
|
||||||
Name: Bind<br/> Type: `[]interface{}`
|
名前: Bind<br/> データ型: `[]interface{}`
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
This defines [Windows specific options](#windows).
|
[Windows固有のオプション](#windows)を定義します。
|
||||||
|
|
||||||
Name: Windows<br/> Type: `*windows.Options`
|
名前: Windows<br/> データ型: `*windows.Options`
|
||||||
|
|
||||||
#### WebviewIsTransparent
|
#### WebviewIsTransparent
|
||||||
|
|
||||||
Setting this to `true` will make the webview background transparent when an alpha value of `0` is used. This means that if you use `rgba(0,0,0,0)` for `background-color` in your CSS, the host window will show through. Often combined with [WindowIsTranslucent](#WindowIsTranslucent) to make frosty-looking applications.
|
Setting this to `true` will make the webview background transparent when an alpha value of `0` is used. This means that if you use `rgba(0,0,0,0)` for `background-color` in your CSS, the host window will show through. Often combined with [WindowIsTranslucent](#WindowIsTranslucent) to make frosty-looking applications.
|
||||||
|
|
||||||
Name: WebviewIsTransparent<br/> Type: `bool`
|
名前: WebviewIsTransparent<br/> データ型: `bool`
|
||||||
|
|
||||||
#### WindowIsTranslucent
|
#### WindowIsTranslucent
|
||||||
|
|
||||||
Setting this to `true` will make the window background translucent. Often combined with [WebviewIsTransparent](#WebviewIsTransparent).
|
Setting this to `true` will make the window background translucent. 多くの場合、[WebviewIsTransparent](#WebviewIsTransparent)と組み合わせて使用されます。
|
||||||
|
|
||||||
For Windows 11 versions before build 22621, this will use the [BlurBehind](https://learn.microsoft.com/en-us/windows/win32/dwm/blur-ovw) method for translucency, which can be slow. For Windows 11 versions after build 22621, this will enable the newer translucency types that are much faster. By default, the type of translucency used will be determined by Windows. To configure this, use the [BackdropType](#BackdropType) option.
|
ビルド22621より前のWindows 11の場合、半透明を実現させるために[BlurBehind](https://learn.microsoft.com/ja-jp/windows/win32/dwm/blur-ovw)メソッドを使用するため、処理が遅くなる可能性があります。 ビルド22621以降のWindows 11では、より高速な、新しい半透明タイプが有効になります。 デフォルトで使用される半透明タイプは、Windowsにより決定されます。 このタイプを設定するには、[BackdropType](#BackdropType)オプションを使用してください。
|
||||||
|
|
||||||
Name: WindowIsTranslucent<br/> Type: `bool`
|
名前: WindowIsTranslucent<br/> データ型: `bool`
|
||||||
|
|
||||||
#### BackdropType
|
#### BackdropType
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
|
|
||||||
Requires Windows 11 build 22621 or later.
|
この設定を適用するには、Windows 11 ビルド22621以降が必要です。
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
Sets the translucency type of the window. This is only applicable if [WindowIsTranslucent](#WindowIsTranslucent) is set to `true`.
|
ウィンドウの半透明タイプを設定します。 この設定は、[WindowIsTranslucent](#WindowIsTranslucent)が`true`に設定されている場合にのみ適用されます。
|
||||||
|
|
||||||
Name: BackdropType<br/> Type `windows.BackdropType`
|
名前: BackdropType<br/> データ型: `windows.BackdropType`
|
||||||
|
|
||||||
The value can be one of the following:
|
値は次のいずれかを指定してください:
|
||||||
|
|
||||||
| Value | Description |
|
| 値 | Description |
|
||||||
| ------- | ----------------------------------------------------------------------------------------- |
|
| ------- | ----------------------------------------------------------------------------------- |
|
||||||
| Auto | Let Windows decide which backdrop to use |
|
| Auto | Windowsに背景を決定させる |
|
||||||
| None | Do not use translucency |
|
| None | 半透明にしない |
|
||||||
| Acrylic | Use [Acrylic](https://learn.microsoft.com/en-us/windows/apps/design/style/acrylic) effect |
|
| Acrylic | [アクリル](https://learn.microsoft.com/ja-jp/windows/apps/design/style/acrylic)の効果を使用する |
|
||||||
| Mica | Use [Mica](https://learn.microsoft.com/en-us/windows/apps/design/style/mica) effect |
|
| Mica | [マイカ](https://learn.microsoft.com/ja-jp/windows/apps/design/style/mica)の効果を使用する |
|
||||||
| Tabbed | Use Tabbed. This is a backdrop that is similar to Mica. |
|
| Tabbed | タブを使用する。 これはマイカに似ている背景です。 |
|
||||||
|
|
||||||
#### DisableWindowIcon
|
#### DisableWindowIcon
|
||||||
|
|
||||||
Setting this to `true` will remove the icon in the top left corner of the title bar.
|
Setting this to `true` will remove the icon in the top left corner of the title bar.
|
||||||
|
|
||||||
Name: DisableWindowIcon<br/> Type: `bool`
|
名前: DisableWindowIcon<br/> データ型: `bool`
|
||||||
|
|
||||||
#### DisableFramelessWindowDecorations
|
#### DisableFramelessWindowDecorations
|
||||||
|
|
||||||
Setting this to `true` will remove the window decorations in [Frameless](#Frameless) mode. This means there will be no 'Aero Shadow' and no 'Rounded Corners' shown for the window. Please note that 'Rounded Corners' are only supported on Windows 11.
|
Setting this to `true` will remove the window decorations in [Frameless](#Frameless) mode. This means there will be no 'Aero Shadow' and no 'Rounded Corners' shown for the window. Please note that 'Rounded Corners' are only supported on Windows 11.
|
||||||
|
|
||||||
Name: DisableFramelessWindowDecorations<br/> Type: `bool`
|
名前: DisableFramelessWindowDecorations<br/> データ型: `bool`
|
||||||
|
|
||||||
#### WebviewUserDataPath
|
#### WebviewUserDataPath
|
||||||
|
|
||||||
This defines the path where the WebView2 stores the user data. If empty `%APPDATA%\[BinaryName.exe]` will be used.
|
This defines the path where the WebView2 stores the user data. If empty `%APPDATA%\[BinaryName.exe]` will be used.
|
||||||
|
|
||||||
Name: WebviewUserDataPath<br/> Type: `string`
|
名前: WebviewUserDataPath<br/> データ型: `string`
|
||||||
|
|
||||||
#### WebviewBrowserPath
|
#### WebviewBrowserPath
|
||||||
|
|
||||||
@ -391,7 +391,7 @@ Important information about distribution of fixed version runtime:
|
|||||||
- [Known issues for fixed version](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#known-issues-for-fixed-version)
|
- [Known issues for fixed version](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#known-issues-for-fixed-version)
|
||||||
- [The path of fixed version of the WebView2 Runtime should not contain \Edge\Application\.](https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.1245.22#createcorewebview2environmentwithoptions)
|
- [The path of fixed version of the WebView2 Runtime should not contain \Edge\Application\.](https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.1245.22#createcorewebview2environmentwithoptions)
|
||||||
|
|
||||||
Name: WebviewBrowserPath<br/> Type: `string`
|
名前: WebviewBrowserPath<br/> データ型: `string`
|
||||||
|
|
||||||
#### Theme
|
#### Theme
|
||||||
|
|
||||||
@ -399,29 +399,29 @@ Minimum Windows Version: Windows 10 2004/20H1
|
|||||||
|
|
||||||
This defines the theme that the application should use:
|
This defines the theme that the application should use:
|
||||||
|
|
||||||
| Value | Description |
|
| 値 | Description |
|
||||||
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| SystemDefault | *Default*. The theme will be based on the system default. If the user changes their theme, the application will update to use the new setting |
|
| SystemDefault | _デフォルト値_です。 The theme will be based on the system default. If the user changes their theme, the application will update to use the new setting |
|
||||||
| Dark | The application will use a dark theme exclusively |
|
| Dark | The application will use a dark theme exclusively |
|
||||||
| Light | The application will use a light theme exclusively |
|
| Light | The application will use a light theme exclusively |
|
||||||
|
|
||||||
Name: Theme<br/> Type: `windows.Theme`
|
名前: Theme<br/> データ型: `windows.Theme`
|
||||||
|
|
||||||
#### CustomTheme
|
#### CustomTheme
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
|
|
||||||
Minimum Windows Version: Windows 10/11 2009/21H2 Build 22000
|
サポートされるWindowsの最小バージョン: Windows 10/11 2009/21H2 ビルド22000
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
Allows you to specify custom colours for TitleBar, TitleText and Border for both light and dark mode, as well as when the window is active or inactive.
|
Allows you to specify custom colours for TitleBar, TitleText and Border for both light and dark mode, as well as when the window is active or inactive.
|
||||||
|
|
||||||
Name: CustomTheme<br/> Type: `windows.CustomTheme`
|
名前: CustomTheme<br/> データ型: `windows.CustomTheme`
|
||||||
|
|
||||||
##### CustomTheme type
|
##### CustomTheme 型
|
||||||
|
|
||||||
The CustomTheme struct uses `int32` to specify the colour values. These are in the standard(!) Windows format of: `0x00BBGGAA`. A helper function is provided to do RGB conversions into this format: `windows.RGB(r,g,b uint8)`.
|
The CustomTheme struct uses `int32` to specify the colour values. These are in the standard(!) Windows format of: `0x00BBGGAA`. A helper function is provided to do RGB conversions into this format: `windows.RGB(r,g,b uint8)`.
|
||||||
|
|
||||||
@ -469,7 +469,7 @@ Example:
|
|||||||
|
|
||||||
A struct of strings used by the webview2 installer if a valid webview2 runtime is not found.
|
A struct of strings used by the webview2 installer if a valid webview2 runtime is not found.
|
||||||
|
|
||||||
Name: Messages<br/> Type: `*windows.Messages`
|
名前: Messages<br/> データ型: `*windows.Messages`
|
||||||
|
|
||||||
Customise this for any language you choose to support.
|
Customise this for any language you choose to support.
|
||||||
|
|
||||||
@ -477,31 +477,31 @@ Customise this for any language you choose to support.
|
|||||||
|
|
||||||
ResizeDebounceMS is the amount of time to debounce redraws of webview2 when resizing the window. The default value (0) will perform redraws as fast as it can.
|
ResizeDebounceMS is the amount of time to debounce redraws of webview2 when resizing the window. The default value (0) will perform redraws as fast as it can.
|
||||||
|
|
||||||
Name: ResizeDebounceMS<br/> Type: `uint16`
|
名前: ResizeDebounceMS<br/> データ型: `uint16`
|
||||||
|
|
||||||
#### OnSuspend
|
#### OnSuspend
|
||||||
|
|
||||||
If set, this function will be called when Windows initiates a switch to low power mode (suspend/hibernate)
|
Windowsがローパワーモード(サスペンド/休止状態) に切り替わると呼び出されるコールバックを設定します。
|
||||||
|
|
||||||
Name: OnSuspend<br/> Type: `func()`
|
名前: OnSuspend<br/> データ型: `func()`
|
||||||
|
|
||||||
#### OnResume
|
#### OnResume
|
||||||
|
|
||||||
If set, this function will be called when Windows resumes from low power mode (suspend/hibernate)
|
Windowsがローパワーモード(サスペンド/休止状態) から復帰したときに呼び出されるコールバックを設定します。
|
||||||
|
|
||||||
Name: OnResume<br/> Type: `func()`
|
名前: OnResume<br/> データ型: `func()`
|
||||||
|
|
||||||
### Mac
|
### Mac
|
||||||
|
|
||||||
This defines [Mac specific options](#mac).
|
[Mac固有のオプション](#mac)を定義します。
|
||||||
|
|
||||||
Name: Mac<br/> Type: `*mac.Options`
|
名前: Mac<br/> データ定義: `*mac.Options`
|
||||||
|
|
||||||
#### TitleBar
|
#### TitleBar
|
||||||
|
|
||||||
The TitleBar struct provides the ability to configure the look and feel of the title bar.
|
The TitleBar struct provides the ability to configure the look and feel of the title bar.
|
||||||
|
|
||||||
Name: TitleBar<br/> Type: [`*mac.TitleBar`](#titlebar-struct)
|
名前: TitleBar<br/> データ型: [`*mac.TitleBar`](#titlebar-struct)
|
||||||
|
|
||||||
##### Titlebar struct
|
##### Titlebar struct
|
||||||
|
|
||||||
@ -549,13 +549,13 @@ Click [here](https://github.com/lukakerr/NSWindowStyles) for some inspiration on
|
|||||||
|
|
||||||
Appearance is used to set the style of your app in accordance with Apple's [NSAppearance](https://developer.apple.com/documentation/appkit/nsappearancename?language=objc) names.
|
Appearance is used to set the style of your app in accordance with Apple's [NSAppearance](https://developer.apple.com/documentation/appkit/nsappearancename?language=objc) names.
|
||||||
|
|
||||||
Name: Appearance<br/> Type: [`mac.AppearanceType`](#appearance-type)
|
名前: Appearance<br/> データ型: [`mac.AppearanceType`](#appearance-type)
|
||||||
|
|
||||||
##### Appearance type
|
##### Appearance 型
|
||||||
|
|
||||||
You can specify the application's [appearance](https://developer.apple.com/documentation/appkit/nsappearance?language=objc).
|
You can specify the application's [appearance](https://developer.apple.com/documentation/appkit/nsappearance?language=objc).
|
||||||
|
|
||||||
| Value | Description |
|
| 値 | Description |
|
||||||
| ----------------------------------------------------- | --------------------------------------------------------------- |
|
| ----------------------------------------------------- | --------------------------------------------------------------- |
|
||||||
| DefaultAppearance | DefaultAppearance uses the default system value |
|
| DefaultAppearance | DefaultAppearance uses the default system value |
|
||||||
| NSAppearanceNameAqua | The standard light system appearance |
|
| NSAppearanceNameAqua | The standard light system appearance |
|
||||||
@ -578,19 +578,19 @@ Mac: &mac.Options{
|
|||||||
|
|
||||||
Setting this to `true` will make the webview background transparent when an alpha value of `0` is used. This means that if you use `rgba(0,0,0,0)` for `background-color` in your CSS, the host window will show through. Often combined with [WindowIsTranslucent](#WindowIsTranslucent) to make frosty-looking applications.
|
Setting this to `true` will make the webview background transparent when an alpha value of `0` is used. This means that if you use `rgba(0,0,0,0)` for `background-color` in your CSS, the host window will show through. Often combined with [WindowIsTranslucent](#WindowIsTranslucent) to make frosty-looking applications.
|
||||||
|
|
||||||
Name: WebviewIsTransparent<br/> Type: `bool`
|
名前: WebviewIsTransparent<br/> データ型: `bool`
|
||||||
|
|
||||||
#### WindowIsTranslucent
|
#### WindowIsTranslucent
|
||||||
|
|
||||||
Setting this to `true` will make the window background translucent. Often combined with [WebviewIsTransparent](#WebviewIsTransparent) to make frosty-looking applications.
|
Setting this to `true` will make the window background translucent. Often combined with [WebviewIsTransparent](#WebviewIsTransparent) to make frosty-looking applications.
|
||||||
|
|
||||||
Name: WindowIsTranslucent<br/> Type: `bool`
|
名前: WindowIsTranslucent<br/> データ型: `bool`
|
||||||
|
|
||||||
#### About
|
#### About
|
||||||
|
|
||||||
This configuration lets you set the title, message and icon for the "About" menu item in the app menu created by the "AppMenu" role.
|
This configuration lets you set the title, message and icon for the "About" menu item in the app menu created by the "AppMenu" role.
|
||||||
|
|
||||||
Name: About<br/> Type: [`*mac.AboutInfo`](#about-struct)
|
名前: About<br/> データ型: [`*mac.AboutInfo`](#about-struct)
|
||||||
|
|
||||||
##### About struct
|
##### About struct
|
||||||
|
|
||||||
@ -649,15 +649,15 @@ When clicked, that will open an about message box:
|
|||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
|
||||||
This defines [Linux specific options](#linux).
|
[Linux固有のオプション](#linux)を定義します。
|
||||||
|
|
||||||
Name: Linux<br/> Type: `*linux.Options`
|
名前: Linux<br/> データ型: `*linux.Options`
|
||||||
|
|
||||||
#### Icon
|
#### Icon
|
||||||
|
|
||||||
Sets up the icon representing the window. This icon is used when the window is minimized (also known as iconified).
|
Sets up the icon representing the window. This icon is used when the window is minimized (also known as iconified).
|
||||||
|
|
||||||
Name: Icon<br/> Type: `[]byte`
|
名前: Icon<br/> データ型: `[]byte`
|
||||||
|
|
||||||
Some window managers or desktop environments may also place it in the window frame, or display it in other contexts. On others, the icon is not used at all, so your mileage may vary.
|
Some window managers or desktop environments may also place it in the window frame, or display it in other contexts. On others, the icon is not used at all, so your mileage may vary.
|
||||||
|
|
||||||
|
@ -4,10 +4,10 @@ sidebar_position: 7
|
|||||||
|
|
||||||
# Browser
|
# Browser
|
||||||
|
|
||||||
These methods are related to the system browser.
|
これらは、システムブラウザに関連したメソッドです。
|
||||||
|
|
||||||
### BrowserOpenURL
|
### BrowserOpenURL
|
||||||
|
|
||||||
Opens the given URL in the system browser.
|
指定されたURLをシステムブラウザで開きます。
|
||||||
|
|
||||||
Go: `BrowserOpenURL(ctx context.Context, url string)`<br/> JS: `BrowserOpenURL(url string)`
|
Go: `BrowserOpenURL(ctx context.Context, url string)`<br/> JS: `BrowserOpenURL(url string)`
|
||||||
|
@ -2,59 +2,59 @@
|
|||||||
sidebar_position: 5
|
sidebar_position: 5
|
||||||
---
|
---
|
||||||
|
|
||||||
# Dialog
|
# ダイアログ
|
||||||
|
|
||||||
This part of the runtime provides access to native dialogs, such as File Selectors and Message boxes.
|
ランタイムでは、ファイルセレクターやメッセージボックスといったネイティブダイアログへのアクセスを提供しています。
|
||||||
|
|
||||||
:::info Javascript
|
:::info Javascript
|
||||||
|
|
||||||
|
|
||||||
Dialog is currently unsupported in the JS runtime.
|
現在、Javascriptランタイムではダイアログをサポートしていません。
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
### OpenDirectoryDialog
|
### OpenDirectoryDialog
|
||||||
|
|
||||||
Opens a dialog that prompts the user to select a directory. Can be customised using [OpenDialogOptions](#opendialogoptions).
|
ユーザにディレクトリの選択を求めるダイアログを開きます。 [OpenDialogOptions](#opendialogoptions)を使用してカスタマイズできます。
|
||||||
|
|
||||||
Go: `OpenDirectoryDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error)`
|
Go: `OpenDirectoryDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error)`
|
||||||
|
|
||||||
Returns: Selected directory (blank if the user cancelled) or an error
|
返り値: 選択されたディレクトリ(キャンセルされた場合は空) またはエラー
|
||||||
|
|
||||||
### OpenFileDialog
|
### OpenFileDialog
|
||||||
|
|
||||||
Opens a dialog that prompts the user to select a file. Can be customised using [OpenDialogOptions](#opendialogoptions).
|
ユーザにファイルの選択を求めるダイアログを開きます。 [OpenDialogOptions](#opendialogoptions)を使用してカスタマイズできます。
|
||||||
|
|
||||||
Go: `OpenFileDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error)`
|
Go: `OpenFileDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error)`
|
||||||
|
|
||||||
Returns: Selected file (blank if the user cancelled) or an error
|
返り値: 選択されたファイル(キャンセルされた場合は空) またはエラー
|
||||||
|
|
||||||
### OpenMultipleFilesDialog
|
### OpenMultipleFilesDialog
|
||||||
|
|
||||||
Opens a dialog that prompts the user to select multiple files. Can be customised using [OpenDialogOptions](#opendialogoptions).
|
ユーザに複数ファイルの選択を求めるダイアログを開きます。 [OpenDialogOptions](#opendialogoptions)を使用してカスタマイズできます。
|
||||||
|
|
||||||
Go: `OpenMultipleFilesDialog(ctx context.Context, dialogOptions OpenDialogOptions) ([]string, error)`
|
Go: `OpenMultipleFilesDialog(ctx context.Context, dialogOptions OpenDialogOptions) ([]string, error)`
|
||||||
|
|
||||||
Returns: Selected files (nil if the user cancelled) or an error
|
返り値: 選択された複数ファイル(キャンセルされた場合はnil) またはエラー
|
||||||
|
|
||||||
### SaveFileDialog
|
### SaveFileDialog
|
||||||
|
|
||||||
Opens a dialog that prompts the user to select a filename for the purposes of saving. Can be customised using [SaveDialogOptions](#savedialogoptions).
|
保存の目的でユーザにファイル名を入力選択させるダイアログを開きます。 [SaveDialogOptions](#savedialogoptions)を使用してカスタマイズできます。
|
||||||
|
|
||||||
Go: `SaveFileDialog(ctx context.Context, dialogOptions SaveDialogOptions) (string, error)`
|
Go: `SaveFileDialog(ctx context.Context, dialogOptions SaveDialogOptions) (string, error)`
|
||||||
|
|
||||||
Returns: The selected file (blank if the user cancelled) or an error
|
返り値: 入力選択されたファイル(キャンセルされた場合は空) またはエラー
|
||||||
|
|
||||||
### MessageDialog
|
### MessageDialog
|
||||||
|
|
||||||
Displays a message using a message dialog. Can be customised using [MessageDialogOptions](#messagedialogoptions).
|
メッセージダイアログを使用してメッセージを表示します。 [MessageDialogOptions](#messagedialogoptions)を使用してカスタマイズできます。
|
||||||
|
|
||||||
Go: `MessageDialog(ctx context.Context, dialogOptions MessageDialogOptions) (string, error)`
|
Go: `MessageDialog(ctx context.Context, dialogOptions MessageDialogOptions) (string, error)`
|
||||||
|
|
||||||
Returns: The text of the selected button or an error
|
返り値: 選択されたボタンのテキストまたはエラー
|
||||||
|
|
||||||
## Options
|
## オプション
|
||||||
|
|
||||||
### OpenDialogOptions
|
### OpenDialogOptions
|
||||||
|
|
||||||
@ -71,16 +71,16 @@ type OpenDialogOptions struct {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
| Field | Description | Win | Mac | Lin |
|
| Field | Description | Win | Mac | Lin |
|
||||||
| -------------------------- | ---------------------------------------------- | --- | --- | --- |
|
| -------------------------- | ------------------------- | --- | --- | --- |
|
||||||
| DefaultDirectory | The directory the dialog will show when opened | ✅ | ✅ | ✅ |
|
| DefaultDirectory | ダイアログが開かれたときに初期表示するディレクトリ | ✅ | ✅ | ✅ |
|
||||||
| DefaultFilename | The default filename | ✅ | ✅ | ✅ |
|
| DefaultFilename | デフォルトファイル名 | ✅ | ✅ | ✅ |
|
||||||
| Title | Title for the dialog | ✅ | ✅ | ✅ |
|
| Title | ダイアログのタイトル | ✅ | ✅ | ✅ |
|
||||||
| [Filters](#filefilter) | A list of file filters | ✅ | ✅ | ✅ |
|
| [Filters](#filefilter) | ファイルフィルタのリスト | ✅ | ✅ | ✅ |
|
||||||
| ShowHiddenFiles | Show files hidden by the system | | ✅ | ✅ |
|
| ShowHiddenFiles | システムの隠しファイルを表示 | | ✅ | ✅ |
|
||||||
| CanCreateDirectories | Allow user to create directories | | ✅ | |
|
| CanCreateDirectories | ユーザによるディレクトリの作成を許可する | | ✅ | |
|
||||||
| ResolvesAliases | If true, returns the file not the alias | | ✅ | |
|
| ResolvesAliases | エイリアスではなくファイルパスを返す | | ✅ | |
|
||||||
| TreatPackagesAsDirectories | Allow navigating into packages | | ✅ | |
|
| TreatPackagesAsDirectories | パッケージへのナビゲーションを許可 | | ✅ | |
|
||||||
|
|
||||||
### SaveDialogOptions
|
### SaveDialogOptions
|
||||||
|
|
||||||
@ -96,15 +96,15 @@ type SaveDialogOptions struct {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
| Field | Description | Win | Mac | Lin |
|
| Field | Description | Win | Mac | Lin |
|
||||||
| -------------------------- | ---------------------------------------------- | --- | --- | --- |
|
| -------------------------- | ------------------------- | --- | --- | --- |
|
||||||
| DefaultDirectory | The directory the dialog will show when opened | ✅ | ✅ | ✅ |
|
| DefaultDirectory | ダイアログが開かれたときに初期表示するディレクトリ | ✅ | ✅ | ✅ |
|
||||||
| DefaultFilename | The default filename | ✅ | ✅ | ✅ |
|
| DefaultFilename | デフォルトファイル名 | ✅ | ✅ | ✅ |
|
||||||
| Title | Title for the dialog | ✅ | ✅ | ✅ |
|
| Title | ダイアログのタイトル | ✅ | ✅ | ✅ |
|
||||||
| [Filters](#filefilter) | A list of file filters | ✅ | ✅ | ✅ |
|
| [Filters](#filefilter) | ファイルフィルタのリスト | ✅ | ✅ | ✅ |
|
||||||
| ShowHiddenFiles | Show files hidden by the system | | ✅ | ✅ |
|
| ShowHiddenFiles | システムの隠しファイルを表示 | | ✅ | ✅ |
|
||||||
| CanCreateDirectories | Allow user to create directories | | ✅ | |
|
| CanCreateDirectories | ユーザによるディレクトリの作成を許可する | | ✅ | |
|
||||||
| TreatPackagesAsDirectories | Allow navigating into packages | | ✅ | |
|
| TreatPackagesAsDirectories | パッケージへのナビゲーションを許可 | | ✅ | |
|
||||||
|
|
||||||
### MessageDialogOptions
|
### MessageDialogOptions
|
||||||
|
|
||||||
@ -119,18 +119,30 @@ type MessageDialogOptions struct {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
| Field | Description | Win | Mac | Lin |
|
| Field | Description | Win | Mac | Lin |
|
||||||
| ------------- | ------------------------------------------------------------------------- | --- | --- | --- |
|
| ------------- | ------------------------------------------------- | -------------- | --- | --- |
|
||||||
| Type | The type of message dialog, eg question, info... | ✅ | ✅ | ✅ |
|
| Type | メッセージダイアログの種類 (質問、情報など) | ✅ | ✅ | ✅ |
|
||||||
| Title | Title for the dialog | ✅ | ✅ | ✅ |
|
| Title | ダイアログのタイトル | ✅ | ✅ | ✅ |
|
||||||
| Message | The message to show the user | ✅ | ✅ | ✅ |
|
| Message | ユーザに表示するメッセージ | ✅ | ✅ | ✅ |
|
||||||
| Buttons | A list of button titles | | ✅ | |
|
| Buttons | ボタンテキストのリスト | | ✅ | |
|
||||||
| DefaultButton | The button with this text should be treated as default. Bound to `return` | | ✅ | |
|
| DefaultButton | 指定されたテキストのボタンをデフォルトボタンとして扱う。 Bound to `return`. | ✅[*](#windows) | ✅ | |
|
||||||
| CancelButton | The button with this text should be treated as cancel. Bound to `escape` | | ✅ | |
|
| CancelButton | 指定されたテキストのボタンをキャンセルボタンとして扱う。 `escape`キーにバインドされます。 | | ✅ | |
|
||||||
|
|
||||||
#### Windows
|
#### Windows
|
||||||
|
|
||||||
Windows has standard dialog types in which the buttons are not customisable. The value returned will be one of: "Ok", "Cancel", "Abort", "Retry", "Ignore", "Yes", "No", "Try Again" or "Continue"
|
Windowsでは、ボタンのカスタマイズができない標準ダイアログタイプがあります。 The value returned will be one of: "Ok", "Cancel", "Abort", "Retry", "Ignore", "Yes", "No", "Try Again" or "Continue".
|
||||||
|
|
||||||
|
For Question dialogs, the default button is "Yes" and the cancel button is "No". This can be changed by setting the `DefaultButton` value to `"No"`.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```go
|
||||||
|
result, err := runtime.MessageDialog(a.ctx, runtime.MessageDialogOptions{
|
||||||
|
Type: runtime.QuestionDialog,
|
||||||
|
Title: "Question",
|
||||||
|
Message: "Do you want to continue?",
|
||||||
|
DefaultButton: "No",
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
#### Linux
|
#### Linux
|
||||||
|
|
||||||
@ -150,7 +162,7 @@ selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
the first button is shown as default:
|
1番目のボタンがデフォルトになります:
|
||||||
|
|
||||||
```mdx-code-block
|
```mdx-code-block
|
||||||
<div class="text--center">
|
<div class="text--center">
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
sidebar_position: 2
|
sidebar_position: 2
|
||||||
---
|
---
|
||||||
|
|
||||||
# Events
|
# イベント
|
||||||
|
|
||||||
The Wails runtime provides a unified events system, where events can be emitted or received by either Go or Javascript. Optionally, data may be passed with the events. Listeners will receive the data in the local data types.
|
Wailsでは、GoまたはJavascriptによって発行および受信できる、一元化されたイベントシステムが用意されています。 必要に応じて、イベント発行時にデータを渡すことも可能です。 イベントリスナーは、そのデータをローカルデータ型で受け取ります。
|
||||||
|
|
||||||
### EventsOn
|
### EventsOn
|
||||||
|
|
||||||
This method sets up a listener for the given event name. When an event of type `eventName` is [emitted](#EventsEmit), the callback is triggered. Any additional data sent with the emitted event will be passed to the callback.
|
このメソッドは、指定されたイベント名のイベントリスナーを新たに設定します。 `eventName`という名前のイベントが[発行](#EventsEmit)されると、コールバックがトリガーされます。 イベント発行時にデータも付与されていた場合、そのデータはコールバックに渡されます。
|
||||||
|
|
||||||
Go: `EventsOn(ctx context.Context, eventName string, callback func(optionalData ...interface{}))`<br/> JS: `EventsOn(eventName string, callback function(optionalData?: any))`
|
Go: `EventsOn(ctx context.Context, eventName string, callback func(optionalData ...interface{}))`<br/> JS: `EventsOn(eventName string, callback function(optionalData?: any))`
|
||||||
|
|
||||||
@ -20,18 +20,18 @@ Go: `EventsOff(ctx context.Context, eventName string, additionalEventNames ...st
|
|||||||
|
|
||||||
### EventsOnce
|
### EventsOnce
|
||||||
|
|
||||||
This method sets up a listener for the given event name, but will only trigger once.
|
このメソッドは、指定されたイベント名のイベントリスナーを新たに設定し、一度だけトリガーさせます。
|
||||||
|
|
||||||
Go: `EventsOnce(ctx context.Context, eventName string, callback func(optionalData ...interface{}))`<br/> JS: `EventsOnce(eventName string, callback function(optionalData?: any))`
|
Go: `EventsOnce(ctx context.Context, eventName string, callback func(optionalData ...interface{}))`<br/> JS: `EventsOnce(eventName string, callback function(optionalData?: any))`
|
||||||
|
|
||||||
### EventsOnMultiple
|
### EventsOnMultiple
|
||||||
|
|
||||||
This method sets up a listener for the given event name, but will only trigger a maximum of `counter` times.
|
このメソッドは、指定されたイベント名のイベントリスナーを新たに設定し、最大`counter`回だけトリガーします。
|
||||||
|
|
||||||
Go: `EventsOnMultiple(ctx context.Context, eventName string, callback func(optionalData ...interface{}), counter int)`<br/> JS: `EventsOnMultiple(eventName string, callback function(optionalData?: any), counter int)`
|
Go: `EventsOnMultiple(ctx context.Context, eventName string, callback func(optionalData ...interface{}), counter int)`<br/> JS: `EventsOnMultiple(eventName string, callback function(optionalData?: any), counter int)`
|
||||||
|
|
||||||
### EventsEmit
|
### EventsEmit
|
||||||
|
|
||||||
This method emits the given event. Optional data may be passed with the event. This will trigger any event listeners.
|
このメソッドは、指定されたイベントを発行します。 必要に応じて、イベント発行時にデータを渡すこともできます。 このメソッドによって、任意のイベントリスナーをトリガーさせることができます。
|
||||||
|
|
||||||
Go: `EventsEmit(ctx context.Context, eventName string, optionalData ...interface{})`<br/> JS: `EventsEmit(ctx context, optionalData function(optionalData?: any))`
|
Go: `EventsEmit(ctx context.Context, eventName string, optionalData ...interface{})`<br/> JS: `EventsEmit(ctx context, optionalData function(optionalData?: any))`
|
||||||
|
@ -2,68 +2,68 @@
|
|||||||
sidebar_position: 1
|
sidebar_position: 1
|
||||||
---
|
---
|
||||||
|
|
||||||
# Introduction
|
# イントロダクション
|
||||||
|
|
||||||
The runtime is a library that provides utility methods for your application. There is both a Go and Javascript runtime and the aim is to try and keep them at parity where possible.
|
ランタイムは、アプリケーションにユーティリティメソッドを提供するライブラリです。 GoとJavascriptの両方にランタイムがあり、どちらにもほぼ同じメソッドが提供されています。
|
||||||
|
|
||||||
ユーティリティメソッドには次のようなものがあります:
|
ユーティリティメソッドには次のようなものがあります:
|
||||||
|
|
||||||
- [Window](window.mdx)
|
- [ウィンドウ](window.mdx)
|
||||||
- [Menu](menu.mdx)
|
- [Menu](menu.mdx)
|
||||||
- [Dialog](dialog.mdx)
|
- [ダイアログ](dialog.mdx)
|
||||||
- [Events](events.mdx)
|
- [イベント](events.mdx)
|
||||||
- [Browser](browser.mdx)
|
- [Browser](browser.mdx)
|
||||||
- [Log](log.mdx)
|
- [ログ](log.mdx)
|
||||||
|
|
||||||
The Go Runtime is available through importing `github.com/wailsapp/wails/v2/pkg/runtime`. All methods in this package take a context as the first parameter. This context should be obtained from the [OnStartup](../options.mdx#onstartup) or [OnDomReady](../options.mdx#ondomready) hooks.
|
Goのランタイムは、`github.com/wailsapp/wails/v2/pkg/runtime`をインポートすることで利用できます。 このパッケージのすべてのメソッドは、1番目の引数でContextを渡す必要があります。 このContextは、[OnStartup](../options.mdx#onstartup)フック、または[OnDomReady](../options.mdx#ondomready)フックからあらかじめ取得しておいてください。
|
||||||
|
|
||||||
:::info Note
|
:::info 備考
|
||||||
|
|
||||||
|
|
||||||
Whilst the context will be provided to the [OnStartup](../options.mdx#onstartup) method, there's no guarantee the runtime will work in this method as the window is initialising in a different thread. If you wish to call runtime methods at startup, use [OnDomReady](../options.mdx#ondomready).
|
[OnStartup](../options.mdx#onstartup)で提供されるContextは、ウィンドウが別のスレッドで初期化されているため、ランタイムが機能する保証がありません。 起動時にランタイムメソッドを呼び出したい場合は、[OnDomReady](../options.mdx#ondomready)を使用してください。
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
The Javascript library is available to the frontend via the `window.runtime` map. There is a runtime package generated when using `dev` mode that provides Typescript declarations for the runtime. This should be located in the `wailsjs` directory in your frontend directory.
|
Javascriptのランタイムは、`window.runtime`マップを介してフロントエンド上で利用できます。 `dev`モードでは、Typescript型定義を提供するランタイムパッケージが生成されます。 これらは、フロントエンドディレクトリの`wailsjs`ディレクトリに配置しておく必要があります。
|
||||||
|
|
||||||
### Hide
|
### 非表示
|
||||||
|
|
||||||
Go: `Hide(ctx context.Context)`<br/> JS: `Hide()`
|
Go: `Hide(ctx context.Context)`<br/> JS: `Hide()`
|
||||||
|
|
||||||
Hides the application.
|
アプリケーションを非表示にします。
|
||||||
|
|
||||||
:::info Note
|
:::info 備考
|
||||||
|
|
||||||
|
|
||||||
Macでこのメソッドを使用すると、標準のMacアプリケーションにおけるメニュー項目の`Hide`と同じ方法で、アプリケーションが非表示になります。 This is different to hiding the window, but the application still being in the foreground. For Windows and Linux, this is currently the same as `WindowHide`.
|
Macでこのメソッドを使用すると、標準のMacアプリケーションにおけるメニュー項目の`Hide`と同じ方法で、アプリケーションが非表示になります。 これはウィンドウの非表示とは異なりますが、アプリケーションはフォアグラウンドに残ったままになります。 WindowsおよびLinuxでは、`WindowHide`メソッドと同等です。
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
### Show
|
### 表示
|
||||||
|
|
||||||
Shows the application.
|
アプリケーションを表示します。
|
||||||
|
|
||||||
:::info Note
|
:::info 備考
|
||||||
|
|
||||||
|
|
||||||
Macでこのメソッドを使用すると、アプリケーションがフォアグラウンドに戻ります。 For Windows and Linux, this is currently the same as `WindowShow`.
|
Macでこのメソッドを使用すると、アプリケーションがフォアグラウンドに戻ります。 WindowsおよびLinuxでは、`WindowShow`メソッドと同等です。
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
Go: `Show(ctx context.Context)`<br/> JS: `Show()`
|
Go: `Show(ctx context.Context)`<br/> JS: `Show()`
|
||||||
|
|
||||||
### Quit
|
### 終了
|
||||||
|
|
||||||
Quits the application.
|
アプリケーションを終了します。
|
||||||
|
|
||||||
Go: `Quit(ctx context.Context)`<br/> JS: `Quit()`
|
Go: `Quit(ctx context.Context)`<br/> JS: `Quit()`
|
||||||
|
|
||||||
### Environment
|
### 環境
|
||||||
|
|
||||||
Returns details of the current environment.
|
現在の環境の詳細情報を取得します。
|
||||||
|
|
||||||
Go: `Environment(ctx context.Context) EnvironmentInfo`<br/> JS: `Environment(): Promise<EnvironmentInfo>`
|
Go: `Environment(ctx context.Context) EnvironmentInfo`<br/> JS: `Environment(): Promise<EnvironmentInfo>`
|
||||||
|
|
||||||
|
@ -2,120 +2,120 @@
|
|||||||
sidebar_position: 3
|
sidebar_position: 3
|
||||||
---
|
---
|
||||||
|
|
||||||
# Log
|
# ログ
|
||||||
|
|
||||||
The Wails runtime provides a logging mechanism that may be called from Go or Javascript. Like most loggers, there are a number of log levels:
|
Wailsでは、GoまたはJavascriptから呼び出すことのできるロギングメカニズムを用意しています。 一般的なロガーと同じように、ログにはいくつかのログレベルがあります:
|
||||||
|
|
||||||
- Trace
|
- トレース
|
||||||
- Debug
|
- デバッグ
|
||||||
- Info
|
- 情報
|
||||||
- Warning
|
- 警告
|
||||||
- Error
|
- Error
|
||||||
- Fatal
|
- 致命的
|
||||||
|
|
||||||
The logger will output any log message at the current, or higher, log level. Example: The `Debug` log level will output all messages except `Trace` messages.
|
ロガーは、設定されている出力ログレベル以上のログメッセージを出力します。 例えば、出力ログレベルを`Debug`に設定した場合、`Trace`以外のすべてのレベルのメッセージが出力されます。
|
||||||
|
|
||||||
### LogPrint
|
### LogPrint
|
||||||
|
|
||||||
Logs the given message as a raw message.
|
指定されたメッセージをRawメッセージとしてロギングします。
|
||||||
|
|
||||||
Go: `LogPrint(ctx context.Context, message string)`<br/> JS: `LogPrint(message: string)`
|
Go: `LogPrint(ctx context.Context, message string)`<br/> JS: `LogPrint(message: string)`
|
||||||
|
|
||||||
### LogPrintf
|
### LogPrintf
|
||||||
|
|
||||||
Logs the given message as a raw message.
|
指定されたメッセージをRawメッセージとしてロギングします。
|
||||||
|
|
||||||
Go: `LogPrintf(ctx context.Context, format string, args ...interface{})`<br/>
|
Go: `LogPrintf(ctx context.Context, format string, args ...interface{})`<br/>
|
||||||
|
|
||||||
### LogTrace
|
### LogTrace
|
||||||
|
|
||||||
Logs the given message at the `Trace` log level.
|
指定されたメッセージを`Trace`ログレベルでロギングします。
|
||||||
|
|
||||||
Go: `LogTrace(ctx context.Context, message string)`<br/> JS: `LogTrace(message: string)`
|
Go: `LogTrace(ctx context.Context, message string)`<br/> JS: `LogTrace(message: string)`
|
||||||
|
|
||||||
### LogTracef
|
### LogTracef
|
||||||
|
|
||||||
Logs the given message at the `Trace` log level.
|
指定されたメッセージを`Trace`ログレベルでロギングします。
|
||||||
|
|
||||||
Go: `LogTracef(ctx context.Context, format string, args ...interface{})`<br/>
|
Go: `LogTracef(ctx context.Context, format string, args ...interface{})`<br/>
|
||||||
|
|
||||||
### LogDebug
|
### LogDebug
|
||||||
|
|
||||||
Logs the given message at the `Debug` log level.
|
指定されたメッセージを`Debug`ログレベルでロギングします。
|
||||||
|
|
||||||
Go: `LogDebug(ctx context.Context, message string)`<br/> JS: `LogDebug(message: string)`
|
Go: `LogDebug(ctx context.Context, message string)`<br/> JS: `LogDebug(message: string)`
|
||||||
|
|
||||||
### LogDebugf
|
### LogDebugf
|
||||||
|
|
||||||
Logs the given message at the `Debug` log level.
|
指定されたメッセージを`Debug`ログレベルでロギングします。
|
||||||
|
|
||||||
Go: `LogDebugf(ctx context.Context, format string, args ...interface{})`<br/>
|
Go: `LogDebugf(ctx context.Context, format string, args ...interface{})`<br/>
|
||||||
|
|
||||||
### LogInfo
|
### LogInfo
|
||||||
|
|
||||||
Logs the given message at the `Info` log level.
|
指定されたメッセージを`Info`ログレベルでロギングします。
|
||||||
|
|
||||||
Go: `LogInfo(ctx context.Context, message string)`<br/> JS: `LogInfo(message: string)`
|
Go: `LogInfo(ctx context.Context, message string)`<br/> JS: `LogInfo(message: string)`
|
||||||
|
|
||||||
### LogInfof
|
### LogInfof
|
||||||
|
|
||||||
Logs the given message at the `Info` log level.
|
指定されたメッセージを`Info`ログレベルでロギングします。
|
||||||
|
|
||||||
Go: `LogInfof(ctx context.Context, format string, args ...interface{})`<br/>
|
Go: `LogInfof(ctx context.Context, format string, args ...interface{})`<br/>
|
||||||
|
|
||||||
### LogWarning
|
### LogWarning
|
||||||
|
|
||||||
Logs the given message at the `Warning` log level.
|
指定されたメッセージを`Warning`ログレベルでロギングします。
|
||||||
|
|
||||||
Go: `LogWarning(ctx context.Context, message string)`<br/> JS: `LogWarning(message: string)`
|
Go: `LogWarning(ctx context.Context, message string)`<br/> JS: `LogWarning(message: string)`
|
||||||
|
|
||||||
### LogWarningf
|
### LogWarningf
|
||||||
|
|
||||||
Logs the given message at the `Warning` log level.
|
指定されたメッセージを`Warning`ログレベルでロギングします。
|
||||||
|
|
||||||
Go: `LogWarningf(ctx context.Context, format string, args ...interface{})`<br/>
|
Go: `LogWarningf(ctx context.Context, format string, args ...interface{})`<br/>
|
||||||
|
|
||||||
### LogError
|
### LogError
|
||||||
|
|
||||||
Logs the given message at the `Error` log level.
|
指定されたメッセージを`Error`ログレベルでロギングします。
|
||||||
|
|
||||||
Go: `LogError(ctx context.Context, message string)`<br/> JS: `LogError(message: string)`
|
Go: `LogError(ctx context.Context, message string)`<br/> JS: `LogError(message: string)`
|
||||||
|
|
||||||
### LogErrorf
|
### LogErrorf
|
||||||
|
|
||||||
Logs the given message at the `Error` log level.
|
指定されたメッセージを`Error`ログレベルでロギングします。
|
||||||
|
|
||||||
Go: `LogErrorf(ctx context.Context, format string, args ...interface{})`<br/>
|
Go: `LogErrorf(ctx context.Context, format string, args ...interface{})`<br/>
|
||||||
|
|
||||||
### LogFatal
|
### LogFatal
|
||||||
|
|
||||||
Logs the given message at the `Fatal` log level.
|
指定されたメッセージを`Fatal`ログレベルでロギングします。
|
||||||
|
|
||||||
Go: `LogFatal(ctx context.Context, message string)`<br/> JS: `LogFatal(message: string)`
|
Go: `LogFatal(ctx context.Context, message string)`<br/> JS: `LogFatal(message: string)`
|
||||||
|
|
||||||
### LogFatalf
|
### LogFatalf
|
||||||
|
|
||||||
Logs the given message at the `Fatal` log level.
|
指定されたメッセージを`Fatal`ログレベルでロギングします。
|
||||||
|
|
||||||
Go: `LogFatalf(ctx context.Context, format string, args ...interface{})`<br/>
|
Go: `LogFatalf(ctx context.Context, format string, args ...interface{})`<br/>
|
||||||
|
|
||||||
### LogSetLogLevel
|
### LogSetLogLevel
|
||||||
|
|
||||||
Sets the log level. In Javascript, the number relates to the following log levels:
|
出力ログレベルを設定します。 Javascriptでは、数値が次のログレベルに対応しています:
|
||||||
|
|
||||||
| Value | Log Level |
|
| 値 | ログレベル |
|
||||||
| ----- | --------- |
|
| - | ----- |
|
||||||
| 1 | Trace |
|
| 1 | トレース |
|
||||||
| 2 | Debug |
|
| 2 | デバッグ |
|
||||||
| 3 | Info |
|
| 3 | 情報 |
|
||||||
| 4 | Warning |
|
| 4 | 警告 |
|
||||||
| 5 | Error |
|
| 5 | Error |
|
||||||
|
|
||||||
Go: `LogSetLogLevel(ctx context.Context, level logger.LogLevel)`<br/> JS: `LogSetLogLevel(level: number)`
|
Go: `LogSetLogLevel(ctx context.Context, level logger.LogLevel)`<br/> JS: `LogSetLogLevel(level: number)`
|
||||||
|
|
||||||
## Using a Custom Logger
|
## カスタムロガーの使用
|
||||||
|
|
||||||
A custom logger may be used by providing it using the [Logger](../options.mdx#logger) application option. The only requirement is that the logger implements the `logger.Logger` interface defined in `github.com/wailsapp/wails/v2/pkg/logger`:
|
カスタムロガーは、アプリケーションオプションの1つである[Logger](../options.mdx#logger)で指定してあげることで、使用することができます。 カスタムロガーを使用する際の唯一の要件は、`github.com/wailsapp/wails/v2/pkg/logger`で定義されている`logger.Logger`インターフェースを、ロガーに実装することです:
|
||||||
|
|
||||||
```go title="logger.go"
|
```go title="logger.go"
|
||||||
type Logger interface {
|
type Logger interface {
|
||||||
|
@ -4,24 +4,24 @@ sidebar_position: 6
|
|||||||
|
|
||||||
# Menu
|
# Menu
|
||||||
|
|
||||||
These methods are related to the application menu.
|
これらは、アプリケーションメニューに関連したメソッドです。
|
||||||
|
|
||||||
:::info Javascript
|
:::info Javascript
|
||||||
|
|
||||||
|
|
||||||
Menu is currently unsupported in the JS runtime.
|
現在、Javascriptランタイムではメニューをサポートしていません。
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
### MenuSetApplicationMenu
|
### MenuSetApplicationMenu
|
||||||
|
|
||||||
Sets the application menu to the given [menu](../menus.mdx).
|
指定された[menu](../menus.mdx)をアプリケーションメニューとして設定します。
|
||||||
|
|
||||||
Go: `MenuSetApplicationMenu(ctx context.Context, menu *menu.Menu)`
|
Go: `MenuSetApplicationMenu(ctx context.Context, menu *menu.Menu)`
|
||||||
|
|
||||||
### MenuUpdateApplicationMenu
|
### MenuUpdateApplicationMenu
|
||||||
|
|
||||||
Updates the application menu, picking up any changes to the menu passed to `MenuSetApplicationMenu`.
|
`MenuSetApplicationMenu`に渡されたメニューへの変更を検知し、アプリケーションメニューを更新します。
|
||||||
|
|
||||||
Go: `MenuUpdateApplicationMenu(ctx context.Context)`
|
Go: `MenuUpdateApplicationMenu(ctx context.Context)`
|
||||||
|
@ -2,199 +2,199 @@
|
|||||||
sidebar_position: 4
|
sidebar_position: 4
|
||||||
---
|
---
|
||||||
|
|
||||||
# Window
|
# ウィンドウ
|
||||||
|
|
||||||
These methods give control of the application window.
|
アプリケーションウィンドウを制御できるメソッド群です。
|
||||||
|
|
||||||
### WindowSetTitle
|
### WindowSetTitle
|
||||||
|
|
||||||
Sets the text in the window title bar.
|
ウィンドウのタイトルバーにテキストを設定します。
|
||||||
|
|
||||||
Go: `WindowSetTitle(ctx context.Context, title string)`<br/> JS: `WindowSetTitle(title: string)`
|
Go: `WindowSetTitle(ctx context.Context, title string)`<br/> JS: `WindowSetTitle(title: string)`
|
||||||
|
|
||||||
### WindowFullscreen
|
### WindowFullscreen
|
||||||
|
|
||||||
Makes the window full screen.
|
ウィンドウをフルスクリーンにします。
|
||||||
|
|
||||||
Go: `WindowFullscreen(ctx context.Context)`<br/> JS: `WindowFullscreen()`
|
Go: `WindowFullscreen(ctx context.Context)`<br/> JS: `WindowFullscreen()`
|
||||||
|
|
||||||
### WindowUnfullscreen
|
### WindowUnfullscreen
|
||||||
|
|
||||||
Restores the previous window dimensions and position prior to full screen.
|
フルスクリーンにする前のウィンドウサイズおよび位置に戻します。
|
||||||
|
|
||||||
Go: `WindowUnfullscreen(ctx context.Context)`<br/> JS: `WindowUnfullscreen()`
|
Go: `WindowUnfullscreen(ctx context.Context)`<br/> JS: `WindowUnfullscreen()`
|
||||||
|
|
||||||
### WindowIsFullscreen
|
### WindowIsFullscreen
|
||||||
|
|
||||||
Returns true if the window is full screen.
|
ウィンドウがフルスクリーンの場合は、trueを返します。
|
||||||
|
|
||||||
Go: `WindowIsFullscreen(ctx context.Context) bool`<br/> JS: `WindowIsFullscreen() bool`
|
Go: `WindowIsFullscreen(ctx context.Context) bool`<br/> JS: `WindowIsFullscreen() bool`
|
||||||
|
|
||||||
### WindowCenter
|
### WindowCenter
|
||||||
|
|
||||||
Centers the window on the monitor the window is currently on.
|
ウィンドウが現在表示されているモニターの中央に、ウィンドウを配置させます。
|
||||||
|
|
||||||
Go: `WindowReload(ctx context.Context)`<br/> JS: `WindowReload()`
|
Go: `WindowReload(ctx context.Context)`<br/> JS: `WindowReload()`
|
||||||
|
|
||||||
### WindowReload
|
### WindowReload
|
||||||
|
|
||||||
Performs a "reload" (Reloads current page).
|
リロードします。(現在表示されているページをリロード)
|
||||||
|
|
||||||
Go: `WindowReloadApp(ctx context.Context)`<br/> JS: `WindowReloadApp()`
|
Go: `WindowReloadApp(ctx context.Context)`<br/> JS: `WindowReloadApp()`
|
||||||
|
|
||||||
### WindowReloadApp
|
### WindowReloadApp
|
||||||
|
|
||||||
Reloads the application frontend.
|
アプリケーションフロントエンドをリロードします。
|
||||||
|
|
||||||
Go: `WindowSetSystemDefaultTheme(ctx context.Context)`<br/> JS: `WindowSetSystemDefaultTheme()`
|
Go: `WindowSetSystemDefaultTheme(ctx context.Context)`<br/> JS: `WindowSetSystemDefaultTheme()`
|
||||||
|
|
||||||
### WindowSetSystemDefaultTheme
|
### WindowSetSystemDefaultTheme
|
||||||
|
|
||||||
Windows only.
|
Windowsのみ使用可能。
|
||||||
|
|
||||||
Go: `WindowSetDarkTheme(ctx context.Context)`<br/> JS: `WindowSetDarkTheme()`
|
Go: `WindowSetDarkTheme(ctx context.Context)`<br/> JS: `WindowSetDarkTheme()`
|
||||||
|
|
||||||
Sets window theme to system default (dark/light).
|
ウィンドウのテーマをシステムデフォルト(ダーク/ライト) に設定します。
|
||||||
|
|
||||||
### WindowSetLightTheme
|
### WindowSetLightTheme
|
||||||
|
|
||||||
Windows only.
|
Windowsのみ使用可能。
|
||||||
|
|
||||||
Go: `WindowSetLightTheme(ctx context.Context)`<br/> JS: `WindowSetLightTheme()`
|
Go: `WindowSetLightTheme(ctx context.Context)`<br/> JS: `WindowSetLightTheme()`
|
||||||
|
|
||||||
Sets window theme to light.
|
ウィンドウのテーマをライトに設定します。
|
||||||
|
|
||||||
### WindowSetDarkTheme
|
### WindowSetDarkTheme
|
||||||
|
|
||||||
Windows only.
|
Windowsのみ使用可能。
|
||||||
|
|
||||||
Go: `WindowShow(ctx context.Context)`<br/> JS: `WindowShow()`
|
Go: `WindowShow(ctx context.Context)`<br/> JS: `WindowShow()`
|
||||||
|
|
||||||
Sets window theme to dark.
|
ウィンドウのテーマをダークに設定します。
|
||||||
|
|
||||||
### WindowShow
|
### WindowShow
|
||||||
|
|
||||||
Shows the window, if it is currently hidden.
|
ウィンドウが非表示になっている場合は、表示させます。
|
||||||
|
|
||||||
Go: `WindowHide(ctx context.Context)`<br/> JS: `WindowHide()`
|
Go: `WindowHide(ctx context.Context)`<br/> JS: `WindowHide()`
|
||||||
|
|
||||||
### WindowHide
|
### WindowHide
|
||||||
|
|
||||||
Hides the window, if it is currently visible.
|
現在表示されているウィンドウを非表示にします。
|
||||||
|
|
||||||
Go: `WindowSetSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetSize(size: Size)`
|
Go: `WindowSetSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetSize(size: Size)`
|
||||||
|
|
||||||
### WindowIsNormal
|
### WindowIsNormal
|
||||||
|
|
||||||
Returns true if the window not minimised, maximised or fullscreen.
|
ウィンドウが最小化、最大化、またはフルスクリーンになっていない場合、trueを返します。
|
||||||
|
|
||||||
Go: `WindowIsNormal(ctx context.Context) bool`<br/> JS: `WindowIsNormal() bool`
|
Go: `WindowIsNormal(ctx context.Context) bool`<br/> JS: `WindowIsNormal() bool`
|
||||||
|
|
||||||
### WindowSetSize
|
### WindowSetSize
|
||||||
|
|
||||||
Sets the width and height of the window.
|
ウィンドウの幅と高さを設定します。
|
||||||
|
|
||||||
Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetMaxSize(size: Size)`
|
Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetMaxSize(size: Size)`
|
||||||
|
|
||||||
### WindowGetSize
|
### WindowGetSize
|
||||||
|
|
||||||
Gets the width and height of the window.
|
ウィンドウの幅と高さを取得します。
|
||||||
|
|
||||||
Go: `WindowSetMinSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetMinSize(size: Size)`
|
Go: `WindowGetSize(ctx context.Context) (width int, height int)`<br/> JS: `WindowGetSize() : Size`
|
||||||
|
|
||||||
### WindowSetMinSize
|
### WindowSetMinSize
|
||||||
|
|
||||||
Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions.
|
ウィンドウの最小サイズを設定します。 現在のウィンドウサイズが、指定された最小サイズよりも小さい場合、現在のウィンドウサイズは変更されます。
|
||||||
|
|
||||||
Setting a size of `0,0` will disable this constraint.
|
サイズを`0,0`に設定すると、サイズの制約が無効化されます。
|
||||||
|
|
||||||
Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`<br/> JS: `WindowSetAlwaysOnTop(b: Boolen)`
|
Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`<br/> JS: `WindowSetAlwaysOnTop(b: Boolen)`
|
||||||
|
|
||||||
### WindowSetMaxSize
|
### WindowSetMaxSize
|
||||||
|
|
||||||
Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions.
|
ウィンドウの最大サイズを設定します。 現在のウィンドウサイズが、指定された最大サイズよりも大きい場合、現在のウィンドウサイズは変更されます。
|
||||||
|
|
||||||
Setting a size of `0,0` will disable this constraint.
|
サイズを`0,0`に設定すると、サイズの制約が無効化されます。
|
||||||
|
|
||||||
Go: `WindowSetPosition(ctx context.Context, x int, y int)`<br/> JS: `WindowSetPosition(position: Position)`
|
Go: `WindowSetPosition(ctx context.Context, x int, y int)`<br/> JS: `WindowSetPosition(position: Position)`
|
||||||
|
|
||||||
### WindowSetAlwaysOnTop
|
### WindowSetAlwaysOnTop
|
||||||
|
|
||||||
Sets the window AlwaysOnTop or not on top.
|
ウィンドウを常に最前面に表示するかを切り替えます。
|
||||||
|
|
||||||
Go: `WindowGetPosition(ctx context.Context) (x int, y int)`<br/> JS: `WindowGetPosition() : Position`
|
Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`<br/> JS: `WindowSetAlwaysOnTop(b: Boolen)`
|
||||||
|
|
||||||
### WindowSetPosition
|
### WindowSetPosition
|
||||||
|
|
||||||
Sets the window position relative to the monitor the window is currently on.
|
現在ウィンドウが表示されているモニターに対する、相対的なウィンドウ位置を設定します。
|
||||||
|
|
||||||
Go: `WindowMaximise(ctx context.Context)`<br/> JS: `WindowMaximise()`
|
Go: `WindowMaximise(ctx context.Context)`<br/> JS: `WindowMaximise()`
|
||||||
|
|
||||||
### WindowGetPosition
|
### WindowGetPosition
|
||||||
|
|
||||||
Gets the window position relative to the monitor the window is currently on.
|
現在ウィンドウが表示されているモニターに対する、相対的なウィンドウ位置を取得します。
|
||||||
|
|
||||||
Go: `WindowUnmaximise(ctx context.Context)`<br/> JS: `WindowUnmaximise()`
|
Go: `WindowGetPosition(ctx context.Context) (x int, y int)`<br/> JS: `WindowGetPosition() : Position`
|
||||||
|
|
||||||
### WindowMaximise
|
### WindowMaximise
|
||||||
|
|
||||||
Maximises the window to fill the screen.
|
ウィンドウを最大化します。
|
||||||
|
|
||||||
Go: `WindowToggleMaximise(ctx context.Context)`<br/> JS: `WindowToggleMaximise()`
|
Go: `WindowToggleMaximise(ctx context.Context)`<br/> JS: `WindowToggleMaximise()`
|
||||||
|
|
||||||
### WindowUnmaximise
|
### WindowUnmaximise
|
||||||
|
|
||||||
Restores the window to the dimensions and position prior to maximising.
|
ウィンドウの最大化を解除し、最大化する前のサイズおよび位置に戻します。
|
||||||
|
|
||||||
Go: `WindowMinimise(ctx context.Context)`<br/> JS: `WindowMinimise()`
|
Go: `WindowMinimise(ctx context.Context)`<br/> JS: `WindowMinimise()`
|
||||||
|
|
||||||
### WindowIsMaximised
|
### WindowIsMaximised
|
||||||
|
|
||||||
Returns true if the window is maximised.
|
ウィンドウが最大化している場合はtrueを返します。
|
||||||
|
|
||||||
Go: `WindowIsMaximised(ctx context.Context) bool`<br/> JS: `WindowIsMaximised() bool`
|
Go: `WindowIsMaximised(ctx context.Context) bool`<br/> JS: `WindowIsMaximised() bool`
|
||||||
|
|
||||||
### WindowToggleMaximise
|
### WindowToggleMaximise
|
||||||
|
|
||||||
Toggles between Maximised and UnMaximised.
|
最大化の状態を切り替えます。
|
||||||
|
|
||||||
Go: `WindowToggleMaximise(ctx context.Context)`<br/> JS: `WindowToggleMaximise()`
|
Go: `WindowToggleMaximise(ctx context.Context)`<br/> JS: `WindowToggleMaximise()`
|
||||||
|
|
||||||
### WindowMinimise
|
### WindowMinimise
|
||||||
|
|
||||||
Minimises the window.
|
ウィンドウを最小化します。
|
||||||
|
|
||||||
Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`<br/> JS: `WindowSetBackgroundColour(R, G, B, A)`
|
Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`<br/> JS: `WindowSetBackgroundColour(R, G, B, A)`
|
||||||
|
|
||||||
### WindowUnminimise
|
### WindowUnminimise
|
||||||
|
|
||||||
Restores the window to the dimensions and position prior to minimising.
|
ウィンドウの最小化を解除し、最小化する前のサイズおよび位置に戻します。
|
||||||
|
|
||||||
Go: `WindowUnminimise(ctx context.Context)`<br/> JS: `WindowUnminimise()`
|
Go: `WindowUnminimise(ctx context.Context)`<br/> JS: `WindowUnminimise()`
|
||||||
|
|
||||||
### WindowIsMinimised
|
### WindowIsMinimised
|
||||||
|
|
||||||
Returns true if the window is minimised.
|
ウィンドウが最小化している場合はtrueを返します。
|
||||||
|
|
||||||
Go: `WindowIsMinimised(ctx context.Context) bool`<br/> JS: `WindowIsMinimised() bool`
|
Go: `WindowIsMinimised(ctx context.Context) bool`<br/> JS: `WindowIsMinimised() bool`
|
||||||
|
|
||||||
### WindowSetBackgroundColour
|
### WindowSetBackgroundColour
|
||||||
|
|
||||||
Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
|
ウィンドウの背景色をRGBAカラー定義で設定します。 この色は、すべての透過ピクセルに対して表示されます。
|
||||||
|
|
||||||
Valid values for R, G, B and A are 0-255.
|
R、G、B、Aの有効な値の範囲は0~255です。
|
||||||
|
|
||||||
:::info Windows
|
:::info Windows
|
||||||
|
|
||||||
|
|
||||||
On Windows, only alpha values of 0 or 255 are supported. Any value that is not 0 will be considered 255.
|
Windowsの場合、0または255のアルファ値(A) のみがサポートされています。 0以外の値を指定すると、すべて255とみなされます。
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`<br/> JS: `WindowSetBackgroundColour(R, G, B, A)`
|
Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`<br/> JS: `WindowSetBackgroundColour(R, G, B, A)`
|
||||||
|
|
||||||
## Typescript Object Definitions
|
## Typescript型定義
|
||||||
|
|
||||||
### Position
|
### Position
|
||||||
|
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
"description": "The label for version v2.0.0-rc.1"
|
"description": "The label for version v2.0.0-rc.1"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Getting Started": {
|
"sidebar.docs.category.Getting Started": {
|
||||||
"message": "Getting Started",
|
"message": "はじめよう",
|
||||||
"description": "The label for category Getting Started in sidebar docs"
|
"description": "The label for category Getting Started in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Reference": {
|
"sidebar.docs.category.Reference": {
|
||||||
"message": "Reference",
|
"message": "リファレンス",
|
||||||
"description": "The label for category Reference in sidebar docs"
|
"description": "The label for category Reference in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Runtime": {
|
"sidebar.docs.category.Runtime": {
|
||||||
@ -16,23 +16,23 @@
|
|||||||
"description": "The label for category Runtime in sidebar docs"
|
"description": "The label for category Runtime in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Community": {
|
"sidebar.docs.category.Community": {
|
||||||
"message": "Community",
|
"message": "コミュニティ",
|
||||||
"description": "The label for category Community in sidebar docs"
|
"description": "The label for category Community in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Showcase": {
|
"sidebar.docs.category.Showcase": {
|
||||||
"message": "Showcase",
|
"message": "事例紹介",
|
||||||
"description": "The label for category Showcase in sidebar docs"
|
"description": "The label for category Showcase in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Guides": {
|
"sidebar.docs.category.Guides": {
|
||||||
"message": "Guides",
|
"message": "ガイド",
|
||||||
"description": "The label for category Guides in sidebar docs"
|
"description": "The label for category Guides in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Tutorials": {
|
"sidebar.docs.category.Tutorials": {
|
||||||
"message": "Tutorials",
|
"message": "チュートリアル",
|
||||||
"description": "The label for category Tutorials in sidebar docs"
|
"description": "The label for category Tutorials in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.link.Contributing": {
|
"sidebar.docs.link.Contributing": {
|
||||||
"message": "Contributing",
|
"message": "コントリビューション",
|
||||||
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
"description": "The label for version v2.0.0"
|
"description": "The label for version v2.0.0"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Getting Started": {
|
"sidebar.docs.category.Getting Started": {
|
||||||
"message": "Getting Started",
|
"message": "はじめよう",
|
||||||
"description": "The label for category Getting Started in sidebar docs"
|
"description": "The label for category Getting Started in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Reference": {
|
"sidebar.docs.category.Reference": {
|
||||||
"message": "Reference",
|
"message": "リファレンス",
|
||||||
"description": "The label for category Reference in sidebar docs"
|
"description": "The label for category Reference in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Runtime": {
|
"sidebar.docs.category.Runtime": {
|
||||||
@ -16,23 +16,23 @@
|
|||||||
"description": "The label for category Runtime in sidebar docs"
|
"description": "The label for category Runtime in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Community": {
|
"sidebar.docs.category.Community": {
|
||||||
"message": "Community",
|
"message": "コミュニティ",
|
||||||
"description": "The label for category Community in sidebar docs"
|
"description": "The label for category Community in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Showcase": {
|
"sidebar.docs.category.Showcase": {
|
||||||
"message": "Showcase",
|
"message": "事例紹介",
|
||||||
"description": "The label for category Showcase in sidebar docs"
|
"description": "The label for category Showcase in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Guides": {
|
"sidebar.docs.category.Guides": {
|
||||||
"message": "Guides",
|
"message": "ガイド",
|
||||||
"description": "The label for category Guides in sidebar docs"
|
"description": "The label for category Guides in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.category.Tutorials": {
|
"sidebar.docs.category.Tutorials": {
|
||||||
"message": "Tutorials",
|
"message": "チュートリアル",
|
||||||
"description": "The label for category Tutorials in sidebar docs"
|
"description": "The label for category Tutorials in sidebar docs"
|
||||||
},
|
},
|
||||||
"sidebar.docs.link.Contributing": {
|
"sidebar.docs.link.Contributing": {
|
||||||
"message": "Contributing",
|
"message": "コントリビューション",
|
||||||
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,13 +5,13 @@ Wails includes support for obfuscating your application using [garble](https://g
|
|||||||
To produce an obfuscated build, you can use the `-obfuscate` flag with the `wails build` command:
|
To produce an obfuscated build, you can use the `-obfuscate` flag with the `wails build` command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wails build -obfuscate
|
wails build -obfuscated
|
||||||
```
|
```
|
||||||
|
|
||||||
To customise the obfuscation settings, you can use the `-garbleargs` flag:
|
To customise the obfuscation settings, you can use the `-garbleargs` flag:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wails build -obfuscate -garbleargs "-literals -tiny -seed=myrandomseed"
|
wails build -obfuscated -garbleargs "-literals -tiny -seed=myrandomseed"
|
||||||
```
|
```
|
||||||
|
|
||||||
These settings may be persisted in your [project config](../reference/project-config).
|
These settings may be persisted in your [project config](../reference/project-config).
|
||||||
|
@ -4,7 +4,22 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## Unreleased
|
## v2.0.0 - 2022-09-22
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
* Fix buildtags parsing if only one tag is specified by @stffabi in https://github.com/wailsapp/wails/pull/1858
|
||||||
|
* Use embed all to include all files in templates by @stffabi in https://github.com/wailsapp/wails/pull/1862
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
* Bump minimum required Go version to 1.18 by @stffabi in https://github.com/wailsapp/wails/pull/1854
|
||||||
|
* Add check for minimum required Go version by @stffabi in https://github.com/wailsapp/wails/pull/1853
|
||||||
|
* chore: update README and workflows by @misitebao in https://github.com/wailsapp/wails/pull/1848
|
||||||
|
* Update introduction.mdx by @ParvinEyvazov in https://github.com/wailsapp/wails/pull/1863
|
||||||
|
* Releasetest/release workflow by @leaanthony in https://github.com/wailsapp/wails/pull/1869
|
||||||
|
* Optimize documentation website by @misitebao in https://github.com/wailsapp/wails/pull/1849
|
||||||
|
|
||||||
|
## New Contributors
|
||||||
|
* @ParvinEyvazov made their first contribution in https://github.com/wailsapp/wails/pull/1863
|
||||||
|
|
||||||
## v2.0.0-rc.1 - 2022-09-13
|
## v2.0.0-rc.1 - 2022-09-13
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Contributor Covenant Code of Conduct
|
# コントリビューターの行動規範
|
||||||
|
|
||||||
## 私たちの約束
|
## 私たちの約束
|
||||||
|
|
||||||
@ -32,25 +32,25 @@
|
|||||||
|
|
||||||
## 適用範囲
|
## 適用範囲
|
||||||
|
|
||||||
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
この行動規範は、すべてのコミュニティスペース内で適用され、個人がパブリックスペースでコミュニティを公式に代表している場合にも適用されます。 私たちのコミュニティを代表する例には、公式の電子メールアドレスの使用、公式のソーシャルメディアアカウントを介した投稿、オンラインまたはオフラインのイベントでの指定代理人としての行動などがあります。
|
||||||
|
|
||||||
## 執行
|
## 執行
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at coc@wails.io. All complaints will be reviewed and investigated promptly and fairly.
|
虐待的、嫌がらせ、またはその他の許容できない行動の事例は、執行を担当するコミュニティリーダー coc@wails.io へ報告される場合があります。 すべての苦情は迅速かつ公正にレビューおよび調査されます。
|
||||||
|
|
||||||
すべてのコミュニティリーダーは、問題の報告者のプライバシーとセキュリティを尊重する義務があります。
|
すべてのコミュニティリーダーは、問題の報告者のプライバシーとセキュリティを尊重する義務があります。
|
||||||
|
|
||||||
## 執行ガイドライン
|
## 執行ガイドライン
|
||||||
|
|
||||||
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
コミュニティリーダーは、この行動規範に違反していると見なした行動への帰結を判断する際に、これらのコミュニティガイドラインに従います。
|
||||||
|
|
||||||
### 1. Correction
|
### 1. 更生
|
||||||
|
|
||||||
**コミュニティへの影響**: コミュニティで専門家にふさわしくない、または歓迎されないと思われる不適切な言葉の使用やその他の不適切な行動をすること。
|
**コミュニティへの影響**: コミュニティで専門家にふさわしくない、または歓迎されないと思われる不適切な言葉の使用やその他の不適切な行動をすること。
|
||||||
|
|
||||||
**帰結**: コミュニティリーダーからの非公開の書面による警告。 違反の理由を明確にし、行動が不適切だった理由を説明します。 公の謝罪が要求される場合があります。
|
**帰結**: コミュニティリーダーからの非公開の書面による警告。 違反の理由を明確にし、行動が不適切だった理由を説明します。 公の謝罪が要求される場合があります。
|
||||||
|
|
||||||
### 2. Warning
|
### 2. 警告
|
||||||
|
|
||||||
**コミュニティへの影響**: 単一の出来事または一連の動作による違反。
|
**コミュニティへの影響**: 単一の出来事または一連の動作による違反。
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ Community leaders will follow these Community Impact Guidelines in determining t
|
|||||||
|
|
||||||
**コミュニティへの影響**: 持続的で不適切な行動を含む、コミュニティ標準の重大な違反。
|
**コミュニティへの影響**: 持続的で不適切な行動を含む、コミュニティ標準の重大な違反。
|
||||||
|
|
||||||
**帰結**: 指定された期間のコミュニティとのあらゆる種類の相互関係または公的なコミュニケーションの一時的な禁止。 この期間中、行動規範を実施する人々との一方的な対話を含め、関係する人々との公的または私的な対話は許可されません。 これらの条件に違反すると、永久的に禁止される場合があります。 Violating these terms may lead to a permanent ban.
|
**帰結**: 指定された期間のコミュニティとのあらゆる種類の相互関係または公的なコミュニケーションの一時的な禁止。 この期間中、行動規範を実施する人々との一方的な対話を含め、関係する人々との公的または私的な対話は許可されません。 これらの条件に違反すると、永久的に禁止される場合があります。 これらの条件に違反すると、永久的に禁止される場合があります。
|
||||||
|
|
||||||
### 4. 永久的な禁止
|
### 4. 永久的な禁止
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ Community leaders will follow these Community Impact Guidelines in determining t
|
|||||||
|
|
||||||
**帰結**: コミュニティ内でのあらゆる種類の公的な相互関係の永久的な禁止。
|
**帰結**: コミュニティ内でのあらゆる種類の公的な相互関係の永久的な禁止。
|
||||||
|
|
||||||
## Attribution
|
## 帰属
|
||||||
|
|
||||||
この行動規範は、https://www.contributor-covenant.org/version/2/0/code_of_conduct.html で利用可能な [Contributor Covenant](https://www.contributor-covenant.org) バージョン 2.0 を基に作成されています。
|
この行動規範は、https://www.contributor-covenant.org/version/2/0/code_of_conduct.html で利用可能な [Contributor Covenant](https://www.contributor-covenant.org) バージョン 2.0 を基に作成されています。
|
||||||
|
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
# Credits
|
# クレジット
|
||||||
|
|
||||||
- [Lea Anthony](https://github.com/leaanthony) - Project owner, lead developer
|
- [Lea Anthony](https://github.com/leaanthony) - プロジェクトオーナー、開発リーダー
|
||||||
- [Stffabi](https://github.com/stffabi) - Technical lead, developer and maintainer
|
- [Stffabi](https://github.com/stffabi) - テクニカルリーダー、開発担当、保守担当
|
||||||
- [Misite Bao](https://github.com/misitebao) - Documentation wizard, Chinese translation, Windows testing, Bug finder general
|
- [Misite Bao](https://github.com/misitebao) - ドキュメント専門担当、翻訳担当(中国語)、Windowsテスター、不具合収集担当
|
||||||
- [Travis McLane](https://github.com/tmclane) - Cross-compilation work, MacOS testing
|
- [Travis McLane](https://github.com/tmclane) - クロスコンパイル担当、MacOSテスター
|
||||||
- [Byron Chris](https://github.com/bh90210) - Linux distro wizard, Linux testing
|
- [Byron Chris](https://github.com/bh90210) - Linuxディストリビューション専門担当、Linuxテスター
|
||||||
|
|
||||||
## Sponsors
|
## スポンサー
|
||||||
<img src="/img/sponsors.svg" style={{"width":"85%","max-width":"800px;"}} />
|
<img src="/img/sponsors.svg" style={{"width":"85%","max-width":"800px;"}} />
|
||||||
|
|
||||||
## Contributors
|
## コントリビューター
|
||||||
|
|
||||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
||||||
<!-- prettier-ignore-start -->
|
<!-- prettier-ignore-start -->
|
||||||
@ -179,6 +179,7 @@
|
|||||||
<td align="center"><a href="http://mai.car.ons"><img src="https://avatars.githubusercontent.com/u/101958587?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Maicarons J</b></sub></a><br /><a href="https://github.com/wailsapp/wails/commits?author=Maicarons2022" title="Documentation">📖</a></td>
|
<td align="center"><a href="http://mai.car.ons"><img src="https://avatars.githubusercontent.com/u/101958587?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Maicarons J</b></sub></a><br /><a href="https://github.com/wailsapp/wails/commits?author=Maicarons2022" title="Documentation">📖</a></td>
|
||||||
<td align="center"><a href="https://github.com/KiddoV"><img src="https://avatars.githubusercontent.com/u/28552977?v=4?s=75" width="75px;" alt=""/><br /><sub><b>kiddov</b></sub></a><br /><a href="https://github.com/wailsapp/wails/commits?author=KiddoV" title="Documentation">📖</a> <a href="#financial-KiddoV" title="Financial">💵</a> <a href="https://github.com/wailsapp/wails/commits?author=KiddoV" title="Tests">⚠️</a> <a href="#ideas-KiddoV" title="Ideas, Planning, & Feedback">🤔</a></td>
|
<td align="center"><a href="https://github.com/KiddoV"><img src="https://avatars.githubusercontent.com/u/28552977?v=4?s=75" width="75px;" alt=""/><br /><sub><b>kiddov</b></sub></a><br /><a href="https://github.com/wailsapp/wails/commits?author=KiddoV" title="Documentation">📖</a> <a href="#financial-KiddoV" title="Financial">💵</a> <a href="https://github.com/wailsapp/wails/commits?author=KiddoV" title="Tests">⚠️</a> <a href="#ideas-KiddoV" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||||
<td align="center"><a href="https://nicolas-coutin.com/"><img src="https://avatars.githubusercontent.com/u/6564012?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Nicolas Coutin</b></sub></a><br /><a href="#financial-Ilshidur" title="Financial">💵</a></td>
|
<td align="center"><a href="https://nicolas-coutin.com/"><img src="https://avatars.githubusercontent.com/u/6564012?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Nicolas Coutin</b></sub></a><br /><a href="#financial-Ilshidur" title="Financial">💵</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/ParvinEyvazov"><img src="https://avatars.githubusercontent.com/u/32189770?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Parvin Eyvazov</b></sub></a><br /><a href="https://github.com/wailsapp/wails/commits?author=ParvinEyvazov" title="Documentation">📖</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@ -187,12 +188,12 @@
|
|||||||
|
|
||||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||||
|
|
||||||
## Special Mentions
|
## スペシャルサンクス
|
||||||
|
|
||||||
- [John Chadwick](https://github.com/jchv) - His amazing work on [go-webview2](https://github.com/jchv/go-webview2) and [go-winloader](https://github.com/jchv/go-winloader) have made the Windows version possible.
|
- [John Chadwick](https://github.com/jchv) - 彼の[go-webview2](https://github.com/jchv/go-webview2)および[go-winloader](https://github.com/jchv/go-winloader)というすばらしい成果によって、Windows版を開発できました。
|
||||||
- [Tad Vizbaras](https://github.com/tadvi) - His winc project was the first step down the path to a pure Go Wails.
|
- [Tad Vizbaras](https://github.com/tadvi) - 彼のwincプロジェクトは、純粋なGo Wails開発の最初のステップでした。
|
||||||
- [Mat Ryer](https://github.com/matryer) - For advice, support and bants.
|
- [Mat Ryer](https://github.com/matryer) - アドバイス、サポート、営業。
|
||||||
- [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot) - His support and feedback has been invaluable.
|
- [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot) - 彼は非常に有益なサポートおよびフィードバックをしてくれました。
|
||||||
- [Justen Walker](https://github.com/justenwalker/) - For helping wrangle COM issues which got v2 over the line.
|
- [Justen Walker](https://github.com/justenwalker/) - v2を成功させるために、COM問題を解決してくれました。
|
||||||
- [Wang, Chi](https://github.com/patr0nus/) - The DeskGap project was a huge influence on the direction of Wails v2.
|
- [Wang, Chi](https://github.com/patr0nus/) - DeskGapプロジェクトは、Wails v2の方向性に大きな影響を与えてくれました。
|
||||||
- [Serge Zaitsev](https://github.com/zserge) - Whilst Wails does not use the Webview project, it is still a source of inspiration.
|
- [Serge Zaitsev](https://github.com/zserge) - WailsがWebviewを使用していない間、インスピレーションの源となっていました。
|
||||||
|
@ -4,4 +4,4 @@ title: Markdown page example
|
|||||||
|
|
||||||
# Markdown page example
|
# Markdown page example
|
||||||
|
|
||||||
You don't need React to write simple standalone pages.
|
シンプルな単一ページを作成する場合、Reactは必要ありません。
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"description": "The title of the footer links column with title=Docs in the footer"
|
"description": "The title of the footer links column with title=Docs in the footer"
|
||||||
},
|
},
|
||||||
"link.title.Community": {
|
"link.title.Community": {
|
||||||
"message": "Community",
|
"message": "コミュニティ",
|
||||||
"description": "The title of the footer links column with title=Community in the footer"
|
"description": "The title of the footer links column with title=Community in the footer"
|
||||||
},
|
},
|
||||||
"link.title.More": {
|
"link.title.More": {
|
||||||
@ -12,11 +12,11 @@
|
|||||||
"description": "The title of the footer links column with title=More in the footer"
|
"description": "The title of the footer links column with title=More in the footer"
|
||||||
},
|
},
|
||||||
"link.item.label.Introduction": {
|
"link.item.label.Introduction": {
|
||||||
"message": "Introduction",
|
"message": "イントロダクション",
|
||||||
"description": "The label of footer link with label=Introduction linking to /docs/introduction"
|
"description": "The label of footer link with label=Introduction linking to /docs/introduction"
|
||||||
},
|
},
|
||||||
"link.item.label.Getting Started": {
|
"link.item.label.Getting Started": {
|
||||||
"message": "Getting Started",
|
"message": "はじめよう",
|
||||||
"description": "The label of footer link with label=Getting Started linking to /docs/gettingstarted/installation"
|
"description": "The label of footer link with label=Getting Started linking to /docs/gettingstarted/installation"
|
||||||
},
|
},
|
||||||
"link.item.label.Changelog": {
|
"link.item.label.Changelog": {
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
"description": "Navbar item with label GitHub"
|
"description": "Navbar item with label GitHub"
|
||||||
},
|
},
|
||||||
"item.label.About": {
|
"item.label.About": {
|
||||||
"message": "About",
|
"message": "概要",
|
||||||
"description": "Navbar item with label About"
|
"description": "Navbar item with label About"
|
||||||
},
|
},
|
||||||
"item.label.FAQ": {
|
"item.label.FAQ": {
|
||||||
@ -32,11 +32,11 @@
|
|||||||
"description": "Navbar item with label Community Guide"
|
"description": "Navbar item with label Community Guide"
|
||||||
},
|
},
|
||||||
"item.label.Credits": {
|
"item.label.Credits": {
|
||||||
"message": "Credits",
|
"message": "クレジット",
|
||||||
"description": "Navbar item with label Credits"
|
"description": "Navbar item with label Credits"
|
||||||
},
|
},
|
||||||
"item.label.Code of Conduct": {
|
"item.label.Code of Conduct": {
|
||||||
"message": "Code of Conduct",
|
"message": "行動規範",
|
||||||
"description": "Navbar item with label Code of Conduct"
|
"description": "Navbar item with label Code of Conduct"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -242,7 +242,7 @@
|
|||||||
"description": "The label used by the button on the collapsible TOC component"
|
"description": "The label used by the button on the collapsible TOC component"
|
||||||
},
|
},
|
||||||
"theme.navbar.mobileLanguageDropdown.label": {
|
"theme.navbar.mobileLanguageDropdown.label": {
|
||||||
"message": "语言",
|
"message": "选择语言",
|
||||||
"description": "The label for the mobile language switcher dropdown"
|
"description": "The label for the mobile language switcher dropdown"
|
||||||
},
|
},
|
||||||
"theme.SearchBar.seeAll": {
|
"theme.SearchBar.seeAll": {
|
||||||
|
@ -65,9 +65,9 @@ Gophers 欢呼吧! 单个二进制文件的构想依然存在!
|
|||||||
<br />
|
<br />
|
||||||
```
|
```
|
||||||
|
|
||||||
有很多对原生菜单支持的请求。 Wails 终于帮您搞定了。 应用程序菜单现已可用,并且包括对大多数原生菜单功能的支持。 这包括标准菜单项、复选框、单选组、子菜单和分隔符。
|
有很多对原生菜单支持的需求。 Wails 终于帮您搞定了。 应用程序菜单现已可用,并且包括对大多数原生菜单功能的支持。 这包括标准菜单项、复选框、单选组、子菜单和分隔符。
|
||||||
|
|
||||||
在 v1 中有大量的请求,要求能够更好地控制窗口本身。 我很高兴地宣布,有专门用于此的新运行时 API。 它功能丰富,支持多显示器配置。 还有一个改进的对话框 API:现在,您可以拥有具有丰富配置的现代原生对话框,以满足您的所有对话框需求。
|
在 v1 中有大量的需求,要求能够更好地控制窗口本身。 我很高兴地宣布,有专门用于此的新运行时 API。 它功能丰富,支持多显示器配置。 还有一个改进的对话框 API:现在,您可以拥有具有丰富配置的现代原生对话框,以满足您所有的对话框需求。
|
||||||
|
|
||||||
现在可以选择随项目生成 IDE 配置。 这意味着如果您在受支持的 IDE 中打开您的项目,它已经被配置为构建和调试您的应用程序。 目前支持 VSCode,但我们希望尽快支持其他 IDE,例如 Goland。
|
现在可以选择随项目生成 IDE 配置。 这意味着如果您在受支持的 IDE 中打开您的项目,它已经被配置为构建和调试您的应用程序。 目前支持 VSCode,但我们希望尽快支持其他 IDE,例如 Goland。
|
||||||
|
|
||||||
|
@ -95,4 +95,4 @@ V2 版本是该项目的巨大飞跃,解决了 v1 的许多痛点。 如果您
|
|||||||
|
|
||||||
‐ Lea
|
‐ Lea
|
||||||
|
|
||||||
PPS:如果您或您的公司发现 Wails 有用,可以考虑 [赞助该项目](https://github.com/sponsors/leaanthony)。 谢谢! 谢谢!
|
PPS:如果您或您的公司发现 Wails 有用,可以考虑 [赞助该项目](https://github.com/sponsors/leaanthony)。 谢谢!
|
||||||
|
@ -9,7 +9,7 @@ sidebar_position: 5
|
|||||||
- 构建您的应用程序并运行它
|
- 构建您的应用程序并运行它
|
||||||
- 将您的 Go 代码绑定到前端,以便可以从 Javascript 调用它
|
- 将您的 Go 代码绑定到前端,以便可以从 Javascript 调用它
|
||||||
- 使用 [Vite](https://vitejs.dev/) 的强大功能,将监视您的 Go 文件中的修改并在更改时重新构建/重新运行
|
- 使用 [Vite](https://vitejs.dev/) 的强大功能,将监视您的 Go 文件中的修改并在更改时重新构建/重新运行
|
||||||
- 启动一个 [网络服务器](http://localhost:34115) 通过浏览器为您的应用程序提供服务。 这使您可以使用自己喜欢的浏览器扩展。你甚至可以从控制台调用你的 Go 代码。 您甚至可以从控制台调用 Go 代码。
|
- 启动一个 [网络服务器](http://localhost:34115) 通过浏览器为您的应用程序提供服务。 这使您可以使用自己喜欢的浏览器扩展。 你甚至可以从控制台调用你的 Go 代码。
|
||||||
|
|
||||||
首先,在项目目录中运行 `wails dev`。 可以在 [此处](../reference/cli#开发) 找到有关这方面的更多信息。
|
首先,在项目目录中运行 `wails dev`。 可以在 [此处](../reference/cli#开发) 找到有关这方面的更多信息。
|
||||||
|
|
||||||
|
@ -116,10 +116,10 @@ Wails 项目有以下布局:
|
|||||||
- `/main.go` - 主应用
|
- `/main.go` - 主应用
|
||||||
- `/frontend/` - 前端项目文件
|
- `/frontend/` - 前端项目文件
|
||||||
- `/build/` - 项目构建目录
|
- `/build/` - 项目构建目录
|
||||||
- `/wails.json` - 应用程序图标
|
- `/build/appicon.png` - 应用程序图标
|
||||||
- `/go.mod` - Mac 特定的项目文件
|
- `/build/darwin/` - Mac 特定的项目文件
|
||||||
- `/go.sum` - Windows 特定的项目文件
|
- `/build/windows/` - Windows 特定的项目文件
|
||||||
- `/build/windows/` - 项目配置
|
- `/wails.json` - 项目配置
|
||||||
- `/go.mod` - Go module 文件
|
- `/go.mod` - Go module 文件
|
||||||
- `/go.sum` - Go module 校验文件
|
- `/go.sum` - Go module 校验文件
|
||||||
|
|
||||||
|
@ -5,13 +5,13 @@ Wails 支持使用 [garble](https://github.com/burrowers/garble) 来混淆您的
|
|||||||
要生成混淆构建,您可以将 `-obfuscate` 标志与 `wails build` 命令一起使用:
|
要生成混淆构建,您可以将 `-obfuscate` 标志与 `wails build` 命令一起使用:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wails build -obfuscate
|
wails build -obfuscated
|
||||||
```
|
```
|
||||||
|
|
||||||
要自定义混淆设置,您可以使用以下 `-garbleargs` 标志:
|
要自定义混淆设置,您可以使用以下 `-garbleargs` 标志:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wails build -obfuscate -garbleargs "-literals -tiny -seed=myrandomseed"
|
wails build -obfuscated -garbleargs "-literals -tiny -seed=myrandomseed"
|
||||||
```
|
```
|
||||||
|
|
||||||
这些设置可能会保留在您的 [项目配置](../reference/project-config) 中。
|
这些设置可能会保留在您的 [项目配置](../reference/project-config) 中。
|
||||||
|
@ -226,11 +226,13 @@ export function Greet(arg1: string): Promise<string>;
|
|||||||
|
|
||||||
生成的方法返回一个 Promise 成功的调用将导致 Go 调用的第一个返回值被传递给 `resolve` 处理程序。 不成功的调用是当 Go 方法的第二个返回值具有错误类型时,将错误实例传递回调用者。 这通过 `reject` 处理程序传回的。 在上面的示例中,`Greet` 只返回一个 `string`,因此 Javascript 调用永远不会 reject - 除非将无效数据传递给它。
|
生成的方法返回一个 Promise 成功的调用将导致 Go 调用的第一个返回值被传递给 `resolve` 处理程序。 不成功的调用是当 Go 方法的第二个返回值具有错误类型时,将错误实例传递回调用者。 这通过 `reject` 处理程序传回的。 在上面的示例中,`Greet` 只返回一个 `string`,因此 Javascript 调用永远不会 reject - 除非将无效数据传递给它。
|
||||||
|
|
||||||
所有数据类型都在 Go 和 Javascript 之间正确转换。 包括结构体。 如果您从 Go 调用返回一个结构体,它将作为 Javascript 类返回到您的前端。 注意:如果您想使用结构体,您 **必须** 为您的结构体字段定义 `json` 标签!
|
所有数据类型都在 Go 和 Javascript 之间正确转换。 包括结构体。 如果您从 Go 调用返回一个结构体,它将作为 Javascript 类返回到您的前端。
|
||||||
|
|
||||||
:::info 注意
|
:::info 注意
|
||||||
|
|
||||||
|
|
||||||
|
结构体字段 *必须* 具有有效的 `json` 标签,以包含在生成的 TypeScript 中。
|
||||||
|
|
||||||
目前不支持嵌套匿名结构体。
|
目前不支持嵌套匿名结构体。
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
@ -51,28 +51,28 @@ Wails CLI 有许多用于管理项目的命令。 所有命令都以此方式运
|
|||||||
|
|
||||||
`wails build` 用于将您的项目编译为生产可用的二进制文件。
|
`wails build` 用于将您的项目编译为生产可用的二进制文件。
|
||||||
|
|
||||||
| 标志 | 描述 | 默认 |
|
| 标志 | 描述 | 默认 |
|
||||||
|:--------------- |:-------------------------------------------------------------------------------------------- |:--------------------------------------------------------------------------------------------------------- |
|
|:--------------- |:------------------------------------------------------------------------------------------------------------- |:---------------------------------------------------------------------------------------------------------- |
|
||||||
| -platform | 为指定的 [平台](../reference/cli#平台)(逗号分割)构建,例如: `windows/arm64`。 注意,如果不给出架构,则使用 `runtime.GOARCH`。 | 如果给定环境变量 platform = `GOOS` 否则等于 `runtime.GOOS`。<br/>如果给定环境变量 arch = `GOARCH` 否则等于 `runtime.GOARCH`. |
|
| -platform | 为指定的 [平台](../reference/cli#平台)(逗号分割)构建,例如: `windows/arm64`。 `windows/arm64`。 注意,如果不给出架构,则使用 `runtime.GOARCH`。 | 如果给定环境变量 platform = `GOOS` 否则等于 `runtime.GOOS`。 <br/>如果给定环境变量 arch = `GOARCH` 否则等于 `runtime.GOARCH`. |
|
||||||
| -clean | 清理 `build/bin` 目录 | |
|
| -clean | 清理 `build/bin` 目录 | |
|
||||||
| -compiler "编译器" | 使用不同的 go 编译器来构建,例如 go1.15beta1 | go |
|
| -compiler "编译器" | 使用不同的 go 编译器来构建,例如 go1.15beta1 | go |
|
||||||
| -ldflags "标志" | 传递给编译器的额外 ldflags | |
|
| -ldflags "标志" | 传递给编译器的额外 ldflags | |
|
||||||
| -nopackage | 不打包应用程序 | |
|
| -nopackage | 不打包应用程序 | |
|
||||||
| -o 文件名 | 输出文件名 | |
|
| -o 文件名 | 输出文件名 | |
|
||||||
| -s | 跳过前端构建 | false |
|
| -s | 跳过前端构建 | false |
|
||||||
| -f | 强制构建应用 | false |
|
| -f | 强制构建应用 | false |
|
||||||
| -tags "额外标签" | 构建标签以传递给 Go 编译器。 必须引用。 空格或逗号(但不能同时使用)分隔 | |
|
| -tags "额外标签" | 构建标签以传递给 Go 编译器。 必须引用。 空格或逗号(但不能同时使用)分隔 | |
|
||||||
| -upx | 使用 “upx” 压缩最终二进制文件 | |
|
| -upx | 使用 “upx” 压缩最终二进制文件 | |
|
||||||
| -upxflags | 传递给 upx 的标志 | |
|
| -upxflags | 传递给 upx 的标志 | |
|
||||||
| -v int | 详细级别 (0 - silent, 1 - default, 2 - verbose) | 1 |
|
| -v int | 详细级别 (0 - silent, 1 - default, 2 - verbose) | 1 |
|
||||||
| -webview2 | WebView2 安装策略:download,embed,browser,error. | download |
|
| -webview2 | WebView2 安装策略:download,embed,browser,error. | download |
|
||||||
| -u | 更新项目的 `go.mod` 以使用与 CLI 相同版本的 Wails | |
|
| -u | 更新项目的 `go.mod` 以使用与 CLI 相同版本的 Wails | |
|
||||||
| -debug | 在应用程序中保留调试信息。 允许在应用程序窗口中使用 devtools | false |
|
| -debug | 在应用程序中保留调试信息。 允许在应用程序窗口中使用 devtools | false |
|
||||||
| -trimpath | 从生成的可执行文件中删除所有文件系统路径。 | false |
|
| -trimpath | 从生成的可执行文件中删除所有文件系统路径。 | false |
|
||||||
| -race | 使用 Go 的竞态检测器构建 | false |
|
| -race | 使用 Go 的竞态检测器构建 | false |
|
||||||
| -windowsconsole | 保留Windows构建控制台窗口 | |
|
| -windowsconsole | 保留Windows构建控制台窗口 | |
|
||||||
| -obfuscate | 使用 [garble](https://github.com/burrowers/garble) 混淆应用程序 | false |
|
| -obfuscate | 使用 [garble](https://github.com/burrowers/garble) 混淆应用程序 | false |
|
||||||
| -garbleargs | 传递给 garble 的参数 | `-literals -tiny -seed=random` |
|
| -garbleargs | 传递给 garble 的参数 | `-literals -tiny -seed=random` |
|
||||||
|
|
||||||
有关 `webview2` 标志的详细描述,请参阅 [Windows 系统指南](../guides/windows)。
|
有关 `webview2` 标志的详细描述,请参阅 [Windows 系统指南](../guides/windows)。
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ type CallbackData struct {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
该函数被赋予一个 `CallbackData` 结构,该结构指示哪个菜单项触发了回调。 这在使用可能共享回调的单选菜单组时很有用。这在使用可能共享回调的单选组时很有用。
|
该函数被赋予一个 `CallbackData` 结构,该结构指示哪个菜单项触发了回调。 这在使用可能共享回调的单选组时很有用。
|
||||||
|
|
||||||
### 角色
|
### 角色
|
||||||
|
|
||||||
|
@ -119,18 +119,30 @@ type MessageDialogOptions struct {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
| 字段 | 描述 | Win | Mac | Lin |
|
| 字段 | 描述 | Win | Mac | Lin |
|
||||||
| ------------- | ------------------------------ | --- | --- | --- |
|
| ------------- | ------------------------------ | -------------- | --- | --- |
|
||||||
| 类型 | 消息对话框的类型,例如问题、信息... | ✅ | ✅ | ✅ |
|
| 类型 | 消息对话框的类型,例如问题、信息... | ✅ | ✅ | ✅ |
|
||||||
| Title | 对话框的标题 | ✅ | ✅ | ✅ |
|
| Title | 对话框的标题 | ✅ | ✅ | ✅ |
|
||||||
| Message | 向用户显示的消息 | ✅ | ✅ | ✅ |
|
| Message | 向用户显示的消息 | ✅ | ✅ | ✅ |
|
||||||
| Buttons | 按钮标题列表 | | ✅ | |
|
| Buttons | 按钮标题列表 | | ✅ | |
|
||||||
| DefaultButton | 带有此文本的按钮应被视为默认按钮。 绑定到 `return` | | ✅ | |
|
| DefaultButton | 带有此文本的按钮应被视为默认按钮。 必定 `return`。 | ✅[*](#windows) | ✅ | |
|
||||||
| CancelButton | 带有此文本的按钮应被视为取消。 绑定到 `escape` | | ✅ | |
|
| CancelButton | 带有此文本的按钮应被视为取消。 必定 `escape` | | ✅ | |
|
||||||
|
|
||||||
#### Windows
|
#### Windows
|
||||||
|
|
||||||
Windows 具有标准对话框类型,其中的按钮不可自定义。 返回的值将是以下之一:"Ok"、"Cancel"、"Abort"、"Retry"、"Ignore"、"Yes"、"No"、"Try Again"或"Continue"
|
Windows 具有标准对话框类型,其中的按钮不可自定义。 返回的值将是以下之一:"Ok"、"Cancel"、"Abort"、"Retry"、"Ignore"、"Yes"、"No"、"Try Again"或"Continue"。
|
||||||
|
|
||||||
|
对于问题对话框,默认按钮是 “是”,取消按钮是 “否”。 可以通过将 `默认按钮` 值设置为 `"否"` 来改变这一点。
|
||||||
|
|
||||||
|
示例:
|
||||||
|
```go
|
||||||
|
result, err := runtime.MessageDialog(a.ctx, runtime.MessageDialogOptions{
|
||||||
|
Type: runtime.QuestionDialog,
|
||||||
|
Title: "Question",
|
||||||
|
Message: "Do you want to continue?",
|
||||||
|
DefaultButton: "No",
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
#### Linux
|
#### Linux
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ Go: `Hide(ctx context.Context)`<br/> JS: `Hide()`
|
|||||||
:::info 注意
|
:::info 注意
|
||||||
|
|
||||||
|
|
||||||
` Hide` 在 Mac 上,这将以与标准 Mac 应用程序中的菜单项相同的方式隐藏应用程序。 这与隐藏窗口不同,但应用程序仍处于前台。 对于 Windows 和 Linux,这与 `WindowHide` 相同。
|
`Hide` 在 Mac 上,这将以与标准 Mac 应用程序中的菜单项相同的方式隐藏应用程序。 这与隐藏窗口不同,但应用程序仍处于前台。 对于 Windows 和 Linux,这与 `WindowHide` 相同。
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ sidebar_position: 20
|
|||||||
|
|
||||||
### 创建项目
|
### 创建项目
|
||||||
|
|
||||||
让我们创建应用程序。 从终端输入:` wails init -n dogs-api -t svelte`
|
让我们创建应用程序。 从终端输入:`wails init -n dogs-api -t svelte`
|
||||||
|
|
||||||
注意:如果您想添加 IDE 支持,我们可以选择在此命令的末尾添加 `-ide vscode` 或 `-ide goland`。
|
注意:如果您想添加 IDE 支持,我们可以选择在此命令的末尾添加 `-ide vscode` 或 `-ide goland`。
|
||||||
|
|
||||||
|
@ -5,13 +5,13 @@ Wails 支持使用 [garble](https://github.com/burrowers/garble) 来混淆您的
|
|||||||
要生成混淆构建,您可以将 `-obfuscate` 标志与 `wails build` 命令一起使用:
|
要生成混淆构建,您可以将 `-obfuscate` 标志与 `wails build` 命令一起使用:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wails build -obfuscate
|
wails build -obfuscated
|
||||||
```
|
```
|
||||||
|
|
||||||
要自定义混淆设置,您可以使用以下 `-garbleargs` 标志:
|
要自定义混淆设置,您可以使用以下 `-garbleargs` 标志:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wails build -obfuscate -garbleargs "-literals -tiny -seed=myrandomseed"
|
wails build -obfuscated -garbleargs "-literals -tiny -seed=myrandomseed"
|
||||||
```
|
```
|
||||||
|
|
||||||
这些设置可能会保留在您的 [项目配置](../reference/project-config) 中。
|
这些设置可能会保留在您的 [项目配置](../reference/project-config) 中。
|
||||||
|
@ -4,13 +4,28 @@
|
|||||||
|
|
||||||
格式基于 [维护更新日志](https://keepachangelog.com/en/1.0.0/),并且该项目遵循 [语义化版本](https://semver.org/spec/v2.0.0.html)。
|
格式基于 [维护更新日志](https://keepachangelog.com/en/1.0.0/),并且该项目遵循 [语义化版本](https://semver.org/spec/v2.0.0.html)。
|
||||||
|
|
||||||
## 即将发布
|
## v2.0.0 - 2022-09-22
|
||||||
|
|
||||||
|
## 修复
|
||||||
|
* Fix buildtags parsing if only one tag is specified by @stffabi in https://github.com/wailsapp/wails/pull/1858
|
||||||
|
* Use embed all to include all files in templates by @stffabi in https://github.com/wailsapp/wails/pull/1862
|
||||||
|
|
||||||
|
## 变更
|
||||||
|
* Bump minimum required Go version to 1.18 by @stffabi in https://github.com/wailsapp/wails/pull/1854
|
||||||
|
* Add check for minimum required Go version by @stffabi in https://github.com/wailsapp/wails/pull/1853
|
||||||
|
* chore: update README and workflows by @misitebao in https://github.com/wailsapp/wails/pull/1848
|
||||||
|
* Add nixpkgs support to doctor command. by @ianmjones in https://github.com/wailsapp/wails/pull/1551 by @ianmjones in https://github.com/wailsapp/wails/pull/1551 by @ianmjones in https://github.com/wailsapp/wails/pull/1551
|
||||||
|
* Releasetest/release workflow by @leaanthony in https://github.com/wailsapp/wails/pull/1869
|
||||||
|
* Optimize documentation website by @misitebao in https://github.com/wailsapp/wails/pull/1849
|
||||||
|
|
||||||
|
## 新贡献者
|
||||||
|
* @ParvinEyvazov made their first contribution in https://github.com/wailsapp/wails/pull/1863
|
||||||
|
|
||||||
## v2.0.0-rc.1 - 2022-09-13
|
## v2.0.0-rc.1 - 2022-09-13
|
||||||
|
|
||||||
### 废弃
|
### 废弃
|
||||||
|
|
||||||
- The `-noGen` flag for the `wails dev` command has been replaced with `-skipbindings`. This is to align with the `wails build` command.
|
- The `-noGen` flag for the `wails dev` command has been replaced with `-skipbindings`. This is to align with the `wails build` command. This is to align with the `wails build` command.
|
||||||
|
|
||||||
### 新增
|
### 新增
|
||||||
|
|
||||||
@ -172,7 +187,7 @@ Experimental: &options.Experimental{
|
|||||||
|
|
||||||
### 废弃
|
### 废弃
|
||||||
|
|
||||||
- The `Fullscreen` application option is deprecated. Please use [`WindowStartState`](https://wails.io/docs/reference/options#windowstartstate) instead.
|
- The `Fullscreen` application option is deprecated. The `Fullscreen` application option is deprecated. Please use [`WindowStartState`](https://wails.io/docs/reference/options#windowstartstate) instead.
|
||||||
|
|
||||||
### 新贡献者
|
### 新贡献者
|
||||||
|
|
||||||
@ -202,8 +217,8 @@ Experimental: &options.Experimental{
|
|||||||
|
|
||||||
- Fix stack corruption in Windows when using ICoreWebView2HttpHeadersCollectionIterator by @stffabi in https://github.com/wailsapp/wails/pull/1589
|
- Fix stack corruption in Windows when using ICoreWebView2HttpHeadersCollectionIterator by @stffabi in https://github.com/wailsapp/wails/pull/1589
|
||||||
- Move WindowGet\* to main thread by @leaanthony in https://github.com/wailsapp/wails/pull/1464
|
- Move WindowGet\* to main thread by @leaanthony in https://github.com/wailsapp/wails/pull/1464
|
||||||
- Allow -appargs flag to pass flags to binary. by @ianmjones in https://github.com/wailsapp/wails/pull/1534
|
- Allow -appargs flag to pass flags to binary. by @ianmjones in https://github.com/wailsapp/wails/pull/1534 by @ianmjones in https://github.com/wailsapp/wails/pull/1534
|
||||||
- Fix checking for installed apt package in none English session. by @ianmjones in https://github.com/wailsapp/wails/pull/1548
|
- Fix checking for installed apt package in none English session. by @ianmjones in https://github.com/wailsapp/wails/pull/1548 by @ianmjones in https://github.com/wailsapp/wails/pull/1548
|
||||||
- Fix OnBeforeClose code for Mac by @leaanthony in https://github.com/wailsapp/wails/pull/1558
|
- Fix OnBeforeClose code for Mac by @leaanthony in https://github.com/wailsapp/wails/pull/1558
|
||||||
- Support Maps in TS conversion by @leaanthony in https://github.com/wailsapp/wails/pull/1435
|
- Support Maps in TS conversion by @leaanthony in https://github.com/wailsapp/wails/pull/1435
|
||||||
- Check for line length when scanning for local devserver url by @leaanthony in https://github.com/wailsapp/wails/pull/1566
|
- Check for line length when scanning for local devserver url by @leaanthony in https://github.com/wailsapp/wails/pull/1566
|
||||||
@ -333,14 +348,14 @@ Experimental: &options.Experimental{
|
|||||||
|
|
||||||
### Breaking Changes
|
### Breaking Changes
|
||||||
|
|
||||||
- When data was sent to the `EventsOn` callback, it was being sent as a slice of values, instead of optional parameters to the method. `EventsOn` now works as expected, but you will need to update your code if you currently use this. [More information](https://github.com/wailsapp/wails/issues/1324)
|
- When data was sent to the `EventsOn` callback, it was being sent as a slice of values, instead of optional parameters to the method. `EventsOn` now works as expected, but you will need to update your code if you currently use this. [More information](https://github.com/wailsapp/wails/issues/1324) `EventsOn` now works as expected, but you will need to update your code if you currently use this. [More information](https://github.com/wailsapp/wails/issues/1324)
|
||||||
- The broken `bindings.js` and `bindings.d.ts` files have been replaced by a new JS/TS code generation system. More details [here](https://wails.io/docs/howdoesitwork#calling-bound-go-methods)
|
- The broken `bindings.js` and `bindings.d.ts` files have been replaced by a new JS/TS code generation system. More details [here](https://wails.io/docs/howdoesitwork#calling-bound-go-methods) More details [here](https://wails.io/docs/howdoesitwork#calling-bound-go-methods)
|
||||||
|
|
||||||
### 新增
|
### 新增
|
||||||
|
|
||||||
- **New Templates**: Svelte, React, Vue, Preact, Lit and Vanilla templates, both JS and TS versions. `wails init -l` for more info.
|
- **New Templates**: Svelte, React, Vue, Preact, Lit and Vanilla templates, both JS and TS versions. `wails init -l` for more info. `wails init -l` for more info.
|
||||||
- Default templates now powered by [Vite](https://vitejs.dev). This enables lightning fast reloads when you use `wails dev`!
|
- Default templates now powered by [Vite](https://vitejs.dev). This enables lightning fast reloads when you use `wails dev`! This enables lightning fast reloads when you use `wails dev`!
|
||||||
- Add support for external frontend development servers. See `frontend:dev:serverUrl` in the [project config](https://wails.io/docs/reference/project-config) - [@stffabi](https://github.com/stffabi)
|
- Add support for external frontend development servers. Add support for external frontend development servers. See `frontend:dev:serverUrl` in the [project config](https://wails.io/docs/reference/project-config) - [@stffabi](https://github.com/stffabi)
|
||||||
- [Fully configurable dark mode](https://wails.io/docs/reference/options#theme) for Windows.
|
- [Fully configurable dark mode](https://wails.io/docs/reference/options#theme) for Windows.
|
||||||
- Hugely improved [WailsJS generation](https://wails.io/docs/howdoesitwork#calling-bound-go-methods) (both Javascript and Typescript)
|
- Hugely improved [WailsJS generation](https://wails.io/docs/howdoesitwork#calling-bound-go-methods) (both Javascript and Typescript)
|
||||||
- Wails doctor now reports information about the wails installation - [@stffabi](https://github.com/stffabi)
|
- Wails doctor now reports information about the wails installation - [@stffabi](https://github.com/stffabi)
|
||||||
@ -390,13 +405,13 @@ Experimental: &options.Experimental{
|
|||||||
- Ensure binary resources can be served by [@napalu](https://github.com/napalu) in #1240
|
- Ensure binary resources can be served by [@napalu](https://github.com/napalu) in #1240
|
||||||
- Only retry loading assets when loading from disk by [@leaanthony](https://github.com/leaanthony) in #1241
|
- Only retry loading assets when loading from disk by [@leaanthony](https://github.com/leaanthony) in #1241
|
||||||
- [v2, windows] Fix maximised start state by [@stffabi](https://github.com/stffabi) in #1243
|
- [v2, windows] Fix maximised start state by [@stffabi](https://github.com/stffabi) in #1243
|
||||||
- Ensure Linux IsFullScreen uses GDK_WINDOW_STATE_FULLSCREEN bitmask appropriately. by [@ianmjones](https://github.com/ianmjones) in #1245
|
- Ensure Linux IsFullScreen uses GDK_WINDOW_STATE_FULLSCREEN bitmask appropriately. by [@ianmjones](https://github.com/ianmjones) in #1245 by [@ianmjones](https://github.com/ianmjones) in #1245
|
||||||
- Fix memory leak in ExecJS for Mac by [@leaanthony](https://github.com/leaanthony) in #1230
|
- Fix memory leak in ExecJS for Mac by [@leaanthony](https://github.com/leaanthony) in #1230
|
||||||
- Fix, or at least a workaround, for (#1232) by [@BillBuilt](https://github.com/BillBuilt) in #1247
|
- Fix, or at least a workaround, for (#1232) by [@BillBuilt](https://github.com/BillBuilt) in #1247
|
||||||
- [v2] Use os.Args[0] for self starting wails by [@stffabi](https://github.com/stffabi) in #1258
|
- [v2] Use os.Args[0] for self starting wails by [@stffabi](https://github.com/stffabi) in #1258
|
||||||
- [v2, windows] Windows switch scheme: https -> http by @stefpap in #1255
|
- [v2, windows] Windows switch scheme: https -> http by @stefpap in #1255
|
||||||
- Ensure Focus is regained by Webview2 when tabbing by [@leaanthony](https://github.com/leaanthony) in #1257
|
- Ensure Focus is regained by Webview2 when tabbing by [@leaanthony](https://github.com/leaanthony) in #1257
|
||||||
- Try to focus window when Show() is called. by [@leaanthony](https://github.com/leaanthony) in #1212
|
- Try to focus window when Show() is called. by [@leaanthony](https://github.com/leaanthony) in #1212 by [@leaanthony](https://github.com/leaanthony) in #1212
|
||||||
- Check system for user installed Linux dependencies by [@leaanthony](https://github.com/leaanthony) in #1180
|
- Check system for user installed Linux dependencies by [@leaanthony](https://github.com/leaanthony) in #1180
|
||||||
|
|
||||||
### 变更
|
### 变更
|
||||||
|
@ -179,6 +179,7 @@
|
|||||||
<td align="center"><a href="http://mai.car.ons"><img src="https://avatars.githubusercontent.com/u/101958587?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Maicarons J</b></sub></a><br /><a href="https://github.com/wailsapp/wails/commits?author=Maicarons2022" title="Documentation">📖</a></td>
|
<td align="center"><a href="http://mai.car.ons"><img src="https://avatars.githubusercontent.com/u/101958587?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Maicarons J</b></sub></a><br /><a href="https://github.com/wailsapp/wails/commits?author=Maicarons2022" title="Documentation">📖</a></td>
|
||||||
<td align="center"><a href="https://github.com/KiddoV"><img src="https://avatars.githubusercontent.com/u/28552977?v=4?s=75" width="75px;" alt=""/><br /><sub><b>kiddov</b></sub></a><br /><a href="https://github.com/wailsapp/wails/commits?author=KiddoV" title="Documentation">📖</a> <a href="#financial-KiddoV" title="Financial">💵</a> <a href="https://github.com/wailsapp/wails/commits?author=KiddoV" title="Tests">⚠️</a> <a href="#ideas-KiddoV" title="Ideas, Planning, & Feedback">🤔</a></td>
|
<td align="center"><a href="https://github.com/KiddoV"><img src="https://avatars.githubusercontent.com/u/28552977?v=4?s=75" width="75px;" alt=""/><br /><sub><b>kiddov</b></sub></a><br /><a href="https://github.com/wailsapp/wails/commits?author=KiddoV" title="Documentation">📖</a> <a href="#financial-KiddoV" title="Financial">💵</a> <a href="https://github.com/wailsapp/wails/commits?author=KiddoV" title="Tests">⚠️</a> <a href="#ideas-KiddoV" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||||
<td align="center"><a href="https://nicolas-coutin.com/"><img src="https://avatars.githubusercontent.com/u/6564012?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Nicolas Coutin</b></sub></a><br /><a href="#financial-Ilshidur" title="Financial">💵</a></td>
|
<td align="center"><a href="https://nicolas-coutin.com/"><img src="https://avatars.githubusercontent.com/u/6564012?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Nicolas Coutin</b></sub></a><br /><a href="#financial-Ilshidur" title="Financial">💵</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/ParvinEyvazov"><img src="https://avatars.githubusercontent.com/u/32189770?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Parvin Eyvazov</b></sub></a><br /><a href="https://github.com/wailsapp/wails/commits?author=ParvinEyvazov" title="Documentation">📖</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
"description": "The label of footer link with label=Github linking to https://github.com/wailsapp/wails"
|
"description": "The label of footer link with label=Github linking to https://github.com/wailsapp/wails"
|
||||||
},
|
},
|
||||||
"link.item.label.Twitter": {
|
"link.item.label.Twitter": {
|
||||||
"message": "Twitter",
|
"message": "Twitter(推特)",
|
||||||
"description": "The label of footer link with label=Twitter linking to https://twitter.com/wailsapp"
|
"description": "The label of footer link with label=Twitter linking to https://twitter.com/wailsapp"
|
||||||
},
|
},
|
||||||
"link.item.label.Slack": {
|
"link.item.label.Slack": {
|
||||||
|
@ -5,12 +5,12 @@ Wails includes support for obfuscating your application using [garble](https://g
|
|||||||
To produce an obfuscated build, you can use the `-obfuscate` flag with the `wails build` command:
|
To produce an obfuscated build, you can use the `-obfuscate` flag with the `wails build` command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wails build -obfuscate
|
wails build -obfuscated
|
||||||
```
|
```
|
||||||
To customise the obfuscation settings, you can use the `-garbleargs` flag:
|
To customise the obfuscation settings, you can use the `-garbleargs` flag:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wails build -obfuscate -garbleargs "-literals -tiny -seed=myrandomseed"
|
wails build -obfuscated -garbleargs "-literals -tiny -seed=myrandomseed"
|
||||||
```
|
```
|
||||||
|
|
||||||
These settings may be persisted in your [project config](/guides/reference/project-config).
|
These settings may be persisted in your [project config](/guides/reference/project-config).
|
||||||
|
Loading…
Reference in New Issue
Block a user