widget

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Overview

Package widget provides Risor bindings for Fyne GUI widgets.

This package wraps Fyne v2 widgets for use in Risor v2 scripts, enabling cross-platform desktop GUI development with a simple scripting interface.

Available Widgets

Input Widgets:

  • Button: Clickable button with callback
  • Entry: Single-line text input with optional submit callback
  • MultiLineEntry: Multi-line text input
  • Check: Checkbox with changed callback
  • CheckGroup: Multiple checkboxes with changed callback
  • Select: Dropdown selection with changed callback
  • RadioGroup: Radio button group with changed callback
  • SelectEntry: Searchable dropdown with changed callback
  • Slider: Numeric value slider with changed callback

Display Widgets:

  • Label: Text display with writable Text property
  • Icon: Icon display from theme resources
  • Hyperlink: Clickable link with URL
  • ProgressBar: Value-based progress indicator
  • ProgressBarInfinite: Indeterminate progress spinner
  • Activity: Simple activity indicator
  • Separator: Visual separator line
  • Markdown: Markdown content renderer

Data Widgets:

  • Table: Paginated table with callbacks for data fetching
  • Tree: Hierarchical data display with callbacks
  • List: Scrolling list with item callbacks
  • Log: Read-only scrollable log display

Composite Widgets:

  • Form: Form with items and optional submit button
  • FormItem: Label + widget pair for forms
  • Card: Title, subtitle, and content card
  • Accordion: Collapsible sections with items
  • AccordionItem: Individual accordion section
  • Toolbar: Action toolbar with items

Risor v2 Syntax

All callbacks must use arrow function syntax:

let btn = widget.NewButton("Click", () => {
    window.SetStatus("Clicked!")
})

Thread Safety

All widget callbacks execute synchronously in the UI thread. The Risor VM is single-threaded and not thread-safe. Never spawn goroutines or use async patterns inside callbacks.

See CONCURRENCY.md for detailed information about thread safety.

Index

Constants

View Source
const AccordionItemType object.Type = "widget.AccordionItem"
View Source
const AccordionType object.Type = "widget.Accordion"
View Source
const ActivityType object.Type = "widget.Activity"
View Source
const ButtonType object.Type = "widget.Button"
View Source
const CalendarType object.Type = "widget.Calendar"
View Source
const CardType object.Type = "widget.Card"
View Source
const CheckGroupType object.Type = "widget.CheckGroup"
View Source
const CheckType object.Type = "widget.Check"
View Source
const DateEntryType object.Type = "widget.DateEntry"
View Source
const EntryType object.Type = "widget.Entry"
View Source
const FileIconType object.Type = "widget.FileIcon"
View Source
const FormItemType object.Type = "widget.FormItem"
View Source
const FormType object.Type = "widget.Form"
View Source
const GridWrapType object.Type = "widget.GridWrap"
View Source
const HyperlinkType object.Type = "widget.Hyperlink"
View Source
const IconType object.Type = "widget.Icon"
View Source
const LabelType object.Type = "widget.Label"
View Source
const ListType object.Type = "widget.List"
View Source
const LogType object.Type = "widget.Log"
View Source
const MarkdownType object.Type = "widget.Markdown"
View Source
const MenuItemType object.Type = "fyne.MenuItem"
View Source
const PopUpMenuType object.Type = "widget.PopUpMenu"
View Source
const PopUpType object.Type = "widget.PopUp"
View Source
const ProgressBarInfiniteType object.Type = "widget.ProgressBarInfinite"
View Source
const ProgressBarType object.Type = "widget.ProgressBar"
View Source
const RadioGroupType object.Type = "widget.RadioGroup"
View Source
const RichTextType object.Type = "widget.RichText"
View Source
const SelectEntryType object.Type = "widget.SelectEntry"
View Source
const SelectType object.Type = "widget.Select"
View Source
const SeparatorType object.Type = "widget.Separator"
View Source
const SliderType object.Type = "widget.Slider"
View Source
const TableType object.Type = "widget.Table"
View Source
const TextGridType object.Type = "widget.TextGrid"
View Source
const TextStyleType object.Type = "widget.TextStyle"
View Source
const ToolbarActionType object.Type = "widget.ToolbarAction"

ToolbarAction wraps a toolbar action button

View Source
const ToolbarSeparatorType object.Type = "widget.ToolbarSeparator"

ToolbarSeparator wraps a toolbar separator

View Source
const ToolbarSpacerType object.Type = "widget.ToolbarSpacer"

ToolbarSpacer wraps a toolbar spacer

View Source
const ToolbarType object.Type = "widget.Toolbar"
View Source
const TreeType object.Type = "widget.Tree"

Variables

This section is empty.

Functions

func GetThemeResource

func GetThemeResource(name string) fyne.Resource

GetThemeResource maps string names to theme icon resources

func NewFileIcon

func NewFileIcon(ctx context.Context, args ...object.Object) (object.Object, error)

func NewMenuItem

func NewMenuItem(w WindowInterface) func(ctx context.Context, args ...object.Object) (object.Object, error)

func NewMenuItemSeparator

func NewMenuItemSeparator(ctx context.Context, args ...object.Object) (object.Object, error)

func NewModalPopUp

func NewModalPopUp(ctx context.Context, args ...object.Object) (object.Object, error)

func NewPopUp

func NewPopUp(ctx context.Context, args ...object.Object) (object.Object, error)

func NewPopUpMenu

func NewPopUpMenu(ctx context.Context, args ...object.Object) (object.Object, error)

func NewRichText

func NewRichText(ctx context.Context, args ...object.Object) (object.Object, error)

func NewTextGrid

func NewTextGrid(ctx context.Context, args ...object.Object) (object.Object, error)

Types

type Accordion

type Accordion struct {
	// contains filtered or unexported fields
}

func NewAccordion

func NewAccordion(items ...*widget.AccordionItem) *Accordion

func (*Accordion) Attrs

func (obj *Accordion) Attrs() []object.AttrSpec

func (*Accordion) CanvasObject

func (obj *Accordion) CanvasObject() fyne.CanvasObject

func (*Accordion) Equals

func (obj *Accordion) Equals(other object.Object) bool

func (*Accordion) GetAttr

func (obj *Accordion) GetAttr(name string) (object.Object, bool)

func (*Accordion) Inspect

func (obj *Accordion) Inspect() string

func (*Accordion) Interface

func (obj *Accordion) Interface() interface{}

func (*Accordion) IsTruthy

func (obj *Accordion) IsTruthy() bool

func (*Accordion) MarshalJSON

func (obj *Accordion) MarshalJSON() ([]byte, error)

func (*Accordion) RunOperation

func (obj *Accordion) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Accordion) SetAttr

func (obj *Accordion) SetAttr(name string, value object.Object) error

func (*Accordion) Type

func (obj *Accordion) Type() object.Type

type AccordionItem

type AccordionItem struct {
	// contains filtered or unexported fields
}

AccordionItem wraps a Fyne AccordionItem

func NewAccordionItem

func NewAccordionItem(title string, detail string, content fyne.CanvasObject) *AccordionItem

func (*AccordionItem) Attrs

func (obj *AccordionItem) Attrs() []object.AttrSpec

func (*AccordionItem) Equals

func (obj *AccordionItem) Equals(other object.Object) bool

func (*AccordionItem) GetAttr

func (obj *AccordionItem) GetAttr(name string) (object.Object, bool)

func (*AccordionItem) Inspect

func (obj *AccordionItem) Inspect() string

func (*AccordionItem) Interface

func (obj *AccordionItem) Interface() interface{}

func (*AccordionItem) IsTruthy

func (obj *AccordionItem) IsTruthy() bool

func (*AccordionItem) MarshalJSON

func (obj *AccordionItem) MarshalJSON() ([]byte, error)

func (*AccordionItem) RunOperation

