### Basic Go GUI Application with Spot Source: https://github.com/roblillack/spot/blob/main/README.md This example demonstrates a minimal 'Hello World' GUI application using the Spot toolkit in Go. It initializes the UI, mounts a root component, and uses the 'UseState' hook to manage a counter that reactively updates a button's title. The application creates a window with a clickable button that increments a counter. ```go package main import ( "fmt" "github.com/roblillack/spot" "github.com/roblillack/spot/ui" ) func main() { ui.Init() spot.MountFn(func(ctx *spot.RenderContext) spot.Component { counter, setCounter := spot.UseState[int](ctx, 0) buttonTitle := "Click me!" if counter > 0 { buttonTitle = fmt.Sprintf("Clicked %d times!", counter) } return &ui.Window{ Title: "Hello World!", Width: 200, Height: 125, Children: []spot.Component{ &ui.Button{ X: 25, Y: 50, Width: 150, Height: 25, Title: buttonTitle, OnClick: func() { setCounter(counter + 1) }, }, }, } }) ui.Run() } ``` -------------------------------- ### APIDOC: Window UI Control Source: https://github.com/roblillack/spot/blob/main/README.md Control representing a (top-level) window on the screen. ```Go Go Package: github.com/roblillack/spot/ui#Window ``` ```FLTK FLTK Control: Fl_Window (https://www.fltk.org/doc-1.4/classFl__Window.html) ``` ```AppKit AppKit Control: NSWindow (https://developer.apple.com/documentation/appkit/nswindow) ``` -------------------------------- ### APIDOC: TextField UI Control Source: https://github.com/roblillack/spot/blob/main/README.md Control for single-line text input. ```Go Go Package: github.com/roblillack/spot/ui#TextField ``` ```FLTK FLTK Control: Fl_Input (https://www.fltk.org/doc-1.4/classFl__Input.html) ``` ```AppKit AppKit Control: NSTextField (https://developer.apple.com/documentation/appkit/nstextfield) ``` -------------------------------- ### APIDOC: Spinner UI Control Source: https://github.com/roblillack/spot/blob/main/README.md Number input control with up/down buttons. ```Go Go Package: github.com/roblillack/spot/ui#Spinner ``` ```FLTK FLTK Control: Fl_Spinner (https://www.fltk.org/doc-1.4/classFl__Spinner.html) ``` ```AppKit AppKit Control: NSTextField (https://developer.apple.com/documentation/appkit/nstextfield) + NSStepper (https://developer.apple.com/documentation/appkit/nsstepper) ``` -------------------------------- ### APIDOC: ProgressBar UI Control Source: https://github.com/roblillack/spot/blob/main/README.md Progress bar control to visualize the progression of a long-running operation. ```Go Go Package: github.com/roblillack/spot/ui#ProgressBar ``` ```FLTK FLTK Control: Fl_Progress (https://www.fltk.org/doc-1.4/classFl__Progress.html) ``` ```AppKit AppKit Control: NSProgressIndicator (https://developer.apple.com/documentation/appkit/nsprogressindicator) ``` -------------------------------- ### APIDOC: TextEditor UI Control Source: https://github.com/roblillack/spot/blob/main/README.md General-purpose text box to edit multi-line text content. ```Go Go Package: github.com/roblillack/spot/ui#TextEditor ``` ```FLTK FLTK Control: Fl_Text_Editor (https://www.fltk.org/doc-1.4/classFl__Text__Editor.html) ``` ```AppKit AppKit Control: NSTextView (https://developer.apple.com/documentation/appkit/nstextview) ``` -------------------------------- ### APIDOC: Slider UI Control Source: https://github.com/roblillack/spot/blob/main/README.md Horizontal slider input control. ```Go Go Package: github.com/roblillack/spot/ui#Slider ``` ```FLTK FLTK Control: Fl_Slider (https://www.fltk.org/doc-1.4/classFl__Slider.html) ``` ```AppKit AppKit Control: NSSlider (https://developer.apple.com/documentation/appkit/nsslider) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.