Documentation ¶
Overview ¶
Package gui handles user interface related stuff eg.: window creation, graphic context preparation and rendering (but not drawing rutines itself) event handling - mouse, keyboard, resize,...
Index ¶
- Constants
- func AlwaysIcon(icon Icon) func() Icon
- func IsExportOn() bool
- func LoadFile(cb func(string))
- func Run(handler func(*Screen))
- func SaveFile(cb func(string))
- func ToggleExport(export func(string))
- func ToggleSettings()
- func True() bool
- type Icon
- type RedrawFunc
- type Screen
- func (s *Screen) DrawInArc(path []draw.Pos, weight int)
- func (s *Screen) DrawInhibitorArc(path []draw.Pos)
- func (s *Screen) DrawOutArc(path []draw.Pos, weight int)
- func (s *Screen) DrawPlace(pos draw.Pos, n int, description string)
- func (s *Screen) DrawTransition(pos draw.Pos, attrs, description string)
- func (s *Screen) ForceRedraw(block bool)
- func (s *Screen) OnDrag(centered bool, ...)
- func (s *Screen) OnKey(keyName string, cb func())
- func (s *Screen) OnMenu(menu *menu, menuIndex int, cb func())
- func (s *Screen) OnMouseMove(centered bool, cb func(float64, float64) bool)
- func (s *Screen) Pan(dx, dy float64)
- func (s *Screen) RegisterControl(which int, key string, getIcon func() Icon, label string, handler func(), ...)
- func (s *Screen) Reset()
- func (s *Screen) SetRedrawFunc(f RedrawFunc)
- func (s *Screen) SetRedrawFuncToSplash(title string)
- func (s *Screen) SetStyle(style draw.Style)
- func (s *Screen) SetTitle(title string)
Constants ¶
View Source
const ( NoIcon = '\x00' QuitIcon = '\uea0f' // '\uea0d' FileIcon = '\uf4c4' OpenIcon = '\ue930' SaveIcon = '\uf4be' ExportIcon = '\uf4e4' ImportIcon = '\uf4e5' SettingsIcon = '\ue992' ReloadIcon = '\u27f2' PlayIcon = '\u25b6' // '\uea15' PauseIcon = '\u25ae' // '\uea16' StopIcon = '\u25a0' // '\uea17' BeginIcon = '\u23ea' // '\uea18' EndIcon = '\u23e9' // '\uea19' NextStepIcon = '\ue966' PrevStepIcon = '\ue965' CenterOnIcon = '\ue3b4' CenterOffIcon = '\ue3b5' RotateIcon = '\ue1c1' )
View Source
const ( // points with 72 dpi A4_WIDTH = 595 A4_HEIGHT = 842 )
Variables ¶
This section is empty.
Functions ¶
func AlwaysIcon ¶
func IsExportOn ¶
func IsExportOn() bool
func ToggleExport ¶
func ToggleExport(export func(string))
func ToggleSettings ¶
func ToggleSettings()
Types ¶
type RedrawFunc ¶
type Screen ¶
Screen provide exported functions for drawing graphic content
func (*Screen) DrawInhibitorArc ¶
func (*Screen) DrawTransition ¶
func (*Screen) ForceRedraw ¶
func (*Screen) OnMouseMove ¶
func (*Screen) RegisterControl ¶
func (*Screen) SetRedrawFunc ¶
func (s *Screen) SetRedrawFunc(f RedrawFunc)
func (*Screen) SetRedrawFuncToSplash ¶
Click to show internal directories.
Click to hide internal directories.