func (obj *AccordionItem) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*AccordionItem) SetAttr

func (obj *AccordionItem) SetAttr(name string, value object.Object) error

func (*AccordionItem) Type

func (obj *AccordionItem) Type() object.Type

type Activity

type Activity struct {
	// contains filtered or unexported fields
}

Activity wraps widget.Activity for Risor scripting

func NewActivity

func NewActivity() *Activity

NewActivity creates a new activity indicator

func (*Activity) Attrs

func (obj *Activity) Attrs() []object.AttrSpec

func (*Activity) CanvasObject

func (obj *Activity) CanvasObject() fyne.CanvasObject

func (*Activity) Cost

func (obj *Activity) Cost() int

func (*Activity) Equals

func (obj *Activity) Equals(other object.Object) bool

func (*Activity) GetAttr

func (obj *Activity) GetAttr(name string) (object.Object, bool)

func (*Activity) Inspect

func (obj *Activity) Inspect() string

func (*Activity) Interface

func (obj *Activity) Interface() interface{}

func (*Activity) IsTruthy

func (obj *Activity) IsTruthy() bool

func (*Activity) MarshalJSON

func (obj *Activity) MarshalJSON() ([]byte, error)

func (*Activity) RunOperation

func (obj *Activity) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Activity) SetAttr

func (obj *Activity) SetAttr(name string, value object.Object) error

func (*Activity) Type

func (obj *Activity) Type() object.Type

type Button

type Button struct {
	// contains filtered or unexported fields
}

func NewButton

func NewButton(label string, tapped func()) *Button

func (*Button) Attrs

func (obj *Button) Attrs() []object.AttrSpec

func (*Button) CanvasObject

func (obj *Button) CanvasObject() fyne.CanvasObject

func (*Button) Equals

func (obj *Button) Equals(other object.Object) bool

func (*Button) GetAttr

func (obj *Button) GetAttr(name string) (object.Object, bool)

func (*Button) Inspect

func (obj *Button) Inspect() string

func (*Button) Interface

func (obj *Button) Interface() interface{}

func (*Button) IsTruthy

func (obj *Button) IsTruthy() bool

func (*Button) MarshalJSON

func (obj *Button) MarshalJSON() ([]byte, error)

func (*Button) RunOperation

func (obj *Button) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Button) SetAttr

func (obj *Button) SetAttr(name string, value object.Object) error

func (*Button) Type

func (obj *Button) Type() object.Type

type Calendar

type Calendar struct {
	// contains filtered or unexported fields
}

Calendar wraps fyne's Calendar widget

func NewCalendar

func NewCalendar(w WindowInterface, startDate time.Time, onChanged func(time.Time)) *Calendar

func (*Calendar) Attrs

func (obj *Calendar) Attrs() []object.AttrSpec

func (*Calendar) CanvasObject

func (obj *Calendar) CanvasObject() fyne.CanvasObject

func (*Calendar) Cost

func (obj *Calendar) Cost() int

func (*Calendar) Equals

func (obj *Calendar) Equals(other object.Object) bool

func (*Calendar) GetAttr

func (obj *Calendar) GetAttr(name string) (object.Object, bool)

func (*Calendar) Inspect

func (obj *Calendar) Inspect() string

func (*Calendar) Interface

func (obj *Calendar) Interface() interface{}

func (*Calendar) IsTruthy

func (obj *Calendar) IsTruthy() bool

func (*Calendar) MarshalJSON

func (obj *Calendar) MarshalJSON() ([]byte, error)

func (*Calendar) RunOperation

func (obj *Calendar) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Calendar) SetAttr

func (obj *Calendar) SetAttr(name string, value object.Object) error

func (*Calendar) Type

func (obj *Calendar) Type() object.Type

type Card

type Card struct {
	// contains filtered or unexported fields
}

Card wraps widget.Card for Risor scripting

func NewCard

func NewCard(title, subtitle string, content fyne.CanvasObject) *Card

NewCard creates a new card widget

func (*Card) Attrs

func (obj *Card) Attrs() []object.AttrSpec

func (*Card) CanvasObject

func (obj *Card) CanvasObject() fyne.CanvasObject

func (*Card) Cost

func (obj *Card) Cost() int

func (*Card) Equals

func (obj *Card) Equals(other object.Object) bool

func (*Card) GetAttr

func (obj *Card) GetAttr(name string) (object.Object, bool)

func (*Card) Inspect

func (obj *Card) Inspect() string

func (*Card) Interface

func (obj *Card) Interface() interface{}

func (*Card) IsTruthy

func (obj *Card) IsTruthy() bool

func (*Card) MarshalJSON

func (obj *Card) MarshalJSON() ([]byte, error)

func (*Card) RunOperation

func (obj *Card) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Card) SetAttr

func (obj *Card) SetAttr(name string, value object.Object) error

func (*Card) Type

func (obj *Card) Type() object.Type

type Check

type Check struct {
	// contains filtered or unexported fields
}

func NewCheck

func NewCheck(label string, changed func(bool)) *Check

func NewCheckWithData

func NewCheckWithData(label string, data interface{ Get() (bool, error) }) *Check

func (*Check) Attrs

func (obj *Check) Attrs() []object.AttrSpec

func (*Check) CanvasObject

func (obj *Check) CanvasObject() fyne.CanvasObject

func (*Check) Equals

func (obj *Check) Equals(other object.Object) bool

func (*Check) GetAttr

func (obj *Check) GetAttr(name string) (object.Object, bool)

func (*Check) Inspect

func (obj *Check) Inspect() string

func (*Check) Interface

func (obj *Check) Interface() interface{}

func (*Check) IsTruthy

func (obj *Check) IsTruthy() bool

func (*Check) MarshalJSON

func (obj *Check) MarshalJSON() ([]byte, error)

func (*Check) RunOperation

func (obj *Check) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Check) SetAttr

func (obj *Check) SetAttr(name string, value object.Object) error

func (*Check) Type

func (obj *Check) Type() object.Type

type CheckGroup

type CheckGroup struct {
	// contains filtered or unexported fields
}

func NewCheckGroup

func NewCheckGroup(options []string, checked func([]string)) *CheckGroup

func (*CheckGroup) Attrs

func (obj *CheckGroup) Attrs() []object.AttrSpec

func (*CheckGroup) CanvasObject

func (obj *CheckGroup) CanvasObject() fyne.CanvasObject

func (*CheckGroup) Equals

func (obj *CheckGroup) Equals(other object.Object) bool

func (*CheckGroup) GetAttr

func (obj *CheckGroup) GetAttr(name string) (object.Object, bool)

func (*CheckGroup) Inspect

func (obj *CheckGroup) Inspect() string

func (*CheckGroup) Interface

func (obj *CheckGroup) Interface() interface{}

func (*CheckGroup) IsTruthy

func (obj *CheckGroup) IsTruthy() bool

func (*CheckGroup) MarshalJSON

func (obj *CheckGroup) MarshalJSON() ([]byte, error)

func (*CheckGroup) RunOperation

func (obj *CheckGroup) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*CheckGroup) SetAttr

func (obj *CheckGroup) SetAttr(name string, value object.Object) error

func (*CheckGroup) Type

func (obj *CheckGroup) Type() object.Type

type DateEntry

type DateEntry struct {
	// contains filtered or unexported fields
}

DateEntry wraps fyne's Entry widget with date picker (Fyne v2.6+)

func NewDateEntry

func NewDateEntry(w WindowInterface) *DateEntry

func (*DateEntry) Attrs

func (obj *DateEntry) Attrs() []object.AttrSpec

func (*DateEntry) CanvasObject

func (obj *DateEntry) CanvasObject() fyne.CanvasObject

func (*DateEntry) Cost

func (obj *DateEntry) Cost() int

func (*DateEntry) Equals

