-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98aff77
commit c5bb4c7
Showing
39 changed files
with
683 additions
and
7,117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
|
||
### ShowAboutDialog | ||
|
||
API: `ShowAboutDialog()` | ||
|
||
`ShowAboutDialog()` shows an "About" dialog box. It can show the application's | ||
name, description and icon. | ||
|
||
```go | ||
// Show the about dialog | ||
app.ShowAboutDialog() | ||
``` | ||
|
||
### Info | ||
|
||
API: `InfoDialog()` | ||
|
||
`InfoDialog()` creates and returns a new instance of `MessageDialog` with an | ||
`InfoDialogType`. This dialog is typically used to display informational | ||
messages to the user. | ||
|
||
### Question | ||
|
||
API: `QuestionDialog()` | ||
|
||
`QuestionDialog()` creates and returns a new instance of `MessageDialog` with a | ||
`QuestionDialogType`. This dialog is often used to ask a question to the user | ||
and expect a response. | ||
|
||
### Warning | ||
|
||
API: `WarningDialog()` | ||
|
||
`WarningDialog()` creates and returns a new instance of `MessageDialog` with a | ||
`WarningDialogType`. As the name suggests, this dialog is primarily used to | ||
display warning messages to the user. | ||
|
||
### Error | ||
|
||
API: `ErrorDialog()` | ||
|
||
`ErrorDialog()` creates and returns a new instance of `MessageDialog` with an | ||
`ErrorDialogType`. This dialog is designed to be used when you need to display | ||
an error message to the user. | ||
|
||
### OpenFile | ||
|
||
API: `OpenFileDialog()` | ||
|
||
`OpenFileDialog()` creates and returns a new `OpenFileDialogStruct`. This dialog | ||
prompts the user to select one or more files from their file system. | ||
|
||
### SaveFile | ||
|
||
API: `SaveFileDialog()` | ||
|
||
`SaveFileDialog()` creates and returns a new `SaveFileDialogStruct`. This dialog | ||
prompts the user to choose a location on their file system where a file should | ||
be saved. | ||
|
||
### OpenDirectory | ||
|
||
API: `OpenDirectoryDialog()` | ||
|
||
`OpenDirectoryDialog()` creates and returns a new instance of `MessageDialog` | ||
with an `OpenDirectoryDialogType`. This dialog enables the user to choose a | ||
directory from their file system. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
### On | ||
|
||
API: | ||
`On(eventType events.ApplicationEventType, callback func(event *Event)) func()` | ||
|
||
`On()` registers an event listener for specific application events. The callback | ||
function provided will be triggered when the corresponding event occurs. The | ||
function returns a function that can be called to remove the listener. | ||
|
||
### RegisterHook | ||
|
||
API: | ||
`RegisterHook(eventType events.ApplicationEventType, callback func(event *Event)) func()` | ||
|
||
`RegisterHook()` registers a callback to be run as a hook during specific | ||
events. These hooks are run before listeners attached with `On()`. The function | ||
returns a function that can be called to remove the hook. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
### RegisterContextMenu | ||
|
||
API: `RegisterContextMenu(name string, menu *Menu)` | ||
|
||
`RegisterContextMenu()` registers a context menu with a given name. This menu | ||
can be used later in the application. | ||
|
||
```go | ||
|
||
// Create a new menu | ||
ctxmenu := app.NewMenu() | ||
|
||
// Register the menu as a context menu | ||
app.RegisterContextMenu("MyContextMenu", ctxmenu) | ||
``` | ||
|
||
### SetMenu | ||
|
||
API: `SetMenu(menu *Menu)` | ||
|
||
`SetMenu()` sets the menu for the application. On Mac, this will be the global | ||
menu. For Windows and Linux, this will be the default menu for any new window | ||
created. | ||
|
||
```go | ||
// Create a new menu | ||
menu := app.NewMenu() | ||
|
||
// Set the menu for the application | ||
app.SetMenu(menu) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
### GetPrimaryScreen | ||
|
||
API: `GetPrimaryScreen() (*Screen, error)` | ||
|
||
`GetPrimaryScreen()` returns the primary screen of the system. | ||
|
||
### GetScreens | ||
|
||
API: `GetScreens() ([]*Screen, error)` | ||
|
||
`GetScreens()` returns information about all screens attached to the system. | ||
|
||
This is a brief summary of the exported methods in the provided `App` struct. Do | ||
note that for more detailed functionality or considerations, refer to the actual | ||
Go code or further internal documentation. |
Oops, something went wrong.