Documentation
¶
Index ¶
- func GetElementById[T any](v *View, id string) (elem T, ok bool)
- type CloseChan
- type CloseHandler
- type Context
- type View
- func (v *View) Destroy(ctx types.Context) (err error)
- func (v *View) Draw(gtx giolayout.Context) giolayout.Dimensions
- func (v *View) DrawView(ctx types.Context) giolayout.Dimensions
- func (v *View) ExportFunction(name string, fn any)
- func (v *View) FindBinding(name string) types.Bindable
- func (v *View) FindFunction(name string) any
- func (v *View) HandleEvents(ctx types.Context)
- func (v *View) Initialize(ctx types.Context) (err error)
- func (v *View) SetViewRoot(root types.UIElement)
- func (v *View) ViewModel() types.ViewModel
- type ViewModel
- type ViewScreen
- type Window
- func (wnd Window) Invalidate()
- func (wnd *Window) SetFullscreen(fullscreen bool)
- func (wnd *Window) SetMaxSize(size types.WindowSize)
- func (wnd *Window) SetMinSize(size types.WindowSize)
- func (wnd *Window) SetNavigationColor(color color.NRGBA)
- func (wnd *Window) SetSize(size types.WindowSize)
- func (wnd *Window) SetStatusColor(color color.NRGBA)
- func (wnd *Window) SetTitle(title string)
- func (wnd *Window) SetView(view types.View)
- func (wnd *Window) Show(view types.View) (CloseChan, error)
- func (wnd Window) Theme() *material.Theme
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CloseHandler ¶
type CloseHandler func()
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func NewContext(window *Window, e app.FrameEvent) *Context
NewContext creates a new Context with the given window and frame event.
Parameters: - window: a pointer to the Window struct. - e: the app.FrameEvent.
Returns: - a pointer to the newly created Context.
func (*Context) SetFontsDir ¶
type View ¶
func ConfigureView ¶
func (*View) ExportFunction ¶
func (*View) FindFunction ¶
func (*View) HandleEvents ¶
func (*View) SetViewRoot ¶
type ViewModel ¶
type ViewModel struct {
// contains filtered or unexported fields
}
func (*ViewModel) Initialize ¶
func (*ViewModel) RegisterBinding ¶
func (*ViewModel) RegisterBindings ¶
type ViewScreen ¶
type ViewScreen struct {
// contains filtered or unexported fields
}
func NewViewScreen ¶
func NewViewScreen( fs embed.FS, screenName string, ) *ViewScreen
type Window ¶
type Window struct { OnClose CloseHandler // OnClose callback // contains filtered or unexported fields }
func NewWindow ¶
NewWindow creates a new Window with the given title.
It returns a pointer to the newly created Window.
func (Window) Invalidate ¶
func (wnd Window) Invalidate()
func (*Window) SetFullscreen ¶
SetFullscreen sets the fullscreen mode for the window.
fullscreen: a boolean indicating whether the window should be in fullscreen mode or not.
func (*Window) SetMaxSize ¶
func (wnd *Window) SetMaxSize(size types.WindowSize)
SetMaxSize sets the maximum size of the Window.
It takes a types.WindowSize parameter `size` representing the new maximum size of the Window. If the Window is in the initialization state, the maximum size is stored in the `initState` field. Otherwise, the maximum size is directly applied to the window.
func (*Window) SetMinSize ¶
func (wnd *Window) SetMinSize(size types.WindowSize)
SetMinSize sets the minimum size of the Window.
It takes a types.WindowSize parameter `size` representing the new minimum size of the Window. If the Window is in the initialization state, the minimum size is stored in the `initState` field. Otherwise, the minimum size is directly applied to the window.
func (*Window) SetNavigationColor ¶
SetNavigationColor sets the navigation color of the windows Android navigation bar or the address bar in browsers.
It takes a color.NRGBA parameter `color` representing the new navigation color of the Window. If the Window is in the initialization state, the navigation color is stored in the `initState` field. Otherwise, the navigation color is directly applied to the window.
func (*Window) SetSize ¶
func (wnd *Window) SetSize(size types.WindowSize)
SetSize sets the size of the Window.
It takes a types.WindowSize parameter `size` representing the new size of the Window. If the Window is in the initialization state, the size is stored in the `initState` field. Otherwise, the size is directly applied to the window.
func (*Window) SetStatusColor ¶
SetStatusColor sets the status color of the windows Andoid status bar.
It takes a color.NRGBA parameter `color` representing the new status color bar color of the Android Window. If the Window is in the initialization state, the status color is stored in the `initState` field. Otherwise, the status color is directly applied to the window.
func (*Window) SetTitle ¶
SetTitle sets the title of the Window.
It takes a string parameter `title` representing the new title of the Window. If the Window is in the initialization state, the title is stored in the `initState` field. Otherwise the title is directly applied to the window.
func (*Window) SetView ¶
SetScreen sets the view for the Window.
This method swaps out the original view for the new view.