func (obj *DateEntry) Equals(other object.Object) bool

func (*DateEntry) GetAttr

func (obj *DateEntry) GetAttr(name string) (object.Object, bool)

func (*DateEntry) Inspect

func (obj *DateEntry) Inspect() string

func (*DateEntry) Interface

func (obj *DateEntry) Interface() interface{}

func (*DateEntry) IsTruthy

func (obj *DateEntry) IsTruthy() bool

func (*DateEntry) MarshalJSON

func (obj *DateEntry) MarshalJSON() ([]byte, error)

func (*DateEntry) RunOperation

func (obj *DateEntry) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*DateEntry) SetAttr

func (obj *DateEntry) SetAttr(name string, value object.Object) error

func (*DateEntry) Type

func (obj *DateEntry) Type() object.Type

type Entry

type Entry struct {
	// contains filtered or unexported fields
}

func NewEntry

func NewEntry(w WindowInterface) *Entry

func NewEntryWithData

func NewEntryWithData(data interface{ Get() (string, error) }, w WindowInterface) *Entry

NewEntryWithData creates a new entry bound to a string data binding (bi-directional)

func NewMultiLineEntry

func NewMultiLineEntry() *Entry

func (*Entry) Attrs

func (obj *Entry) Attrs() []object.AttrSpec

func (*Entry) CanvasObject

func (obj *Entry) CanvasObject() fyne.CanvasObject

func (*Entry) Equals

func (obj *Entry) Equals(other object.Object) bool

func (*Entry) GetAttr

func (obj *Entry) GetAttr(name string) (object.Object, bool)

func (*Entry) Inspect

func (obj *Entry) Inspect() string

func (*Entry) Interface

func (obj *Entry) Interface() interface{}

func (*Entry) IsTruthy

func (obj *Entry) IsTruthy() bool

func (*Entry) MarshalJSON

func (obj *Entry) MarshalJSON() ([]byte, error)

func (*Entry) RunOperation

func (obj *Entry) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Entry) SetAttr

func (obj *Entry) SetAttr(name string, value object.Object) error

func (*Entry) Type

func (obj *Entry) Type() object.Type

type FileIcon

type FileIcon struct {
	// contains filtered or unexported fields
}

FileIcon wraps fyne's FileIcon widget - displays an icon for files and folders.

FileIcon shows a visual representation of a file or folder with an appropriate icon based on the file type or path.

Example usage in Risor:

let icon = widget.NewFileIcon("file:///home/user/document.pdf")
window.SetContent(icon)

// Update to different file
icon.SetURI("file:///home/user/image.png")

The icon automatically selects the appropriate visual based on file extension.

func (*FileIcon) Attrs

func (obj *FileIcon) Attrs() []object.AttrSpec

func (*FileIcon) CanvasObject

func (obj *FileIcon) CanvasObject() fyne.CanvasObject

func (*FileIcon) Cost

func (obj *FileIcon) Cost() int

func (*FileIcon) Equals

func (obj *FileIcon) Equals(other object.Object) bool

func (*FileIcon) GetAttr

func (obj *FileIcon) GetAttr(name string) (object.Object, bool)

func (*FileIcon) Inspect

func (obj *FileIcon) Inspect() string

func (*FileIcon) Interface

func (obj *FileIcon) Interface() interface{}

func (*FileIcon) IsTruthy

func (obj *FileIcon) IsTruthy() bool

func (*FileIcon) MarshalJSON

func (obj *FileIcon) MarshalJSON() ([]byte, error)

func (*FileIcon) RunOperation

func (obj *FileIcon) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*FileIcon) SetAttr

func (obj *FileIcon) SetAttr(name string, value object.Object) error

func (*FileIcon) Type

func (obj *FileIcon) Type() object.Type

type Form

type Form struct {
	// contains filtered or unexported fields
}

func NewForm

func NewForm(items ...*widget.FormItem) *Form

func (*Form) Attrs

func (obj *Form) Attrs() []object.AttrSpec

func (*Form) CanvasObject

func (obj *Form) CanvasObject() fyne.CanvasObject

func (*Form) Equals

func (obj *Form) Equals(other object.Object) bool

func (*Form) GetAttr

func (obj *Form) GetAttr(name string) (object.Object, bool)

func (*Form) Inspect

func (obj *Form) Inspect() string

func (*Form) Interface

func (obj *Form) Interface() interface{}

func (*Form) IsTruthy

func (obj *Form) IsTruthy() bool

func (*Form) MarshalJSON

func (obj *Form) MarshalJSON() ([]byte, error)

func (*Form) RunOperation

func (obj *Form) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Form) SetAttr

func (obj *Form) SetAttr(name string, value object.Object) error

func (*Form) Type

func (obj *Form) Type() object.Type

type FormItem

type FormItem struct {
	// contains filtered or unexported fields
}

func NewFormItem

func NewFormItem(label string, item fyne.CanvasObject) *FormItem

func (*FormItem) Attrs

func (obj *FormItem) Attrs() []object.AttrSpec

func (*FormItem) Equals

func (obj *FormItem) Equals(other object.Object) bool

func (*FormItem) GetAttr

func (obj *FormItem) GetAttr(name string) (object.Object, bool)

func (*FormItem) Inspect

func (obj *FormItem) Inspect() string

func (*FormItem) Interface

func (obj *FormItem) Interface() interface{}

func (*FormItem) IsTruthy

func (obj *FormItem) IsTruthy() bool

func (*FormItem) MarshalJSON

func (obj *FormItem) MarshalJSON() ([]byte, error)

func (*FormItem) RunOperation

func (obj *FormItem) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*FormItem) SetAttr

func (obj *FormItem) SetAttr(name string, value object.Object) error

func (*FormItem) Type

func (obj *FormItem) Type() object.Type

type GenericCanvasObject

type GenericCanvasObject struct {
	// contains filtered or unexported fields
}

GenericCanvasObject is a minimal wrapper for canvas objects we don't have full bindings for

func (*GenericCanvasObject) Attrs

func (g *GenericCanvasObject) Attrs() []object.AttrSpec

func (*GenericCanvasObject) Cost

func (g *GenericCanvasObject) Cost() int

func (*GenericCanvasObject) Equals

func (g *GenericCanvasObject) Equals(other object.Object) bool

func (*GenericCanvasObject) GetAttr

func (g *GenericCanvasObject) GetAttr(name string) (object.Object, bool)

func (*GenericCanvasObject) Inspect

func (g *GenericCanvasObject) Inspect() string

func (*GenericCanvasObject) Interface

func (g *GenericCanvasObject) Interface() interface{}

func (*GenericCanvasObject) IsTruthy

func (g *GenericCanvasObject) IsTruthy() bool

func (*GenericCanvasObject) MarshalJSON

func (g *GenericCanvasObject) MarshalJSON() ([]byte, error)

func (*GenericCanvasObject) RunOperation

func (*GenericCanvasObject) SetAttr

func (g *GenericCanvasObject) SetAttr(name string, value object.Object) error

func (*GenericCanvasObject) Type

func (g *GenericCanvasObject) Type() object.Type

type GenericCanvasObjectTable added in v0.5.1

type GenericCanvasObjectTable struct {
	// contains filtered or unexported fields
}

GenericCanvasObjectTable is a minimal wrapper for canvas objects in tables

func (*GenericCanvasObjectTable) Attrs added in v0.5.1

func (*GenericCanvasObjectTable) CanvasObject added in v0.5.1

func (g *GenericCanvasObjectTable) CanvasObject() fyne.CanvasObject

func (*GenericCanvasObjectTable) Equals added in v0.5.1

func (g *GenericCanvasObjectTable) Equals(other object.Object) bool

func (*GenericCanvasObjectTable) GetAttr added in v0.5.1

func (g *GenericCanvasObjectTable) GetAttr(name string) (object.Object, bool)

