examples

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package examples is a set of small applications built with the ui package: each shows the widgets the way a real program uses them. Run them all from the launcher (go run .) or one by name (go run . notepad).

Index

Constants

This section is empty.

Variables

View Source
var Apps = []App{
	{"notepad", "Notepad",
		"Text editor: main menu, toolbar, files, find, printing",
		appIcon("#1E88E5", markLines), notepad.NewForm},
	{"calculator", "Calculator",
		"Button grid, keyboard input, history, clipboard",
		appIcon("#546E7A", markCalculator), calculator.NewForm},
	{"contacts", "Contacts",
		"Table with search and sorting, edit dialog, details pane",
		appIcon("#43A047", markPerson), contacts.NewForm},
	{"files", "Files",
		"File explorer: folder tree, file list, image and text preview",
		appIcon("#FFA000", markFolder), files.NewForm},
	{"paint", "Paint",
		"Drawing on a custom widget, tools, colors, undo",
		appIcon("#E53935", markBrush), paint.NewForm},
	{"tasks", "Tasks",
		"To-do planner: calendar, property grid, reminders, tray icon",
		appIcon("#8E24AA", markCheck), tasks.NewForm},
	{"monitor", "Network Monitor",
		"Live time charts of simulated servers, alerts",
		appIcon("#00897B", markPulse), monitor.NewForm},
	{"converter", "Unit Converter",
		"Translated into English, Russian and Chinese, switched live",
		appIcon("#3949AB", markArrows), converter.NewForm},
	{"plotter", "Function Plotter",
		"Formula input, sliders, chart, animation",
		appIcon("#F4511E", markWave), plotter.NewForm},
}

Apps are the example applications, in the launcher's order.

Functions

func Run

func Run()

Run runs the launcher: a window with the list of the applications. Each opens in its own window; several can be open at once.

func RunApp

func RunApp(app *App)

RunApp runs one application as the main window.

Types

type App

type App struct {
	Name        string // used on the command line: go run . <name>
	Title       string
	Description string
	Icon        image.Image
	NewForm     func() *ui.Form
}

App is one example application.

func FindApp

func FindApp(name string) *App

FindApp returns the application with the name, or nil.

Directories

Path Synopsis
Package icons draws the small icons the example applications use for their menus and toolbars, so the examples need no image files; an application would load its own (e.g.
Package icons draws the small icons the example applications use for their menus and toolbars, so the examples need no image files; an application would load its own (e.g.
Package monitor is the Network Monitor example: a dashboard that pings a few simulated servers once a second and charts the results.
Package monitor is the Network Monitor example: a dashboard that pings a few simulated servers once a second and charts the results.
Package notepad is a primitive text editor: one text file at a time, with the usual File, Edit, View and Help menus.
Package notepad is a primitive text editor: one text file at a time, with the usual File, Edit, View and Help menus.
Package paint is a tiny raster paint program.
Package paint is a tiny raster paint program.
Package plotter is a function plotter: type a formula of x and see its graph.
Package plotter is a function plotter: type a formula of x and see its graph.

Jump to

Keyboard shortcuts

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