func (*GenericCanvasObjectTable) Inspect added in v0.5.1

func (g *GenericCanvasObjectTable) Inspect() string

func (*GenericCanvasObjectTable) Interface added in v0.5.1

func (g *GenericCanvasObjectTable) Interface() interface{}

func (*GenericCanvasObjectTable) IsTruthy added in v0.5.1

func (g *GenericCanvasObjectTable) IsTruthy() bool

func (*GenericCanvasObjectTable) MarshalJSON added in v0.5.1

func (g *GenericCanvasObjectTable) MarshalJSON() ([]byte, error)

func (*GenericCanvasObjectTable) RunOperation added in v0.5.1

func (g *GenericCanvasObjectTable) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*GenericCanvasObjectTable) SetAttr added in v0.5.1

func (g *GenericCanvasObjectTable) SetAttr(name string, value object.Object) error

func (*GenericCanvasObjectTable) Type added in v0.5.1

type GridWrap

type GridWrap struct {
	// contains filtered or unexported fields
}

GridWrap wraps fyne's GridWrap widget - a grid layout with virtualized rendering.

GridWrap efficiently displays many items in a grid by only rendering visible items. It requires three callback functions to provide data:

  • Length(): Returns total item count
  • CreateItem(): Creates a template widget
  • UpdateItem(id, item): Populates a specific item

Example usage in Risor:

let grid = widget.NewGridWrap()
grid.Length(() => 100)
grid.CreateItem(() => widget.NewLabel(""))
grid.UpdateItem((id, item) => {
    item.SetText(sprintf("Item %d", id))
})
grid.Refresh()

Supports selection with OnSelected/OnUnselected callbacks.

func NewGridWrap

func NewGridWrap(w WindowInterface) *GridWrap

func (*GridWrap) Attrs

func (obj *GridWrap) Attrs() []object.AttrSpec

func (*GridWrap) CanvasObject

func (obj *GridWrap) CanvasObject() fyne.CanvasObject

func (*GridWrap) Cost

func (obj *GridWrap) Cost() int

func (*GridWrap) Equals

func (obj *GridWrap) Equals(other object.Object) bool

func (*GridWrap) GetAttr

func (obj *GridWrap) GetAttr(name string) (object.Object, bool)

func (*GridWrap) Inspect

func (obj *GridWrap) Inspect() string

func (*GridWrap) Interface

func (obj *GridWrap) Interface() interface{}

func (*GridWrap) IsTruthy

func (obj *GridWrap) IsTruthy() bool

func (*GridWrap) MarshalJSON

func (obj *GridWrap) MarshalJSON() ([]byte, error)

func (*GridWrap) RunOperation

func (obj *GridWrap) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*GridWrap) SetAttr

func (obj *GridWrap) SetAttr(name string, value object.Object) error

func (*GridWrap) Type

func (obj *GridWrap) Type() object.Type
type Hyperlink struct {
	// contains filtered or unexported fields
}

Hyperlink wraps widget.Hyperlink for Risor scripting

func NewHyperlink(text, urlStr string, w WindowInterface) (*Hyperlink, error)

NewHyperlink creates a new hyperlink widget

func (*Hyperlink) Attrs

func (obj *Hyperlink) Attrs() []object.AttrSpec

func (*Hyperlink) CanvasObject

func (obj *Hyperlink) CanvasObject() fyne.CanvasObject

func (*Hyperlink) Cost

func (obj *Hyperlink) Cost() int

func (*Hyperlink) Equals

func (obj *Hyperlink) Equals(other object.Object) bool

func (*Hyperlink) GetAttr

func (obj *Hyperlink) GetAttr(name string) (object.Object, bool)

func (*Hyperlink) Inspect

func (obj *Hyperlink) Inspect() string

func (*Hyperlink) Interface

func (obj *Hyperlink) Interface() interface{}

func (*Hyperlink) IsTruthy

func (obj *Hyperlink) IsTruthy() bool

func (*Hyperlink) MarshalJSON

func (obj *Hyperlink) MarshalJSON() ([]byte, error)

func (*Hyperlink) RunOperation

func (obj *Hyperlink) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Hyperlink) SetAttr

func (obj *Hyperlink) SetAttr(name string, value object.Object) error

func (*Hyperlink) Type

func (obj *Hyperlink) Type() object.Type

type Icon

type Icon struct {
	// contains filtered or unexported fields
}

Icon wraps widget.Icon for Risor scripting

func NewIcon

func NewIcon(resourceName string) (*Icon, error)

NewIcon creates a new icon widget with a theme resource

func (*Icon) Attrs

func (obj *Icon) Attrs() []object.AttrSpec

func (*Icon) CanvasObject

func (obj *Icon) CanvasObject() fyne.CanvasObject

func (*Icon) Cost

func (obj *Icon) Cost() int

func (*Icon) Equals

func (obj *Icon) Equals(other object.Object) bool

func (*Icon) GetAttr

func (obj *Icon) GetAttr(name string) (object.Object, bool)

func (*Icon) Inspect

func (obj *Icon) Inspect() string

func (*Icon) Interface

func (obj *Icon) Interface() interface{}

func (*Icon) IsTruthy

func (obj *Icon) IsTruthy() bool

func (*Icon) MarshalJSON

func (obj *Icon) MarshalJSON() ([]byte, error)

func (*Icon) RunOperation

func (obj *Icon) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Icon) SetAttr

func (obj *Icon) SetAttr(name string, value object.Object) error

func (*Icon) Type

func (obj *Icon) Type() object.Type

type ImageCellWrapper added in v0.5.1

type ImageCellWrapper struct {
	// contains filtered or unexported fields
}

ImageCellWrapper wraps an image in a table cell, allowing it to be updated

func (*ImageCellWrapper) Attrs added in v0.5.1

func (g *ImageCellWrapper) Attrs() []object.AttrSpec

func (*ImageCellWrapper) CanvasObject added in v0.5.1

func (g *ImageCellWrapper) CanvasObject() fyne.CanvasObject

func (*ImageCellWrapper) Equals added in v0.5.1

func (g *ImageCellWrapper) Equals(other object.Object) bool

func (*ImageCellWrapper) GetAttr added in v0.5.1

func (g *ImageCellWrapper) GetAttr(name string) (object.Object, bool)

func (*ImageCellWrapper) Inspect added in v0.5.1

func (g *ImageCellWrapper) Inspect() string

func (*ImageCellWrapper) Interface added in v0.5.1

func (g *ImageCellWrapper) Interface() interface{}

func (*ImageCellWrapper) IsTruthy added in v0.5.1

func (g *ImageCellWrapper) IsTruthy() bool

func (*ImageCellWrapper) MarshalJSON added in v0.5.1

func (g *ImageCellWrapper) MarshalJSON() ([]byte, error)

func (*ImageCellWrapper) RunOperation added in v0.5.1

func (g *ImageCellWrapper) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*ImageCellWrapper) SetAttr added in v0.5.1

func (g *ImageCellWrapper) SetAttr(name string, value object.Object) error

func (*ImageCellWrapper) Type added in v0.5.1

func (g *ImageCellWrapper) Type() object.Type

type IsCanvasObject

type IsCanvasObject interface {
	CanvasObject() fyne.CanvasObject
}

IsCanvasObject interface for objects that can be converted to fyne.CanvasObject

type Label

type Label struct {
	// contains filtered or unexported fields
}

func NewLabel

func NewLabel(text string) *Label

func NewLabelWithData

func NewLabelWithData(data interface{ Get() (string, error) }) *Label

func (*Label) Attrs

func (obj *Label) Attrs() []object.AttrSpec

func (*Label) CanvasObject

func (obj *Label) CanvasObject() fyne.CanvasObject

func (*Label) Equals

func (obj *Label) Equals(other object.Object) bool

func (*Label) GetAttr

func (obj *Label) GetAttr(name string) (object.Object, bool)

func (*Label) Inspect

func (obj *Label) Inspect() string

func (*Label) Interface

func (obj *Label) Interface() interface{}

func (*Label) IsTruthy

func (obj *Label) IsTruthy() bool

func (*Label) MarshalJSON

func (obj *Label) MarshalJSON() ([]byte, error)

func (*Label) RunOperation

func (obj *Label) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Label) SetAttr

func (obj *Label) SetAttr(name string, value object.Object) error

func (*Label) Type

func (obj *Label) Type() object.Type

type List

type List struct {
	// contains filtered or unexported fields
}

List wraps fyne's List widget - a scrolling list with virtualized rendering

func NewList

func NewList(w WindowInterface) *List

func (*List) Attrs

func (obj *List) Attrs() []object.AttrSpec

func (*List) CanvasObject

func (obj *List) CanvasObject() fyne.CanvasObject

func (*List) Cost

func (obj *List) Cost() int

func (*List) Equals

func (obj *List) Equals(other object.Object) bool

func (*List) GetAttr

func (obj *List) GetAttr(name string) (object.Object, bool)

func (*List) Inspect

func (obj *List) Inspect() string

func (*List) Interface

func (obj *List) Interface() interface{}

func (*List) IsTruthy

func (obj *List) IsTruthy() bool

func (*List) MarshalJSON

func (obj *List) MarshalJSON() ([]byte, error)

func (*List) RunOperation

func (obj *List) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*List) SetAttr

func (obj *List) SetAttr(name string, value object.Object) error

func (*List) Type

func (obj *List) Type() object.Type

type Log

type Log struct {
	// contains filtered or unexported fields
}

func NewLog

func NewLog(maxItems int) *Log

func (*Log) AppendGo added in v0.6.1

func (obj *Log) AppendGo(line string)

AppendGo appends a line from Go code without entering the Risor VM. The stdout-capture path uses this so it can run concurrently with a go() script goroutine (which holds the single, non-threadsafe VM) without corrupting it.

func (*Log) Attrs

func (obj *Log) Attrs() []object.AttrSpec

func (*Log) CanvasObject

func (obj *Log) CanvasObject() fyne.CanvasObject

func (*Log) Equals

func (obj *Log) Equals(other object.Object) bool

func (*Log) GetAttr

func (obj *Log) GetAttr(name string) (object.Object, bool)

func (*Log) Inspect

func (obj *Log) Inspect() string

func (*Log) Interface

func (obj *Log) Interface() interface{}

func (*Log) IsTruthy

func (obj *Log) IsTruthy() bool

func (*Log) MarshalJSON

func (obj *Log) MarshalJSON() ([]byte, error)

func (*Log) RunOperation

func (obj *Log) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Log) SetAttr

func (obj *Log) SetAttr(name string, value object.Object) error

func (*Log) Type

func (obj *Log) Type() object.Type

type Markdown

type Markdown struct {
	// contains filtered or unexported fields
}

func NewMarkdown

func NewMarkdown(markdown string) *Markdown

func (*Markdown) Attrs

func (obj *Markdown) Attrs() []object.AttrSpec

func (*Markdown) CanvasObject

func (obj *Markdown) CanvasObject() fyne.CanvasObject

func (*Markdown) Equals

func (obj *Markdown) Equals(other object.Object) bool

func (*Markdown) GetAttr

func (obj *Markdown) GetAttr(name string) (object.Object, bool)

func (*Markdown) Inspect

func (obj *Markdown) Inspect() string

func (*Markdown) Interface

func (obj *Markdown) Interface() interface{}

func (*Markdown) IsTruthy

func (obj *Markdown) IsTruthy() bool

func (*Markdown) MarshalJSON

func (obj *Markdown) MarshalJSON() ([]byte, error)

func (*Markdown) RunOperation

func (obj *Markdown) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Markdown) SetAttr

func (obj *Markdown) SetAttr(name string, value object.Object) error

func (*Markdown) Type

func (obj *Markdown) Type() object.Type
type MenuItem struct {
	// contains filtered or unexported fields
}

MenuItem wraps fyne's MenuItem - a single item in a menu.

MenuItem represents one entry in a menu with a label and optional action callback.

Example usage in Risor:

let item1 = fyne.NewMenuItem("Open", () => { print("Open clicked") })
let item2 = fyne.NewMenuItem("Save", () => { print("Save clicked") })
let separator = fyne.NewMenuItemSeparator()

Properties:

  • Label: Item text
  • Disabled: Whether item is disabled
  • Checked: Whether item shows checkmark
func (obj *MenuItem) Attrs() []object.AttrSpec
func (obj *MenuItem) Cost() int
func (obj *MenuItem) Equals(other object.Object) bool
func (obj *MenuItem) GetAttr(name string) (object.Object, bool)
func (obj *MenuItem) Inspect() string
func (obj *MenuItem) Instance() *fyne.MenuItem
func (obj *MenuItem) Interface() interface{}
func (obj *MenuItem) IsTruthy() bool
func (obj *MenuItem) MarshalJSON() ([]byte, error)
func (obj *MenuItem) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)
func (obj *MenuItem) SetAttr(name string, value object.Object) error
func (obj *MenuItem) Type() object.Type
type PopUp struct {
	// contains filtered or unexported fields
}

PopUp wraps fyne's PopUp widget - a floating overlay above the UI.

PopUp displays content in a floating window above other widgets with a shadow. Can be modal (blocks interaction) or non-modal.

Example usage in Risor:

let content = container.NewVBox(
    widget.NewLabel("This is a popup!"),
    widget.NewButton("Close", () => popup.Hide())
)
let popup = widget.NewPopUp(content, window.Canvas)
popup.Show()

// Modal popup (blocks interaction with background)
let modal = widget.NewModalPopUp(content, window.Canvas)
modal.Show()

Methods:

  • Show(): Display the popup
  • Hide(): Hide the popup
  • ShowAtPosition(x, y): Show at specific screen coordinates

func (*PopUp) Attrs

func (obj *PopUp) Attrs() []object.AttrSpec

func (*PopUp) CanvasObject

func (obj *PopUp) CanvasObject() fyne.CanvasObject

func (*PopUp) Cost

func (obj *PopUp) Cost() int

func (*PopUp) Equals

func (obj *PopUp) Equals(other object.Object) bool

func (*PopUp) GetAttr

func (obj *PopUp) GetAttr(name string) (object.Object, bool)

func (*PopUp) Inspect

func (obj *PopUp) Inspect() string

func (*PopUp) Interface

func (obj *PopUp) Interface() interface{}

func (*PopUp) IsTruthy

func (obj *PopUp) IsTruthy() bool

func (*PopUp) MarshalJSON

func (obj *PopUp) MarshalJSON() ([]byte, error)

func (*PopUp) RunOperation

func (obj *PopUp) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*PopUp) SetAttr

func (obj *PopUp) SetAttr(name string, value object.Object) error

func (*PopUp) Type

func (obj *PopUp) Type() object.Type

type PopUpMenu

type PopUpMenu struct {
	// contains filtered or unexported fields
}

PopUpMenu wraps fyne's PopUpMenu widget - a menu displayed in an overlay.

PopUpMenu displays a menu in a floating overlay, commonly used for context menus.

Example usage in Risor:

let item1 = fyne.NewMenuItem("Copy", () => { print("Copy") })
let item2 = fyne.NewMenuItem("Paste", () => { print("Paste") })
let menu = fyne.NewMenu("Edit", item1, item2)
let popupMenu = widget.NewPopUpMenu(menu, window.Canvas)
popupMenu.ShowAtPosition(100, 100)

Methods:

  • Show(): Display the menu
  • Hide(): Hide the menu
  • ShowAtPosition(x, y): Show at specific coordinates

func (*PopUpMenu) Attrs

func (obj *PopUpMenu) Attrs() []object.AttrSpec

func (*PopUpMenu) CanvasObject

func (obj *PopUpMenu) CanvasObject() fyne.CanvasObject

func (*PopUpMenu) Cost

func (obj *PopUpMenu) Cost() int

func (*PopUpMenu) Equals

func (obj *PopUpMenu) Equals(other object.Object) bool

func (*PopUpMenu) GetAttr

func (obj *PopUpMenu) GetAttr(name string) (object.Object, bool)

func (*PopUpMenu) Inspect

func (obj *PopUpMenu) Inspect() string

func (*PopUpMenu) Interface

func (obj *PopUpMenu) Interface() interface{}

func (*PopUpMenu) IsTruthy

func (obj *PopUpMenu) IsTruthy() bool

func (*PopUpMenu) MarshalJSON

func (obj *PopUpMenu) MarshalJSON() ([]byte, error)

func (*PopUpMenu) RunOperation

func (obj *PopUpMenu) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*PopUpMenu) SetAttr

func (obj *PopUpMenu) SetAttr(name string, value object.Object) error

func (*PopUpMenu) Type

func (obj *PopUpMenu) Type() object.Type

type ProgressBar

type ProgressBar struct {
	// contains filtered or unexported fields
}

ProgressBar wraps widget.ProgressBar for Risor scripting

func NewProgressBar

func NewProgressBar() *ProgressBar

NewProgressBar creates a new progress bar (default Min=0, Max=1)

func NewProgressBarWithData

func NewProgressBarWithData(data interface{ Get() (float64, error) }) *ProgressBar

NewProgressBarWithData creates a new progress bar bound to a float data binding

func (*ProgressBar) Attrs

func (obj *ProgressBar) Attrs() []object.AttrSpec

func (*ProgressBar) CanvasObject

func (obj *ProgressBar) CanvasObject() fyne.CanvasObject

func (*ProgressBar) Cost

func (obj *ProgressBar) Cost() int

func (*ProgressBar) Equals

func (obj *ProgressBar) Equals(other object.Object) bool

func (*ProgressBar) GetAttr

func (obj *ProgressBar) GetAttr(name string) (object.Object, bool)

func (*ProgressBar) Inspect

func (obj *ProgressBar) Inspect() string

func (*ProgressBar) Interface

func (obj *ProgressBar) Interface() interface{}

func (*ProgressBar) IsTruthy

func (obj *ProgressBar) IsTruthy() bool

func (*ProgressBar) MarshalJSON

func (obj *ProgressBar) MarshalJSON() ([]byte, error)

func (*ProgressBar) RunOperation

func (obj *ProgressBar) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*ProgressBar) SetAttr

func (obj *ProgressBar) SetAttr(name string, value object.Object) error

func (*ProgressBar) Type

func (obj *ProgressBar) Type() object.Type

type ProgressBarInfinite

type ProgressBarInfinite struct {
	// contains filtered or unexported fields
}

ProgressBarInfinite wraps widget.ProgressBarInfinite for Risor scripting

func NewProgressBarInfinite

func NewProgressBarInfinite() *ProgressBarInfinite

NewProgressBarInfinite creates a new infinite progress bar

func (*ProgressBarInfinite) Attrs

func (obj *ProgressBarInfinite) Attrs() []object.AttrSpec

func (*ProgressBarInfinite) CanvasObject

func (obj *ProgressBarInfinite) CanvasObject() fyne.CanvasObject

func (*ProgressBarInfinite) Cost

func (obj *ProgressBarInfinite) Cost() int

func (*ProgressBarInfinite) Equals

func (obj *ProgressBarInfinite) Equals(other object.Object) bool

func (*ProgressBarInfinite) GetAttr

func (obj *ProgressBarInfinite) GetAttr(name string) (object.Object, bool)

func (*ProgressBarInfinite) Inspect

func (obj *ProgressBarInfinite) Inspect() string

func (*ProgressBarInfinite) Interface

func (obj *ProgressBarInfinite) Interface() interface{}

func (*ProgressBarInfinite) IsTruthy

func (obj *ProgressBarInfinite) IsTruthy() bool

func (*ProgressBarInfinite) MarshalJSON

func (obj *ProgressBarInfinite) MarshalJSON() ([]byte, error)

func (*ProgressBarInfinite) RunOperation

func (obj *ProgressBarInfinite) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*ProgressBarInfinite) SetAttr

func (obj *ProgressBarInfinite) SetAttr(name string, value object.Object) error

func (*ProgressBarInfinite) Type

func (obj *ProgressBarInfinite) Type() object.Type

type RadioGroup

type RadioGroup struct {
	// contains filtered or unexported fields
}

func NewRadioGroup

func NewRadioGroup(options []string, onChange func(string)) *RadioGroup

func (*RadioGroup) Attrs

func (obj *RadioGroup) Attrs() []object.AttrSpec

func (*RadioGroup) CanvasObject

func (obj *RadioGroup) CanvasObject() fyne.CanvasObject

func (*RadioGroup) Equals

func (obj *RadioGroup) Equals(other object.Object) bool

func (*RadioGroup) GetAttr

func (obj *RadioGroup) GetAttr(name string) (object.Object, bool)

func (*RadioGroup) Inspect

func (obj *RadioGroup) Inspect() string

func (*RadioGroup) Interface

func (obj *RadioGroup) Interface() interface{}

func (*RadioGroup) IsTruthy

func (obj *RadioGroup) IsTruthy() bool

func (*RadioGroup) MarshalJSON

func (obj *RadioGroup) MarshalJSON() ([]byte, error)

func (*RadioGroup) RunOperation

func (obj *RadioGroup) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*RadioGroup) SetAttr

func (obj *RadioGroup) SetAttr(name string, value object.Object) error

func (*RadioGroup) Type

func (obj *RadioGroup) Type() object.Type

type RichText

type RichText struct {
	// contains filtered or unexported fields
}

RichText wraps fyne's RichText widget - formatted text with markdown support.

RichText displays formatted text with support for bold, italic, headers, links, lists, and more through markdown parsing. Direct segment manipulation is not exposed in Risor bindings - use ParseMarkdown() instead.

Example usage in Risor:

let text = widget.NewRichText(`# Welcome

This supports **bold** and *italic* text, as well as [links](https://example.com).
`)

// Update content dynamically
text.ParseMarkdown("## New Content\n\nWith different **formatting**.")

// Control wrapping
text.Wrapping = 2  // 0=off, 1=break, 2=word

Properties:

  • Wrapping: Text wrap mode (0=off, 1=break, 2=word)
  • Truncation: Truncation mode (0=off, 1=clip, 2=ellipsis)
  • Scroll: Scroll direction (0=none, 1=horizontal, 2=vertical, 3=both)

Note: Complex segment types (Image, List, Paragraph) not fully supported. Use ParseMarkdown() for rich formatting.

func (*RichText) Attrs

func (obj *RichText) Attrs() []object.AttrSpec

func (*RichText) CanvasObject

func (obj *RichText) CanvasObject() fyne.CanvasObject

func (*RichText) Cost

func (obj *RichText) Cost() int

func (*RichText) Equals

func (obj *RichText) Equals(other object.Object) bool

func (*RichText) GetAttr

func (obj *RichText) GetAttr(name string) (object.Object, bool)

func (*RichText) Inspect

func (obj *RichText) Inspect() string

func (*RichText) Interface

func (obj *RichText) Interface() interface{}

func (*RichText) IsTruthy

func (obj *RichText) IsTruthy() bool

func (*RichText) MarshalJSON

func (obj *RichText) MarshalJSON() ([]byte, error)

func (*RichText) RunOperation

func (obj *RichText) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*RichText) SetAttr

func (obj *RichText) SetAttr(name string, value object.Object) error

func (*RichText) Type

func (obj *RichText) Type() object.Type

type Select

type Select struct {
	// contains filtered or unexported fields
}

func NewSelect

func NewSelect(options []string, changed func(string)) *Select

func (*Select) Attrs

func (obj *Select) Attrs() []object.AttrSpec

func (*Select) CanvasObject

func (obj *Select) CanvasObject() fyne.CanvasObject

func (*Select) Equals

func (obj *Select) Equals(other object.Object) bool

func (*Select) GetAttr

func (obj *Select) GetAttr(name string) (object.Object, bool)

func (*Select) Inspect

func (obj *Select) Inspect() string

func (*Select) Interface

func (obj *Select) Interface() interface{}

func (*Select) IsTruthy

func (obj *Select) IsTruthy() bool

func (*Select) MarshalJSON

func (obj *Select) MarshalJSON() ([]byte, error)

func (*Select) RunOperation

func (obj *Select) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Select) SetAttr

func (obj *Select) SetAttr(name string, value object.Object) error

func (*Select) Type

func (obj *Select) Type() object.Type

type SelectEntry

type SelectEntry struct {
	// contains filtered or unexported fields
}

SelectEntry wraps fyne's SelectEntry widget - a searchable dropdown entry

func NewSelectEntry

func NewSelectEntry(w WindowInterface, options []string, onChanged func(string)) *SelectEntry

func (*SelectEntry) Attrs

func (obj *SelectEntry) Attrs() []object.AttrSpec

func (*SelectEntry) CanvasObject

func (obj *SelectEntry) CanvasObject() fyne.CanvasObject

func (*SelectEntry) Cost

func (obj *SelectEntry) Cost() int

func (*SelectEntry) Equals

func (obj *SelectEntry) Equals(other object.Object) bool

func (*SelectEntry) GetAttr

func (obj *SelectEntry) GetAttr(name string) (object.Object, bool)

func (*SelectEntry) Inspect

func (obj *SelectEntry) Inspect() string

func (*SelectEntry) Interface

func (obj *SelectEntry) Interface() interface{}

func (*SelectEntry) IsTruthy

func (obj *SelectEntry) IsTruthy() bool

func (*SelectEntry) MarshalJSON

func (obj *SelectEntry) MarshalJSON() ([]byte, error)

func (*SelectEntry) RunOperation

func (obj *SelectEntry) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*SelectEntry) SetAttr

func (obj *SelectEntry) SetAttr(name string, value object.Object) error

func (*SelectEntry) Type

func (obj *SelectEntry) Type() object.Type

type Separator

type Separator struct {
	// contains filtered or unexported fields
}

Separator wraps widget.Separator for Risor scripting

func NewSeparator

func NewSeparator() *Separator

NewSeparator creates a new horizontal separator

func (*Separator) Attrs

func (obj *Separator) Attrs() []object.AttrSpec

func (*Separator) CanvasObject

func (obj *Separator) CanvasObject() fyne.CanvasObject

func (*Separator) Cost

func (obj *Separator) Cost() int

func (*Separator) Equals

func (obj *Separator) Equals(other object.Object) bool

func (*Separator) GetAttr

func (obj *Separator) GetAttr(name string) (object.Object, bool)

func (*Separator) Inspect

func (obj *Separator) Inspect() string

func (*Separator) Interface

func (obj *Separator) Interface() interface{}

func (*Separator) IsTruthy

func (obj *Separator) IsTruthy() bool

func (*Separator) MarshalJSON

func (obj *Separator) MarshalJSON() ([]byte, error)

func (*Separator) RunOperation

func (obj *Separator) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Separator) SetAttr

func (obj *Separator) SetAttr(name string, value object.Object) error

func (*Separator) Type

func (obj *Separator) Type() object.Type

type Slider

type Slider struct {
	// contains filtered or unexported fields
}

Slider wraps widget.Slider for Risor scripting

func NewSlider

func NewSlider(min, max float64, w WindowInterface) *Slider

NewSlider creates a new slider with min and max values

func NewSliderWithData

func NewSliderWithData(min, max float64, data interface{ Get() (float64, error) }, w WindowInterface) *Slider

func (*Slider) Attrs

func (obj *Slider) Attrs() []object.AttrSpec

func (*Slider) CanvasObject

func (obj *Slider) CanvasObject() fyne.CanvasObject

func (*Slider) Cost

func (obj *Slider) Cost() int

func (*Slider) Equals

func (obj *Slider) Equals(other object.Object) bool

func (*Slider) GetAttr

func (obj *Slider) GetAttr(name string) (object.Object, bool)

func (*Slider) Inspect

func (obj *Slider) Inspect() string

func (*Slider) Interface

func (obj *Slider) Interface() interface{}

func (*Slider) IsTruthy

func (obj *Slider) IsTruthy() bool

func (*Slider) MarshalJSON

func (obj *Slider) MarshalJSON() ([]byte, error)

func (*Slider) RunOperation

func (obj *Slider) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Slider) SetAttr

func (obj *Slider) SetAttr(name string, value object.Object) error

func (*Slider) Type

func (obj *Slider) Type() object.Type

type Table

type Table struct {
	Columns func() []string
	// contains filtered or unexported fields
}

func NewTable

func NewTable(title string, pageSize int, w WindowInterface) *Table

func (*Table) Attrs

func (obj *Table) Attrs() []object.AttrSpec

func (*Table) CanvasObject

func (obj *Table) CanvasObject() fyne.CanvasObject

func (*Table) Equals

func (obj *Table) Equals(other object.Object) bool

func (*Table) GetAttr

func (obj *Table) GetAttr(name string) (object.Object, bool)

func (*Table) Inspect

func (obj *Table) Inspect() string

func (*Table) Interface

func (obj *Table) Interface() interface{}

func (*Table) IsTruthy

func (obj *Table) IsTruthy() bool

func (*Table) MarshalJSON

func (obj *Table) MarshalJSON() ([]byte, error)

func (*Table) RunOperation

func (obj *Table) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Table) SetAttr

func (obj *Table) SetAttr(name string, value object.Object) error

func (*Table) Type

func (obj *Table) Type() object.Type

type TextGrid

type TextGrid struct {
	// contains filtered or unexported fields
}

TextGrid wraps fyne's TextGrid widget - a monospace text grid for displaying code or tabular data.

TextGrid displays text in a fixed-width font with optional line numbers and whitespace indicators. Perfect for code editors, terminals, and tabular data.

Example usage in Risor:

let grid = widget.NewTextGrid()
grid.ShowLineNumbers = true
grid.TabWidth = 4
grid.SetText("function hello() {\n    return 42\n}")

// Modify individual rows
grid.SetRow(0, "// Modified first line")
let text = grid.Row(0)
let count = grid.RowCount()

Properties:

  • Text: Full text content
  • TabWidth: Number of spaces per tab (default: 4)
  • ShowLineNumbers: Display line numbers
  • ShowWhitespace: Display tabs and spaces

func (*TextGrid) Attrs

func (obj *TextGrid) Attrs() []object.AttrSpec

func (*TextGrid) CanvasObject

func (obj *TextGrid) CanvasObject() fyne.CanvasObject

func (*TextGrid) Cost

func (obj *TextGrid) Cost() int

func (*TextGrid) Equals

func (obj *TextGrid) Equals(other object.Object) bool

func (*TextGrid) GetAttr

func (obj *TextGrid) GetAttr(name string) (object.Object, bool)

func (*TextGrid) Inspect

func (obj *TextGrid) Inspect() string

func (*TextGrid) Interface

func (obj *TextGrid) Interface() interface{}

func (*TextGrid) IsTruthy

func (obj *TextGrid) IsTruthy() bool

func (*TextGrid) MarshalJSON

func (obj *TextGrid) MarshalJSON() ([]byte, error)

func (*TextGrid) RunOperation

func (obj *TextGrid) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*TextGrid) SetAttr

func (obj *TextGrid) SetAttr(name string, value object.Object) error

func (*TextGrid) Type

func (obj *TextGrid) Type() object.Type

type TextStyle

type TextStyle struct {
	// contains filtered or unexported fields
}

TextStyle wraps fyne.TextStyle and provides access to Bold, Italic, Monospace, etc.

func NewTextStyle

func NewTextStyle(style *fyne.TextStyle, widget *widget.Label) *TextStyle

func (*TextStyle) Attrs

func (obj *TextStyle) Attrs() []object.AttrSpec

func (*TextStyle) Equals

func (obj *TextStyle) Equals(other object.Object) bool

func (*TextStyle) GetAttr

func (obj *TextStyle) GetAttr(name string) (object.Object, bool)

func (*TextStyle) Inspect

func (obj *TextStyle) Inspect() string

func (*TextStyle) Interface

func (obj *TextStyle) Interface() interface{}

func (*TextStyle) IsTruthy

func (obj *TextStyle) IsTruthy() bool

func (*TextStyle) MarshalJSON

func (obj *TextStyle) MarshalJSON() ([]byte, error)

func (*TextStyle) RunOperation

func (obj *TextStyle) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*TextStyle) SetAttr

func (obj *TextStyle) SetAttr(name string, value object.Object) error

func (*TextStyle) Type

func (obj *TextStyle) Type() object.Type

type Toolbar

type Toolbar struct {
	// contains filtered or unexported fields
}

func NewToolbar

func NewToolbar(items ...widget.ToolbarItem) *Toolbar

func (*Toolbar) Attrs

func (obj *Toolbar) Attrs() []object.AttrSpec

func (*Toolbar) CanvasObject

func (obj *Toolbar) CanvasObject() fyne.CanvasObject

func (*Toolbar) Equals

func (obj *Toolbar) Equals(other object.Object) bool

func (*Toolbar) GetAttr

func (obj *Toolbar) GetAttr(name string) (object.Object, bool)

func (*Toolbar) Inspect

func (obj *Toolbar) Inspect() string

func (*Toolbar) Interface

func (obj *Toolbar) Interface() interface{}

func (*Toolbar) IsTruthy

func (obj *Toolbar) IsTruthy() bool

func (*Toolbar) MarshalJSON

func (obj *Toolbar) MarshalJSON() ([]byte, error)

func (*Toolbar) RunOperation

func (obj *Toolbar) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Toolbar) SetAttr

func (obj *Toolbar) SetAttr(name string, value object.Object) error

func (*Toolbar) Type

func (obj *Toolbar) Type() object.Type

type ToolbarAction

type ToolbarAction struct {
	// contains filtered or unexported fields
}

func NewToolbarAction

func NewToolbarAction(icon fyne.Resource, onActivated func()) *ToolbarAction

func (*ToolbarAction) Attrs

func (obj *ToolbarAction) Attrs() []object.AttrSpec

func (*ToolbarAction) Equals

func (obj *ToolbarAction) Equals(other object.Object) bool

func (*ToolbarAction) GetAttr

func (obj *ToolbarAction) GetAttr(name string) (object.Object, bool)

func (*ToolbarAction) Inspect

func (obj *ToolbarAction) Inspect() string

func (*ToolbarAction) Interface

func (obj *ToolbarAction) Interface() interface{}

func (*ToolbarAction) IsTruthy

func (obj *ToolbarAction) IsTruthy() bool

func (*ToolbarAction) MarshalJSON

func (obj *ToolbarAction) MarshalJSON() ([]byte, error)

func (*ToolbarAction) RunOperation

func (obj *ToolbarAction) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*ToolbarAction) SetAttr

func (obj *ToolbarAction) SetAttr(name string, value object.Object) error

func (*ToolbarAction) Type

func (obj *ToolbarAction) Type() object.Type

type ToolbarSeparator

type ToolbarSeparator struct {
	// contains filtered or unexported fields
}

func NewToolbarSeparator

func NewToolbarSeparator() *ToolbarSeparator

func (*ToolbarSeparator) Attrs

func (obj *ToolbarSeparator) Attrs() []object.AttrSpec

func (*ToolbarSeparator) Equals

func (obj *ToolbarSeparator) Equals(other object.Object) bool

func (*ToolbarSeparator) GetAttr

func (obj *ToolbarSeparator) GetAttr(name string) (object.Object, bool)

func (*ToolbarSeparator) Inspect

func (obj *ToolbarSeparator) Inspect() string

func (*ToolbarSeparator) Interface

func (obj *ToolbarSeparator) Interface() interface{}

func (*ToolbarSeparator) IsTruthy

func (obj *ToolbarSeparator) IsTruthy() bool

func (*ToolbarSeparator) MarshalJSON

func (obj *ToolbarSeparator) MarshalJSON() ([]byte, error)

func (*ToolbarSeparator) RunOperation

func (obj *ToolbarSeparator) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*ToolbarSeparator) SetAttr

func (obj *ToolbarSeparator) SetAttr(name string, value object.Object) error

func (*ToolbarSeparator) Type

func (obj *ToolbarSeparator) Type() object.Type

type ToolbarSpacer

type ToolbarSpacer struct {
	// contains filtered or unexported fields
}

func NewToolbarSpacer

func NewToolbarSpacer() *ToolbarSpacer

func (*ToolbarSpacer) Attrs

func (obj *ToolbarSpacer) Attrs() []object.AttrSpec

func (*ToolbarSpacer) Equals

func (obj *ToolbarSpacer) Equals(other object.Object) bool

func (*ToolbarSpacer) GetAttr

func (obj *ToolbarSpacer) GetAttr(name string) (object.Object, bool)

func (*ToolbarSpacer) Inspect

func (obj *ToolbarSpacer) Inspect() string

func (*ToolbarSpacer) Interface

func (obj *ToolbarSpacer) Interface() interface{}

func (*ToolbarSpacer) IsTruthy

func (obj *ToolbarSpacer) IsTruthy() bool

func (*ToolbarSpacer) MarshalJSON

func (obj *ToolbarSpacer) MarshalJSON() ([]byte, error)

func (*ToolbarSpacer) RunOperation

func (obj *ToolbarSpacer) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*ToolbarSpacer) SetAttr

func (obj *ToolbarSpacer) SetAttr(name string, value object.Object) error

func (*ToolbarSpacer) Type

func (obj *ToolbarSpacer) Type() object.Type

type Tree

type Tree struct {
	// contains filtered or unexported fields
}

func NewTree

func NewTree(w WindowInterface) *Tree

func (*Tree) Attrs

func (t *Tree) Attrs() []object.AttrSpec

func (*Tree) CanvasObject

func (t *Tree) CanvasObject() fyne.CanvasObject

func (*Tree) Cost

func (t *Tree) Cost() int

func (*Tree) Equals

func (t *Tree) Equals(other object.Object) bool

func (*Tree) GetAttr

func (t *Tree) GetAttr(name string) (object.Object, bool)

func (*Tree) Inspect

func (t *Tree) Inspect() string

func (*Tree) Interface

func (t *Tree) Interface() interface{}

func (*Tree) IsTruthy

func (t *Tree) IsTruthy() bool

func (*Tree) MarshalJSON

func (t *Tree) MarshalJSON() ([]byte, error)

func (*Tree) RunOperation

func (t *Tree) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)

func (*Tree) SetAttr

func (t *Tree) SetAttr(name string, value object.Object) error

func (*Tree) Type

func (t *Tree) Type() object.Type

type WindowInterface

type WindowInterface interface {
	Do(fn func())
}

WindowInterface defines the interface that widgets need from the Window type to dispatch callbacks to the main goroutine

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL