Documentation ¶
Overview ¶
Package GiV (GoGi Views) provides a model / view framework to view Go data using reflection
Views are Widgets that automatically display and interact with standard Go data, including structs, maps, slices, and the primitive data elements (string, int, etc). This implements a form of model / view separation between data and GUI representation thereof, where the models are the Go data elements themselves.
This provides automatic, powerful GUI access to essentially any data in any other Go package. Furthermore, the Value framework allows for easy customization and extension of the GUI representation, based on the classic Go "Stringer"-like interface paradigm -- simply define a Value() method on any type, returning giv.Value that manages the interface between data structures and GUI representations.
See the wiki at: https://goki.dev/gi/v2/wiki/Views for more extensive docs.
Some of the most important view elements are:
Value ¶
The Value provides a common API for representing values (int, string, etc) in the GUI, and are used by more complex views (StructView, MapView, SliceView, etc) to represents the elements of those data structures.
Do Ctrl+Alt+I in any window to pull up the GoGiEditor which will show you ample examples of the Value interface in action, and also allow you to customize your GUI.
TreeView ¶
The TreeView displays GoKi Node Trees, using a standard tree-browser with collapse / open widgets and a menu for typical actions such as adding and deleting child nodes, along with full drag-n-drop and clipboard Copy/Cut/Paste functionality. You can connect to the selection signal to e.g., display a StructView field / property editor of the selected node.
TableView ¶
TableView displays a slice-of-struct as a table with columns as the struct fields and rows as the elements in the struct. You can sort by the column headers and it supports full editing with drag-n-drop etc. If set to ReadOnly, then it serves as a chooser, as in the FileView.
MethodView ¶
This is actually a collection of methods that provide a complete GUI for calling methods. Property lists defined on the kit Type registry are used for specifying the methods to call and their properties. Much of your toolbar and menu level GUI can be implemented in this system. See gi/prefs.go and giv/prefsview.go for how the GoGi Prefs dialog is implemented, and see the gide project for a more complex case.
Index ¶
- Constants
- Variables
- func FileViewDirOnlyFilter(fv *FileView, fi *filecat.FileInfo) bool
- func FileViewExtOnlyFilter(fv *FileView, fi *filecat.FileInfo) bool
- func GoGiEditorDialog(obj ki.Ki)
- func HiStylesView(st *histyle.Styles)
- func IsVersCtrlSystem(str string) bool
- func KeyMapsView(km *keyfun.Maps)
- func PrefsDbgView(pf *gi.PrefsDebug)
- func PrefsDetView(pf *gi.PrefsDetailed)
- func PrefsView(pf *gi.Preferences)
- func SetSoloValueIface(vv *ValueBase, val any)
- func SliceIdxByValue(slc any, fldVal any) (int, bool)
- func StructFieldIsDef(defs string, valPtr any, kind reflect.Kind) (bool, string)
- func StructNonDefFieldsStr(structPtr any, path string) string
- func StructSliceIdxByValue(struSlice any, fldName string, fldVal any) (int, error)
- func StructTagVal(key, tags string) string
- func StructViewFieldDefTag(vv Value, lbl *gi.Label) (hasDef bool, isDef bool, defStr string)
- func StructViewFieldTags(vv Value, lbl *gi.Label, w gi.Widget, isReadOnly bool) (hasDef, readOnlyTag bool)
- func StructViewIf(viewif string, field reflect.StructField, stru any) bool
- func VCSLogViewDialog(ctx gi.Widget, repo vci.Repo, lg vci.Log, file, since string) *gi.Dialog
- func ValueMapAdd(typeNm string, fun ValueFunc)
- func ViewStdKeyMaps()
- type ActionUpdateFunc
- type ArgView
- func (av *ArgView) ArgsGrid() *gi.Frame
- func (av *ArgView) ConfigArgsGrid()
- func (av *ArgView) ConfigWidget(vp *gi.Scene)
- func (t *ArgView) KiType() *gti.Type
- func (t *ArgView) New() ki.Ki
- func (av *ArgView) OnInit()
- func (t *ArgView) SetArgs(v []Value) *ArgView
- func (t *ArgView) SetClass(v string) *ArgView
- func (t *ArgView) SetCustomContextMenu(v func(m *gi.Scene)) *ArgView
- func (t *ArgView) SetLayout(v gi.Layouts) *ArgView
- func (t *ArgView) SetSpacing(v units.Value) *ArgView
- func (t *ArgView) SetStackTop(v int) *ArgView
- func (t *ArgView) SetStripes(v gi.Stripes) *ArgView
- func (t *ArgView) SetTitle(v string) *ArgView
- func (t *ArgView) SetTooltip(v string) *ArgView
- func (t *ArgView) SetViewPath(v string) *ArgView
- func (av *ArgView) TitleWidget() *gi.Label
- func (av *ArgView) UpdateArgs()
- type BitFlagValue
- type BoolValue
- type ByteSliceValue
- type ColorMapName
- type ColorMapValue
- type ColorMapView
- func (cv *ColorMapView) ChooseColorMap()
- func (cv *ColorMapView) HandleColorMapEvents()
- func (t *ColorMapView) KiType() *gti.Type
- func (t *ColorMapView) New() ki.Ki
- func (cv *ColorMapView) OnInit()
- func (cv *ColorMapView) Render(sc *gi.Scene)
- func (cv *ColorMapView) RenderColorMap(sc *gi.Scene)
- func (t *ColorMapView) SetClass(v string) *ColorMapView
- func (cv *ColorMapView) SetColorMap(cmap *colormap.Map)
- func (cv *ColorMapView) SetColorMapAction(cmap *colormap.Map)
- func (t *ColorMapView) SetCustomContextMenu(v func(m *gi.Scene)) *ColorMapView
- func (t *ColorMapView) SetMap(v *colormap.Map) *ColorMapView
- func (t *ColorMapView) SetOrient(v mat32.Dims) *ColorMapView
- func (t *ColorMapView) SetTooltip(v string) *ColorMapView
- type ColorNameValue
- type ColorValue
- func (vv *ColorValue) Color() (*color.RGBA, bool)
- func (vv *ColorValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
- func (vv *ColorValue) HasButton() bool
- func (vv *ColorValue) OpenDialog(ctx gi.Widget, fun func(dlg *gi.Dialog))
- func (vv *ColorValue) SetColor(clr color.RGBA)
- func (vv *ColorValue) UpdateWidget()
- func (vv *ColorValue) WidgetType() *gti.Type
- type ColorView
- func (cv *ColorView) ConfigHSLSlider(sl *gi.Slider, hsl int)
- func (cv *ColorView) ConfigPalette()
- func (cv *ColorView) ConfigRGBSlider(sl *gi.Slider, rgb int)
- func (cv *ColorView) ConfigWidget(sc *gi.Scene)
- func (t *ColorView) KiType() *gti.Type
- func (t *ColorView) New() ki.Ki
- func (cv *ColorView) NumLay() *gi.Layout
- func (cv *ColorView) OnInit()
- func (t *ColorView) SetClass(v string) *ColorView
- func (cv *ColorView) SetColor(clr color.Color) *ColorView
- func (t *ColorView) SetColorHsla(v hsl.HSL) *ColorView
- func (t *ColorView) SetCustomContextMenu(v func(m *gi.Scene)) *ColorView
- func (cv *ColorView) SetHSLValue(val float32, hsln int)
- func (t *ColorView) SetLayout(v gi.Layouts) *ColorView
- func (cv *ColorView) SetRGBValue(val float32, rgb int)
- func (t *ColorView) SetSpacing(v units.Value) *ColorView
- func (t *ColorView) SetStackTop(v int) *ColorView
- func (t *ColorView) SetStripes(v gi.Stripes) *ColorView
- func (t *ColorView) SetTmpSave(v Value) *ColorView
- func (t *ColorView) SetTooltip(v string) *ColorView
- func (t *ColorView) SetViewPath(v string) *ColorView
- func (cv *ColorView) SliderGrid() *gi.Layout
- func (cv *ColorView) SliderLay() *gi.Layout
- func (cv *ColorView) Update()
- func (cv *ColorView) UpdateHSLSlider(sl *gi.Slider, hsl int)
- func (cv *ColorView) UpdateImpl()
- func (cv *ColorView) UpdateNums()
- func (cv *ColorView) UpdateRGBSlider(sl *gi.Slider, rgb int)
- func (cv *ColorView) UpdateSliderGrid()
- func (cv *ColorView) UpdateValueFrame()
- func (cv *ColorView) Value() *gi.Frame
- type DurationValue
- type Editor
- func (sve *Editor) CopyFieldsFrom(frm any)
- func (sve *Editor) HandleEditorEvents()
- func (sve *Editor) InitScale()
- func (t *Editor) KiType() *gti.Type
- func (t *Editor) New() ki.Ki
- func (sve *Editor) OnInit()
- func (sve *Editor) Render(sc *gi.Scene)
- func (t *Editor) SetClass(v string) *Editor
- func (t *Editor) SetCustomContextMenu(v func(m *gi.Scene)) *Editor
- func (t *Editor) SetScale(v float32) *Editor
- func (t *Editor) SetSetDragCursor(v bool) *Editor
- func (t *Editor) SetTooltip(v string) *Editor
- func (t *Editor) SetTrans(v mat32.Vec2) *Editor
- func (sve *Editor) SetTransform()
- type EnumValue
- type FieldValuer
- type FileValue
- type FileView
- func (fv *FileView) AddPathToFavs()
- func (fv *FileView) ApplyStyle(sc *gi.Scene)
- func (fv *FileView) ConfigFileView(sc *gi.Scene)
- func (fv *FileView) ConfigFilesRow()
- func (fv *FileView) ConfigPathBar()
- func (fv *FileView) ConfigSelRow()
- func (fv *FileView) ConfigWatcher() error
- func (fv *FileView) ConfigWidget(sc *gi.Scene)
- func (fv *FileView) DirPathUp()
- func (fv *FileView) Disconnect()
- func (fv *FileView) EditPaths()
- func (fv *FileView) ExtField() *gi.TextField
- func (fv *FileView) FavSelect(idx int)
- func (fv *FileView) FavsView() *TableView
- func (fv *FileView) FileComplete(data any, text string, posLn, posCh int) (md complete.Matches)
- func (fv *FileView) FileCompleteEdit(data any, text string, cursorPos int, c complete.Completion, seed string) (ed complete.Edit)
- func (fv *FileView) FileSelectAction(idx int)
- func (fv *FileView) FileViewStyles()
- func (fv *FileView) FilesRow() *gi.Layout
- func (fv *FileView) FilesView() *TableView
- func (fv *FileView) HandleFileViewEvents()
- func (fv *FileView) KeyInput(kt events.Event)
- func (t *FileView) KiType() *gti.Type
- func (t *FileView) New() ki.Ki
- func (fv *FileView) NewFolder()
- func (fv *FileView) OnInit()
- func (fv *FileView) PathComplete(data any, path string, posLn, posCh int) (md complete.Matches)
- func (fv *FileView) PathCompleteEdit(data any, text string, cursorPos int, c complete.Completion, seed string) (ed complete.Edit)
- func (fv *FileView) PathField() *gi.Chooser
- func (fv *FileView) PathFieldHistNext()
- func (fv *FileView) PathFieldHistPrev()
- func (fv *FileView) ReadFiles()
- func (fv *FileView) SaveSortPrefs()
- func (fv *FileView) SelField() *gi.TextField
- func (fv *FileView) SelRow() *gi.Layout
- func (fv *FileView) SelectFile() bool
- func (fv *FileView) SelectedFile() string
- func (fv *FileView) SelectedFileInfo() (*filecat.FileInfo, bool)
- func (t *FileView) SetClass(v string) *FileView
- func (t *FileView) SetCustomContextMenu(v func(m *gi.Scene)) *FileView
- func (t *FileView) SetDirPath(v string) *FileView
- func (fv *FileView) SetExt(ext string) *FileView
- func (fv *FileView) SetExtAction(ext string) *FileView
- func (t *FileView) SetExtMap(v map[string]string) *FileView
- func (fv *FileView) SetFilename(filename, ext string) *FileView
- func (t *FileView) SetFiles(v []*filecat.FileInfo) *FileView
- func (t *FileView) SetFilterFunc(v FileViewFilterFunc) *FileView
- func (t *FileView) SetLayout(v gi.Layouts) *FileView
- func (fv *FileView) SetPathFile(path, file, ext string) *FileView
- func (t *FileView) SetSelFile(v string) *FileView
- func (fv *FileView) SetSelFileAction(sel string)
- func (t *FileView) SetSpacing(v units.Value) *FileView
- func (t *FileView) SetStackTop(v int) *FileView
- func (t *FileView) SetStripes(v gi.Stripes) *FileView
- func (t *FileView) SetTooltip(v string) *FileView
- func (fv *FileView) UpdateFavs()
- func (fv *FileView) UpdateFiles()
- func (fv *FileView) UpdateFilesAction()
- func (fv *FileView) UpdatePath()
- func (fv *FileView) WatchWatcher()
- type FileViewFilterFunc
- type FloatValue
- type FontValue
- type FuncButton
- func (fb *FuncButton) CallFunc()
- func (t *FuncButton) KiType() *gti.Type
- func (t *FuncButton) New() ki.Ki
- func (fb *FuncButton) OnInit()
- func (fb *FuncButton) SetArgs()
- func (t *FuncButton) SetClass(v string) *FuncButton
- func (t *FuncButton) SetConfirm(v bool) *FuncButton
- func (t *FuncButton) SetCustomContextMenu(v func(m *gi.Scene)) *FuncButton
- func (t *FuncButton) SetData(v any) *FuncButton
- func (fb *FuncButton) SetFunc(fun any) *FuncButton
- func (fb *FuncButton) SetFuncImpl(gfun *gti.Func, rfun reflect.Value) *FuncButton
- func (t *FuncButton) SetIcon(v icons.Icon) *FuncButton
- func (t *FuncButton) SetIndicator(v icons.Icon) *FuncButton
- func (fb *FuncButton) SetKey(kf keyfun.Funs) *FuncButton
- func (t *FuncButton) SetMenu(v func(m *gi.Scene)) *FuncButton
- func (fb *FuncButton) SetMethodImpl(gmet *gti.Method, rmet reflect.Value) *FuncButton
- func (fb *FuncButton) SetReturnValues(rets []reflect.Value)
- func (fb *FuncButton) SetReturns()
- func (t *FuncButton) SetShortcut(v key.Chord) *FuncButton
- func (t *FuncButton) SetShowReturn(v bool) *FuncButton
- func (t *FuncButton) SetShowReturnAsDialog(v bool) *FuncButton
- func (t *FuncButton) SetText(v string) *FuncButton
- func (t *FuncButton) SetTooltip(v string) *FuncButton
- func (t *FuncButton) SetType(v gi.ButtonTypes) *FuncButton
- func (t *FuncButton) SetUpdateFunc(v func()) *FuncButton
- func (fb *FuncButton) ShowReturnsDialog(rets []reflect.Value)
- type FuncValue
- type GiEditor
- func (ge *GiEditor) ConfigSplits()
- func (ge *GiEditor) ConfigWidget(sc *gi.Scene)
- func (ge *GiEditor) EditColorScheme()
- func (t *GiEditor) KiType() *gti.Type
- func (ge *GiEditor) MenuBar(mb *gi.MenuBar)
- func (t *GiEditor) New() ki.Ki
- func (ge *GiEditor) OnInit()
- func (ge *GiEditor) Open(filename gi.FileName)
- func (ge *GiEditor) Render(sc *gi.Scene)
- func (ge *GiEditor) Save()
- func (ge *GiEditor) SaveAs(filename gi.FileName)
- func (ge *GiEditor) SelectionLoop()
- func (ge *GiEditor) SetChanged()
- func (t *GiEditor) SetClass(v string) *GiEditor
- func (t *GiEditor) SetCustomContextMenu(v func(m *gi.Scene)) *GiEditor
- func (t *GiEditor) SetFilename(v gi.FileName) *GiEditor
- func (t *GiEditor) SetKiRoot(v ki.Ki) *GiEditor
- func (t *GiEditor) SetLayout(v gi.Layouts) *GiEditor
- func (ge *GiEditor) SetRoot(root ki.Ki)
- func (t *GiEditor) SetSpacing(v units.Value) *GiEditor
- func (t *GiEditor) SetStackTop(v int) *GiEditor
- func (t *GiEditor) SetStripes(v gi.Stripes) *GiEditor
- func (ge *GiEditor) SetTitle(title string)
- func (t *GiEditor) SetTooltip(v string) *GiEditor
- func (ge *GiEditor) Splits() *gi.Splits
- func (ge *GiEditor) StructView() *StructView
- func (ge *GiEditor) TitleWidget() *gi.Label
- func (ge *GiEditor) ToggleSelectionMode()
- func (ge *GiEditor) Toolbar(tb *gi.Toolbar)
- func (ge *GiEditor) TreeView() *TreeView
- func (ge *GiEditor) Update()
- type HiStyleValue
- type IconValue
- type IntValue
- type KeyChordEdit
- func (kc *KeyChordEdit) ContextMenu(m *gi.Scene)
- func (kc *KeyChordEdit) HandleKeyChord()
- func (kc *KeyChordEdit) HandleKeyChordEvents()
- func (kc *KeyChordEdit) KeyChordStyles()
- func (t *KeyChordEdit) KiType() *gti.Type
- func (t *KeyChordEdit) New() ki.Ki
- func (kc *KeyChordEdit) OnInit()
- func (t *KeyChordEdit) SetClass(v string) *KeyChordEdit
- func (t *KeyChordEdit) SetCustomContextMenu(v func(m *gi.Scene)) *KeyChordEdit
- func (t *KeyChordEdit) SetFocusActive(v bool) *KeyChordEdit
- func (t *KeyChordEdit) SetText(v string) *KeyChordEdit
- func (t *KeyChordEdit) SetTooltip(v string) *KeyChordEdit
- func (t *KeyChordEdit) SetType(v gi.LabelTypes) *KeyChordEdit
- type KeyChordValue
- type KeyMapValue
- type KiPtrValue
- type LabelFunc
- type MapInlineValue
- type MapValue
- type MapView
- func (mv *MapView) ConfigMapGrid()
- func (mv *MapView) ConfigToolbar()
- func (mv *MapView) ConfigWidget(sc *gi.Scene)
- func (mv *MapView) IsConfiged() bool
- func (mv *MapView) KiPropTag() string
- func (t *MapView) KiType() *gti.Type
- func (mv *MapView) MapAdd()
- func (mv *MapView) MapChangeValueType(idx int, typ reflect.Type)
- func (mv *MapView) MapDelete(key reflect.Value)
- func (mv *MapView) MapGrid() *gi.Frame
- func (mv *MapView) MapViewStyles()
- func (t *MapView) New() ki.Ki
- func (mv *MapView) OnInit()
- func (mv *MapView) Render(sc *gi.Scene)
- func (mv *MapView) SetChanged()
- func (t *MapView) SetClass(v string) *MapView
- func (t *MapView) SetCustomContextMenu(v func(m *gi.Scene)) *MapView
- func (t *MapView) SetKeys(v []Value) *MapView
- func (t *MapView) SetLayout(v gi.Layouts) *MapView
- func (mv *MapView) SetMap(mp any) *MapView
- func (t *MapView) SetMapValView(v Value) *MapView
- func (t *MapView) SetNcols(v int) *MapView
- func (t *MapView) SetShowToolbar(v bool) *MapView
- func (t *MapView) SetSortVals(v bool) *MapView
- func (t *MapView) SetSpacing(v units.Value) *MapView
- func (t *MapView) SetStackTop(v int) *MapView
- func (t *MapView) SetStripes(v gi.Stripes) *MapView
- func (t *MapView) SetTmpSave(v Value) *MapView
- func (t *MapView) SetToolbarMap(v any) *MapView
- func (t *MapView) SetTooltip(v string) *MapView
- func (t *MapView) SetValues(v []Value) *MapView
- func (t *MapView) SetViewPath(v string) *MapView
- func (mv *MapView) ToggleSort()
- func (mv *MapView) Toolbar() *gi.Toolbar
- func (mv *MapView) UpdateValues()
- type MapViewInline
- func (mv *MapViewInline) ConfigMap(sc *gi.Scene) bool
- func (mv *MapViewInline) ConfigWidget(sc *gi.Scene)
- func (t *MapViewInline) KiType() *gti.Type
- func (mv *MapViewInline) MapAdd()
- func (mv *MapViewInline) MapViewInlineStyles()
- func (t *MapViewInline) New() ki.Ki
- func (mv *MapViewInline) OnInit()
- func (mv *MapViewInline) SetChanged()
- func (t *MapViewInline) SetClass(v string) *MapViewInline
- func (t *MapViewInline) SetCustomContextMenu(v func(m *gi.Scene)) *MapViewInline
- func (t *MapViewInline) SetKeys(v []Value) *MapViewInline
- func (t *MapViewInline) SetLayout(v gi.Layouts) *MapViewInline
- func (mv *MapViewInline) SetMap(mp any) *MapViewInline
- func (t *MapViewInline) SetMapValView(v Value) *MapViewInline
- func (t *MapViewInline) SetSpacing(v units.Value) *MapViewInline
- func (t *MapViewInline) SetStackTop(v int) *MapViewInline
- func (t *MapViewInline) SetTmpSave(v Value) *MapViewInline
- func (t *MapViewInline) SetTooltip(v string) *MapViewInline
- func (t *MapViewInline) SetValues(v []Value) *MapViewInline
- func (t *MapViewInline) SetViewPath(v string) *MapViewInline
- func (mv *MapViewInline) UpdateValues()
- type NilValue
- type RuneSliceValue
- type ShortcutFunc
- type SliceInlineValue
- type SliceValue
- type SliceView
- func (t *SliceView) KiType() *gti.Type
- func (t *SliceView) New() ki.Ki
- func (t *SliceView) SetClass(v string) *SliceView
- func (t *SliceView) SetCurIdx(v int) *SliceView
- func (t *SliceView) SetCustomContextMenu(v func(m *gi.Scene)) *SliceView
- func (t *SliceView) SetDraggedIdxs(v []int) *SliceView
- func (t *SliceView) SetElVal(v reflect.Value) *SliceView
- func (t *SliceView) SetLayout(v gi.Layouts) *SliceView
- func (t *SliceView) SetLayoutHeight(v float32) *SliceView
- func (t *SliceView) SetRenderedRows(v int) *SliceView
- func (t *SliceView) SetRowHeight(v float32) *SliceView
- func (t *SliceView) SetSelIdx(v int) *SliceView
- func (t *SliceView) SetSelIdxs(v map[int]struct{}) *SliceView
- func (t *SliceView) SetSelVal(v any) *SliceView
- func (t *SliceView) SetSliceNpval(v reflect.Value) *SliceView
- func (t *SliceView) SetSliceSize(v int) *SliceView
- func (t *SliceView) SetSliceValView(v Value) *SliceView
- func (t *SliceView) SetSpacing(v units.Value) *SliceView
- func (t *SliceView) SetStackTop(v int) *SliceView
- func (t *SliceView) SetStartIdx(v int) *SliceView
- func (t *SliceView) SetStripes(v gi.Stripes) *SliceView
- func (t *SliceView) SetStyleFunc(v SliceViewStyleFunc) *SliceView
- func (t *SliceView) SetTmpSave(v Value) *SliceView
- func (t *SliceView) SetToolbarSlice(v any) *SliceView
- func (t *SliceView) SetTooltip(v string) *SliceView
- func (t *SliceView) SetValues(v []Value) *SliceView
- func (t *SliceView) SetViewMu(v *sync.Mutex) *SliceView
- func (t *SliceView) SetViewPath(v string) *SliceView
- func (t *SliceView) SetVisRows(v int) *SliceView
- func (sv *SliceView) StyleRow(w gi.Widget, idx, fidx int)
- type SliceViewBase
- func (sv *SliceViewBase) AsSliceViewBase() *SliceViewBase
- func (sv *SliceViewBase) AvailHeight() float32
- func (sv *SliceViewBase) BindSelectDialog(d *gi.Dialog, val *int) *SliceViewBase
- func (sv *SliceViewBase) ConfigFrame(sc *gi.Scene)
- func (sv *SliceViewBase) ConfigOneRow(sc *gi.Scene)
- func (sv *SliceViewBase) ConfigRows(sc *gi.Scene)
- func (sv *SliceViewBase) ConfigScroll()
- func (sv *SliceViewBase) ConfigSliceView(sc *gi.Scene)
- func (sv *SliceViewBase) ConfigToolbar()
- func (sv *SliceViewBase) ConfigWidget(sc *gi.Scene)
- func (sv *SliceViewBase) Copy(reset bool)
- func (sv *SliceViewBase) CopyIdxs(reset bool)
- func (sv *SliceViewBase) CopySelToMime() mimedata.Mimes
- func (sv *SliceViewBase) Cut()
- func (sv *SliceViewBase) CutIdxs()
- func (sv *SliceViewBase) DeleteIdxs()
- func (sv *SliceViewBase) DoLayout(sc *gi.Scene, parBBox image.Rectangle, iter int) bool
- func (sv *SliceViewBase) DragNDropFinalize(mod events.DropMods)
- func (sv *SliceViewBase) DragNDropSource(de events.Event)
- func (sv *SliceViewBase) DragNDropStart()
- func (sv *SliceViewBase) DragNDropTarget(de events.Event)
- func (sv *SliceViewBase) Drop(md mimedata.Mimes, mod events.DropMods)
- func (sv *SliceViewBase) DropAfter(md mimedata.Mimes, mod events.DropMods, idx int)
- func (sv *SliceViewBase) DropAssign(md mimedata.Mimes, idx int)
- func (sv *SliceViewBase) DropBefore(md mimedata.Mimes, mod events.DropMods, idx int)
- func (sv *SliceViewBase) DropCancel()
- func (sv *SliceViewBase) Duplicate() int
- func (sv *SliceViewBase) FlagType() enums.BitFlag
- func (sv *SliceViewBase) FromMimeData(md mimedata.Mimes) []any
- func (sv *SliceViewBase) GridLayout() *gi.Layout
- func (sv *SliceViewBase) HandleSliceViewEvents()
- func (sv *SliceViewBase) IdxFromPos(posY int) (int, bool)
- func (sv *SliceViewBase) IdxGrabFocus(idx int) *gi.WidgetBase
- func (sv *SliceViewBase) IdxIsSelected(idx int) bool
- func (sv *SliceViewBase) IdxPos(idx int) image.Point
- func (sv *SliceViewBase) IsIdxVisible(idx int) bool
- func (sv *SliceViewBase) IsNil() bool
- func (sv *SliceViewBase) IsRowInBounds(row int) bool
- func (sv *SliceViewBase) ItemCtxtMenu(idx int)
- func (sv *SliceViewBase) KeyInputEditable(kt events.Event)
- func (sv *SliceViewBase) KeyInputNav(kt events.Event)
- func (sv *SliceViewBase) KeyInputReadOnly(kt events.Event)
- func (t *SliceViewBase) KiType() *gti.Type
- func (sv *SliceViewBase) MakeDropMenu(m *gi.Scene, data any, mod events.DropMods, idx int)
- func (sv *SliceViewBase) MakePasteMenu(m *gi.Scene, data any, idx int)
- func (sv *SliceViewBase) MimeDataIdx(md *mimedata.Mimes, idx int)
- func (sv *SliceViewBase) MimeDataType() string
- func (sv *SliceViewBase) MoveDown(selMode events.SelectModes) int
- func (sv *SliceViewBase) MoveDownAction(selMode events.SelectModes) int
- func (sv *SliceViewBase) MovePageDown(selMode events.SelectModes) int
- func (sv *SliceViewBase) MovePageDownAction(selMode events.SelectModes) int
- func (sv *SliceViewBase) MovePageUp(selMode events.SelectModes) int
- func (sv *SliceViewBase) MovePageUpAction(selMode events.SelectModes) int
- func (sv *SliceViewBase) MoveUp(selMode events.SelectModes) int
- func (sv *SliceViewBase) MoveUpAction(selMode events.SelectModes) int
- func (sv *SliceViewBase) NeedsConfigRows() bool
- func (t *SliceViewBase) New() ki.Ki
- func (sv *SliceViewBase) OnInit()
- func (sv *SliceViewBase) Paste()
- func (sv *SliceViewBase) PasteAssign(md mimedata.Mimes, idx int)
- func (sv *SliceViewBase) PasteAtIdx(md mimedata.Mimes, idx int)
- func (sv *SliceViewBase) PasteIdx(idx int)
- func (sv *SliceViewBase) PasteMenu(md mimedata.Mimes, idx int)
- func (sv *SliceViewBase) Render(sc *gi.Scene)
- func (sv *SliceViewBase) ResetSelectedIdxs()
- func (sv *SliceViewBase) RowFirstWidget(row int) (*gi.WidgetBase, bool)
- func (sv *SliceViewBase) RowFromPos(posY int) (int, bool)
- func (sv *SliceViewBase) RowGrabFocus(row int) *gi.WidgetBase
- func (sv *SliceViewBase) RowWidgetNs() (nWidgPerRow, idxOff int)
- func (sv *SliceViewBase) SaveDraggedIdxs(idx int)
- func (sv *SliceViewBase) ScrollBar() *gi.Slider
- func (sv *SliceViewBase) ScrollToIdx(idx int) bool
- func (sv *SliceViewBase) ScrollToIdxNoUpdt(idx int) bool
- func (sv *SliceViewBase) SelectAllIdxs()
- func (sv *SliceViewBase) SelectIdx(idx int)
- func (sv *SliceViewBase) SelectIdxAction(idx int, mode events.SelectModes)
- func (sv *SliceViewBase) SelectIdxWidgets(idx int, sel bool) bool
- func (sv *SliceViewBase) SelectRowWidgets(row int, sel bool)
- func (sv *SliceViewBase) SelectVal(val string) bool
- func (sv *SliceViewBase) SelectedIdxsList(descendingSort bool) []int
- func (sv *SliceViewBase) SetChanged()
- func (t *SliceViewBase) SetClass(v string) *SliceViewBase
- func (t *SliceViewBase) SetCurIdx(v int) *SliceViewBase
- func (t *SliceViewBase) SetCustomContextMenu(v func(m *gi.Scene)) *SliceViewBase
- func (t *SliceViewBase) SetDraggedIdxs(v []int) *SliceViewBase
- func (t *SliceViewBase) SetElVal(v reflect.Value) *SliceViewBase
- func (t *SliceViewBase) SetLayout(v gi.Layouts) *SliceViewBase
- func (t *SliceViewBase) SetLayoutHeight(v float32) *SliceViewBase
- func (t *SliceViewBase) SetRenderedRows(v int) *SliceViewBase
- func (t *SliceViewBase) SetRowHeight(v float32) *SliceViewBase
- func (t *SliceViewBase) SetSelIdx(v int) *SliceViewBase
- func (t *SliceViewBase) SetSelIdxs(v map[int]struct{}) *SliceViewBase
- func (t *SliceViewBase) SetSelVal(v any) *SliceViewBase
- func (sv *SliceViewBase) SetSlice(sl any) *SliceViewBase
- func (t *SliceViewBase) SetSliceNpval(v reflect.Value) *SliceViewBase
- func (t *SliceViewBase) SetSliceSize(v int) *SliceViewBase
- func (t *SliceViewBase) SetSliceValView(v Value) *SliceViewBase
- func (t *SliceViewBase) SetSpacing(v units.Value) *SliceViewBase
- func (t *SliceViewBase) SetStackTop(v int) *SliceViewBase
- func (t *SliceViewBase) SetStartIdx(v int) *SliceViewBase
- func (t *SliceViewBase) SetStripes(v gi.Stripes) *SliceViewBase
- func (t *SliceViewBase) SetTmpSave(v Value) *SliceViewBase
- func (t *SliceViewBase) SetToolbarSlice(v any) *SliceViewBase
- func (t *SliceViewBase) SetTooltip(v string) *SliceViewBase
- func (t *SliceViewBase) SetValues(v []Value) *SliceViewBase
- func (t *SliceViewBase) SetViewMu(v *sync.Mutex) *SliceViewBase
- func (t *SliceViewBase) SetViewPath(v string) *SliceViewBase
- func (t *SliceViewBase) SetVisRows(v int) *SliceViewBase
- func (sv *SliceViewBase) SliceDeleteAt(idx int)
- func (sv *SliceViewBase) SliceDeleteAtRow(row int)
- func (sv *SliceViewBase) SliceDeleteAtSel(idx int)
- func (sv *SliceViewBase) SliceGrid() *gi.Frame
- func (sv *SliceViewBase) SliceNewAt(idx int)
- func (sv *SliceViewBase) SliceNewAtRow(row int)
- func (sv *SliceViewBase) SliceNewAtSel(idx int)
- func (sv *SliceViewBase) SliceVal(idx int) any
- func (sv *SliceViewBase) SliceViewBaseInit()
- func (sv *SliceViewBase) StdCtxtMenu(m *gi.Scene, idx int)
- func (sv *SliceViewBase) Toolbar() *gi.Toolbar
- func (sv *SliceViewBase) UnselectAllIdxs()
- func (sv *SliceViewBase) UnselectIdx(idx int)
- func (sv *SliceViewBase) UnselectIdxAction(idx int)
- func (sv *SliceViewBase) UpdateScroll()
- func (sv *SliceViewBase) UpdateSelectIdx(idx int, sel bool)
- func (sv *SliceViewBase) UpdateSelectRow(row int)
- func (sv *SliceViewBase) UpdateStartIdx()
- func (sv *SliceViewBase) UpdateWidgets()
- func (sv *SliceViewBase) UpdtSliceSize() int
- func (sv *SliceViewBase) ViewMuLock()
- func (sv *SliceViewBase) ViewMuUnlock()
- func (sv *SliceViewBase) VisRowsAvail() (rows int, rowht, layht float32)
- type SliceViewFlags
- func (i SliceViewFlags) BitIndexString() string
- func (i SliceViewFlags) Desc() string
- func (i SliceViewFlags) HasFlag(f enums.BitFlag) bool
- func (i SliceViewFlags) Int64() int64
- func (i SliceViewFlags) IsValid() bool
- func (i SliceViewFlags) MarshalText() ([]byte, error)
- func (i *SliceViewFlags) SetFlag(on bool, f ...enums.BitFlag)
- func (i *SliceViewFlags) SetInt64(in int64)
- func (i *SliceViewFlags) SetString(s string) error
- func (i *SliceViewFlags) SetStringOr(s string) error
- func (i SliceViewFlags) String() string
- func (i *SliceViewFlags) UnmarshalText(text []byte) error
- func (i SliceViewFlags) Values() []enums.Enum
- type SliceViewInline
- func (sv *SliceViewInline) ConfigSlice(sc *gi.Scene) bool
- func (sv *SliceViewInline) ConfigWidget(sc *gi.Scene)
- func (t *SliceViewInline) KiType() *gti.Type
- func (t *SliceViewInline) New() ki.Ki
- func (sv *SliceViewInline) OnInit()
- func (sv *SliceViewInline) SetChanged()
- func (t *SliceViewInline) SetClass(v string) *SliceViewInline
- func (t *SliceViewInline) SetCustomContextMenu(v func(m *gi.Scene)) *SliceViewInline
- func (t *SliceViewInline) SetIsArray(v bool) *SliceViewInline
- func (t *SliceViewInline) SetIsFixedLen(v bool) *SliceViewInline
- func (t *SliceViewInline) SetLayout(v gi.Layouts) *SliceViewInline
- func (sv *SliceViewInline) SetSlice(sl any) *SliceViewInline
- func (t *SliceViewInline) SetSliceValView(v Value) *SliceViewInline
- func (t *SliceViewInline) SetSpacing(v units.Value) *SliceViewInline
- func (t *SliceViewInline) SetStackTop(v int) *SliceViewInline
- func (t *SliceViewInline) SetTmpSave(v Value) *SliceViewInline
- func (t *SliceViewInline) SetTooltip(v string) *SliceViewInline
- func (t *SliceViewInline) SetValues(v []Value) *SliceViewInline
- func (t *SliceViewInline) SetViewPath(v string) *SliceViewInline
- func (sv *SliceViewInline) SliceNewAt(idx int)
- func (sv *SliceViewInline) SliceViewInlineStyles()
- func (sv *SliceViewInline) UpdateValues()
- type SliceViewStyleFunc
- type SliceViewer
- type StructFieldVals
- type StructInlineValue
- type StructValue
- type StructView
- func (sv *StructView) ConfigStructGrid(sc *gi.Scene) bool
- func (sv *StructView) ConfigToolbar()
- func (sv *StructView) ConfigWidget(sc *gi.Scene)
- func (sv *StructView) FieldTags(fld reflect.StructField) reflect.StructTag
- func (sv *StructView) IsConfiged() bool
- func (t *StructView) KiType() *gti.Type
- func (t *StructView) New() ki.Ki
- func (sv *StructView) OnInit()
- func (sv *StructView) Render(sc *gi.Scene)
- func (t *StructView) SetChangeFlag(v *reflect.Value) *StructView
- func (t *StructView) SetClass(v string) *StructView
- func (t *StructView) SetCustomContextMenu(v func(m *gi.Scene)) *StructView
- func (t *StructView) SetFieldViews(v []Value) *StructView
- func (t *StructView) SetHasDefs(v bool) *StructView
- func (t *StructView) SetHasViewIfs(v bool) *StructView
- func (t *StructView) SetLayout(v gi.Layouts) *StructView
- func (t *StructView) SetShowToolbar(v bool) *StructView
- func (t *StructView) SetSpacing(v units.Value) *StructView
- func (t *StructView) SetStackTop(v int) *StructView
- func (t *StructView) SetStripes(v gi.Stripes) *StructView
- func (sv *StructView) SetStruct(st any) *StructView
- func (t *StructView) SetStructValView(v Value) *StructView
- func (t *StructView) SetTmpSave(v Value) *StructView
- func (t *StructView) SetToolbarStru(v any) *StructView
- func (t *StructView) SetTooltip(v string) *StructView
- func (t *StructView) SetTypeFieldTags(v map[string]string) *StructView
- func (t *StructView) SetViewPath(v string) *StructView
- func (sv *StructView) StructGrid() *gi.Frame
- func (sv *StructView) Toolbar() *gi.Toolbar
- func (sv *StructView) UpdateField(field string)
- func (sv *StructView) UpdateFieldAction()
- func (sv *StructView) UpdateFields()
- type StructViewInline
- func (sv *StructViewInline) ConfigStruct(sc *gi.Scene) bool
- func (sv *StructViewInline) ConfigWidget(sc *gi.Scene)
- func (sv *StructViewInline) GetSize(sc *gi.Scene, iter int)
- func (t *StructViewInline) KiType() *gti.Type
- func (t *StructViewInline) New() ki.Ki
- func (sv *StructViewInline) OnInit()
- func (t *StructViewInline) SetAddButton(v bool) *StructViewInline
- func (t *StructViewInline) SetClass(v string) *StructViewInline
- func (t *StructViewInline) SetCustomContextMenu(v func(m *gi.Scene)) *StructViewInline
- func (t *StructViewInline) SetFieldViews(v []Value) *StructViewInline
- func (t *StructViewInline) SetHasDefs(v bool) *StructViewInline
- func (t *StructViewInline) SetHasViewIfs(v bool) *StructViewInline
- func (t *StructViewInline) SetLayout(v gi.Layouts) *StructViewInline
- func (t *StructViewInline) SetSpacing(v units.Value) *StructViewInline
- func (t *StructViewInline) SetStackTop(v int) *StructViewInline
- func (t *StructViewInline) SetStripes(v gi.Stripes) *StructViewInline
- func (sv *StructViewInline) SetStruct(st any) *StructViewInline
- func (t *StructViewInline) SetStructValView(v Value) *StructViewInline
- func (t *StructViewInline) SetTmpSave(v Value) *StructViewInline
- func (t *StructViewInline) SetTooltip(v string) *StructViewInline
- func (t *StructViewInline) SetViewPath(v string) *StructViewInline
- func (sv *StructViewInline) StructViewInlineStyles()
- func (sv *StructViewInline) UpdateFieldAction()
- func (sv *StructViewInline) UpdateFields()
- type SubMenuFunc
- type SubSubMenuFunc
- type TableView
- func (tv *TableView) CacheVisFields()
- func (tv *TableView) ConfigFrame(sc *gi.Scene)
- func (tv *TableView) ConfigHeader(sc *gi.Scene)
- func (tv *TableView) ConfigHeaderStyleWidth(w *gi.WidgetBase, sg *gi.Frame, spc float32, idx int)
- func (tv *TableView) ConfigOneRow(sc *gi.Scene)
- func (tv *TableView) ConfigRows(sc *gi.Scene)
- func (tv *TableView) ConfigTableView(sc *gi.Scene)
- func (tv *TableView) ConfigToolbar()
- func (tv *TableView) ConfigWidget(sc *gi.Scene)
- func (tv *TableView) EditIdx(idx int)
- func (tv *TableView) GridLayout() *gi.Layout
- func (tv *TableView) IsConfiged() bool
- func (t *TableView) KiType() *gti.Type
- func (t *TableView) New() ki.Ki
- func (tv *TableView) OnInit()
- func (tv *TableView) RowFirstVisWidget(row int) (*gi.WidgetBase, bool)
- func (tv *TableView) RowGrabFocus(row int) *gi.WidgetBase
- func (tv *TableView) RowWidgetNs() (nWidgPerRow, idxOff int)
- func (tv *TableView) ScrollBar() *gi.Slider
- func (tv *TableView) SelectFieldVal(fld, val string) bool
- func (tv *TableView) SelectRowWidgets(row int, sel bool)
- func (t *TableView) SetClass(v string) *TableView
- func (t *TableView) SetCurIdx(v int) *TableView
- func (t *TableView) SetCustomContextMenu(v func(m *gi.Scene)) *TableView
- func (t *TableView) SetDraggedIdxs(v []int) *TableView
- func (t *TableView) SetElVal(v reflect.Value) *TableView
- func (t *TableView) SetLayout(v gi.Layouts) *TableView
- func (t *TableView) SetLayoutHeight(v float32) *TableView
- func (t *TableView) SetNvisFields(v int) *TableView
- func (t *TableView) SetRenderedRows(v int) *TableView
- func (t *TableView) SetRowHeight(v float32) *TableView
- func (t *TableView) SetSelField(v string) *TableView
- func (t *TableView) SetSelIdx(v int) *TableView
- func (t *TableView) SetSelIdxs(v map[int]struct{}) *TableView
- func (t *TableView) SetSelVal(v any) *TableView
- func (tv *TableView) SetSlice(sl any) *TableView
- func (t *TableView) SetSliceNpval(v reflect.Value) *TableView
- func (t *TableView) SetSliceSize(v int) *TableView
- func (t *TableView) SetSliceValView(v Value) *TableView
- func (t *TableView) SetSortDesc(v bool) *TableView
- func (tv *TableView) SetSortFieldName(nm string)
- func (t *TableView) SetSortIdx(v int) *TableView
- func (t *TableView) SetSpacing(v units.Value) *TableView
- func (t *TableView) SetStackTop(v int) *TableView
- func (t *TableView) SetStartIdx(v int) *TableView
- func (t *TableView) SetStripes(v gi.Stripes) *TableView
- func (t *TableView) SetStruType(v reflect.Type) *TableView
- func (t *TableView) SetStyleFunc(v TableViewStyleFunc) *TableView
- func (t *TableView) SetTmpSave(v Value) *TableView
- func (t *TableView) SetToolbarSlice(v any) *TableView
- func (t *TableView) SetTooltip(v string) *TableView
- func (t *TableView) SetValues(v []Value) *TableView
- func (t *TableView) SetViewMu(v *sync.Mutex) *TableView
- func (t *TableView) SetViewPath(v string) *TableView
- func (t *TableView) SetVisFields(v []reflect.StructField) *TableView
- func (t *TableView) SetVisRows(v int) *TableView
- func (tv *TableView) SliceDeleteAt(idx int)
- func (tv *TableView) SliceFrame() *gi.Frame
- func (tv *TableView) SliceGrid() *gi.Frame
- func (tv *TableView) SliceHeader() *gi.Toolbar
- func (tv *TableView) SliceNewAt(idx int)
- func (tv *TableView) SortFieldName() string
- func (tv *TableView) SortSlice()
- func (tv *TableView) SortSliceAction(fldIdx int)
- func (tv *TableView) StdCtxtMenu(m *gi.Scene, idx int)
- func (tv *TableView) StructType() reflect.Type
- func (tv *TableView) StyleRow(w gi.Widget, idx, fidx int)
- func (tv *TableView) TableViewInit()
- func (tv *TableView) Toolbar() *gi.Toolbar
- func (tv *TableView) UpdateWidgets()
- type TableViewStyleFunc
- type TextEditorValue
- type TimeValue
- type TreeView
- func (tv *TreeView) AddChildNode()
- func (tv *TreeView) AddSyncNodes(rel, myidx int, typ *gti.Type, n int)
- func (tv *TreeView) AddTreeNodes(rel, myidx int, typ *gti.Type, n int)
- func (tv *TreeView) ApplyStyle(sc *gi.Scene)
- func (tv *TreeView) AsTreeView() *TreeView
- func (tv *TreeView) BaseType() *gti.Type
- func (tv *TreeView) BranchPart() (*gi.Switch, bool)
- func (tv *TreeView) ChildrenBBoxes(sc *gi.Scene) image.Rectangle
- func (tv *TreeView) Close()
- func (tv *TreeView) CloseAll()
- func (tv *TreeView) ConfigParts(sc *gi.Scene)
- func (tv *TreeView) ConfigWidget(sc *gi.Scene)
- func (tv *TreeView) ContextMenu(m *gi.Scene)
- func (tv *TreeView) ContextMenuPos(e events.Event) (pos image.Point)
- func (tv *TreeView) Copy(reset bool)
- func (tv *TreeView) CopyFieldsFrom(frm any)
- func (tv *TreeView) Cut()
- func (tv *TreeView) CutSync()
- func (tv *TreeView) DeleteNode()
- func (tv *TreeView) DoLayout(sc *gi.Scene, parBBox image.Rectangle, iter int) bool
- func (tv *TreeView) DoLayoutParts(sc *gi.Scene, parBBox image.Rectangle, iter int)
- func (tv *TreeView) DragNDropStart()
- func (tv *TreeView) Duplicate()
- func (tv *TreeView) DuplicateSync()
- func (tv *TreeView) EditNode()
- func (tv *TreeView) FindSyncNode(kn ki.Ki) *TreeView
- func (tv *TreeView) FlagType() enums.BitFlag
- func (tv *TreeView) GetSize(sc *gi.Scene, iter int)
- func (tv *TreeView) GoGiEditNode()
- func (tv *TreeView) HandleTreeViewDrag()
- func (tv *TreeView) HandleTreeViewEvents()
- func (tv *TreeView) HandleTreeViewKeyChord(kt events.Event)
- func (tv *TreeView) HandleTreeViewMouse()
- func (tv *TreeView) HasSelection() bool
- func (tv *TreeView) IconPart() (*gi.Icon, bool)
- func (tv *TreeView) InsertAfter()
- func (tv *TreeView) InsertAt(rel int, actNm string)
- func (tv *TreeView) InsertBefore()
- func (tv *TreeView) IsClosed() bool
- func (tv *TreeView) IsRoot(op string) bool
- func (t *TreeView) KiType() *gti.Type
- func (tv *TreeView) Label() string
- func (tv *TreeView) LabelPart() (*gi.Label, bool)
- func (tv *TreeView) MakePasteMenu(m *gi.Scene, data any)
- func (tv *TreeView) MimeData(md *mimedata.Mimes)
- func (tv *TreeView) MimeDataSync(md *mimedata.Mimes)
- func (tv *TreeView) MoveDown(selMode events.SelectModes) *TreeView
- func (tv *TreeView) MoveDownAction(selMode events.SelectModes) *TreeView
- func (tv *TreeView) MoveDownSibling(selMode events.SelectModes) *TreeView
- func (tv *TreeView) MoveEndAction(selMode events.SelectModes) *TreeView
- func (tv *TreeView) MoveHomeAction(selMode events.SelectModes) *TreeView
- func (tv *TreeView) MovePageDownAction(selMode events.SelectModes) *TreeView
- func (tv *TreeView) MovePageUpAction(selMode events.SelectModes) *TreeView
- func (tv *TreeView) MoveToLastChild(selMode events.SelectModes) *TreeView
- func (tv *TreeView) MoveUp(selMode events.SelectModes) *TreeView
- func (tv *TreeView) MoveUpAction(selMode events.SelectModes) *TreeView
- func (t *TreeView) New() ki.Ki
- func (tv *TreeView) NodesFromMimeData(md mimedata.Mimes) (ki.Slice, []string)
- func (tv *TreeView) OnClose()
- func (tv *TreeView) OnInit()
- func (tv *TreeView) OnOpen()
- func (tv *TreeView) Open()
- func (tv *TreeView) OpenAll()
- func (tv *TreeView) OpenParents()
- func (tv *TreeView) Paste()
- func (tv *TreeView) PasteAfter(md mimedata.Mimes, mod events.DropMods)
- func (tv *TreeView) PasteAssign(md mimedata.Mimes)
- func (tv *TreeView) PasteAssignSync(md mimedata.Mimes)
- func (tv *TreeView) PasteAt(md mimedata.Mimes, mod events.DropMods, rel int, actNm string)
- func (tv *TreeView) PasteAtSync(md mimedata.Mimes, mod events.DropMods, rel int, actNm string)
- func (tv *TreeView) PasteBefore(md mimedata.Mimes, mod events.DropMods)
- func (tv *TreeView) PasteChildren(md mimedata.Mimes, mod events.DropMods)
- func (tv *TreeView) PasteChildrenSync(md mimedata.Mimes, mod events.DropMods)
- func (tv *TreeView) PasteMenu(md mimedata.Mimes)
- func (tv *TreeView) ReSync()
- func (tv *TreeView) Render(sc *gi.Scene)
- func (tv *TreeView) RenderNode(sc *gi.Scene)
- func (tv *TreeView) RootIsReadOnly() bool
- func (tv *TreeView) RootSetViewIdx() int
- func (tv *TreeView) Select()
- func (tv *TreeView) SelectAction(mode events.SelectModes) bool
- func (tv *TreeView) SelectAll()
- func (tv *TreeView) SelectMode() bool
- func (tv *TreeView) SelectModeToggle()
- func (tv *TreeView) SelectUpdate(mode events.SelectModes) bool
- func (tv *TreeView) SelectedSyncNodes() ki.Slice
- func (tv *TreeView) SelectedViews() []*TreeView
- func (tv *TreeView) SendChangeEvent(ctx events.Event)
- func (tv *TreeView) SendChangeEventReSync(ctx events.Event)
- func (tv *TreeView) SendSelectEvent(ctx events.Event)
- func (tv *TreeView) SetBranchState()
- func (t *TreeView) SetClass(v string) *TreeView
- func (tv *TreeView) SetClosed(closed bool)
- func (t *TreeView) SetCustomContextMenu(v func(m *gi.Scene)) *TreeView
- func (t *TreeView) SetIcon(v icons.Icon) *TreeView
- func (t *TreeView) SetIndent(v units.Value) *TreeView
- func (tv *TreeView) SetKidsVisibility(parentClosed bool)
- func (t *TreeView) SetOpenDepth(v int) *TreeView
- func (t *TreeView) SetRootView(v *TreeView) *TreeView
- func (tv *TreeView) SetSelectMode(selMode bool)
- func (t *TreeView) SetSelectedNodes(v []*TreeView) *TreeView
- func (tv *TreeView) SetSelectedViews(sl []*TreeView)
- func (tv *TreeView) SetSyncNode(sk ki.Ki, tvIdx *int, init bool, depth int)
- func (t *TreeView) SetTooltip(v string) *TreeView
- func (t *TreeView) SetViewIdx(v int) *TreeView
- func (t *TreeView) SetWidgetSize(v mat32.Vec2) *TreeView
- func (tv *TreeView) StyleTreeView(sc *gi.Scene)
- func (tv *TreeView) SyncNodesFromMimeData(md mimedata.Mimes) (ki.Slice, []string)
- func (tv *TreeView) SyncRootNode(sk ki.Ki)
- func (tv *TreeView) SyncToSrc(tvIdx *int, init bool, depth int)
- func (tv *TreeView) ToggleClose()
- func (tv *TreeView) TreeViewChanged(ctx events.Event)
- func (tv *TreeView) TreeViewContextMenu(m *gi.Scene)
- func (tv *TreeView) TreeViewContextMenuReadOnly(m *gi.Scene)
- func (tv *TreeView) TreeViewParent() *TreeView
- func (tv *TreeView) TreeViewStyles()
- func (tv *TreeView) Unselect()
- func (tv *TreeView) UnselectAction()
- func (tv *TreeView) UnselectAll()
- func (tv *TreeView) UpdateBranchIcons()
- func (tv *TreeView) UpdateReadOnly() bool
- type TreeViewFlags
- func (i TreeViewFlags) BitIndexString() string
- func (i TreeViewFlags) Desc() string
- func (i TreeViewFlags) HasFlag(f enums.BitFlag) bool
- func (i TreeViewFlags) Int64() int64
- func (i TreeViewFlags) IsValid() bool
- func (i TreeViewFlags) MarshalText() ([]byte, error)
- func (i *TreeViewFlags) SetFlag(on bool, f ...enums.BitFlag)
- func (i *TreeViewFlags) SetInt64(in int64)
- func (i *TreeViewFlags) SetString(s string) error
- func (i *TreeViewFlags) SetStringOr(s string) error
- func (i TreeViewFlags) String() string
- func (i *TreeViewFlags) UnmarshalText(text []byte) error
- func (i TreeViewFlags) Values() []enums.Enum
- type TreeViewer
- type TypeValue
- type VCSLogView
- func (lv *VCSLogView) ConfigRepo(repo vci.Repo, lg vci.Log, file, since string)
- func (lv *VCSLogView) ConfigToolbar()
- func (t *VCSLogView) KiType() *gti.Type
- func (t *VCSLogView) New() ki.Ki
- func (lv *VCSLogView) OnInit()
- func (t *VCSLogView) SetClass(v string) *VCSLogView
- func (t *VCSLogView) SetCustomContextMenu(v func(m *gi.Scene)) *VCSLogView
- func (t *VCSLogView) SetFile(v string) *VCSLogView
- func (t *VCSLogView) SetLayout(v gi.Layouts) *VCSLogView
- func (t *VCSLogView) SetLog(v vci.Log) *VCSLogView
- func (t *VCSLogView) SetRepo(v vci.Repo) *VCSLogView
- func (lv *VCSLogView) SetRevA(rev string)
- func (lv *VCSLogView) SetRevB(rev string)
- func (t *VCSLogView) SetSetA(v bool) *VCSLogView
- func (t *VCSLogView) SetSince(v string) *VCSLogView
- func (t *VCSLogView) SetSpacing(v units.Value) *VCSLogView
- func (t *VCSLogView) SetStackTop(v int) *VCSLogView
- func (t *VCSLogView) SetTooltip(v string) *VCSLogView
- func (lv *VCSLogView) TableView() *TableView
- func (lv *VCSLogView) ToggleRev()
- func (lv *VCSLogView) Toolbar() *gi.Toolbar
- type Value
- type ValueBase
- func (vv *ValueBase) AllTags() map[string]string
- func (vv *ValueBase) AsValueBase() *ValueBase
- func (vv *ValueBase) AsWidget() gi.Widget
- func (vv *ValueBase) ConfigWidget(w gi.Widget, sc *gi.Scene)
- func (vv *ValueBase) CreateTempIfNotPtr() bool
- func (vv *ValueBase) Doc() string
- func (vv *ValueBase) GetTitle() (label, newPath string, isZero bool)
- func (vv *ValueBase) HandleEvent(ev events.Event)
- func (vv *ValueBase) HasDialog() bool
- func (vv *ValueBase) Is(f enums.BitFlag) bool
- func (vv *ValueBase) IsReadOnly() bool
- func (vv *ValueBase) Label() string
- func (vv *ValueBase) Name() string
- func (vv *ValueBase) On(etype events.Types, fun func(e events.Event))
- func (vv *ValueBase) OnChange(fun func(e events.Event))
- func (vv *ValueBase) OpenDialog(ctx gi.Widget, fun func(dlg *gi.Dialog))
- func (vv *ValueBase) OwnerKind() reflect.Kind
- func (vv *ValueBase) OwnerLabel() string
- func (vv *ValueBase) SaveTmp()
- func (vv *ValueBase) Send(typ events.Types, orig ...events.Event)
- func (vv *ValueBase) SendChange(orig ...events.Event)
- func (vv *ValueBase) SetDoc(doc string)
- func (vv *ValueBase) SetFlag(on bool, f ...enums.BitFlag)
- func (vv *ValueBase) SetLabel(label string)
- func (vv *ValueBase) SetMapKey(key reflect.Value, owner any, tmpSave Value)
- func (vv *ValueBase) SetMapValue(val reflect.Value, owner any, key any, keyView Value, tmpSave Value, ...)
- func (vv *ValueBase) SetName(name string)
- func (vv *ValueBase) SetReadOnly(ro bool)
- func (vv *ValueBase) SetSliceValue(val reflect.Value, owner any, idx int, tmpSave Value, viewPath string)
- func (vv *ValueBase) SetSoloValue(val reflect.Value)
- func (vv *ValueBase) SetStructValue(val reflect.Value, owner any, field *reflect.StructField, tmpSave Value, ...)
- func (vv *ValueBase) SetTag(tag, value string)
- func (vv *ValueBase) SetTags(tags map[string]string)
- func (vv *ValueBase) SetValue(val any) bool
- func (vv *ValueBase) SetValueMap(val any) (bool, error)
- func (vv *ValueBase) StdConfigWidget(w gi.Widget)
- func (vv *ValueBase) String() string
- func (vv *ValueBase) Tag(tag string) (string, bool)
- func (vv *ValueBase) UpdateWidget()
- func (vv *ValueBase) Val() reflect.Value
- func (vv *ValueBase) WidgetType() *gti.Type
- type ValueFlags
- func (i ValueFlags) BitIndexString() string
- func (i ValueFlags) Desc() string
- func (i ValueFlags) HasFlag(f enums.BitFlag) bool
- func (i ValueFlags) Int64() int64
- func (i ValueFlags) IsValid() bool
- func (i ValueFlags) MarshalText() ([]byte, error)
- func (i *ValueFlags) SetFlag(on bool, f ...enums.BitFlag)
- func (i *ValueFlags) SetInt64(in int64)
- func (i *ValueFlags) SetString(s string) error
- func (i *ValueFlags) SetStringOr(s string) error
- func (i ValueFlags) String() string
- func (i *ValueFlags) UnmarshalText(text []byte) error
- func (i ValueFlags) Values() []enums.Enum
- type ValueFunc
- type Valuer
- type VersCtrlName
- type VersCtrlValue
- type ViewIFace
- func (vi *ViewIFace) CtxtMenuView(val any, readOnly bool, sc *gi.Scene, m *gi.Scene) bool
- func (vi *ViewIFace) GoGiEditor(obj ki.Ki)
- func (vi *ViewIFace) HiStyleInit()
- func (vi *ViewIFace) HiStylesView(std bool)
- func (vi *ViewIFace) KeyMapsView(maps *keyfun.Maps)
- func (vi *ViewIFace) PrefsDbgView(prefs *gi.PrefsDebug)
- func (vi *ViewIFace) PrefsDetApply(pf *gi.PrefsDetailed)
- func (vi *ViewIFace) PrefsDetDefaults(pf *gi.PrefsDetailed)
- func (vi *ViewIFace) PrefsDetView(prefs *gi.PrefsDetailed)
- func (vi *ViewIFace) PrefsView(prefs *gi.Preferences)
- func (vi *ViewIFace) SetHiStyleDefault(hsty gi.HiStyleName)
Constants ¶
const TreeViewTempMovedTag = `_\&MOVED\&`
This is a kind of hack to prevent moved items from being deleted, using DND
Variables ¶
var ( // MapInlineLen is the number of map elements at or below which an inline // representation of the map will be presented -- more convenient for small // numbers of properties MapInlineLen = 2 // StructInlineLen is the number of elemental struct fields at or below which an inline // representation of the struct will be presented -- more convenient for small structs StructInlineLen = 4 // SliceInlineLen is the number of slice elements at or below which inline will be used SliceInlineLen = 4 )
var ArgViewType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.ArgView", ShortName: "giv.ArgView", IDName: "arg-view", Doc: "ArgView represents a slice of reflect.Value's and associated names, for the\npurpose of supplying arguments to methods called via the MethodView\nframework.", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Title", >i.Field{Name: "Title", Type: "string", LocalType: "string", Doc: "title / prompt to show above the editor fields", Directives: gti.Directives{}, Tag: ""}}, {"Args", >i.Field{Name: "Args", Type: "[]goki.dev/gi/v2/giv.Value", LocalType: "[]Value", Doc: "the args that we are a view onto", Directives: gti.Directives{}, Tag: ""}}, {"ViewPath", >i.Field{Name: "ViewPath", Type: "string", LocalType: "string", Doc: "a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows", Directives: gti.Directives{}, Tag: ""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Frame", >i.Field{Name: "Frame", Type: "goki.dev/gi/v2/gi.Frame", LocalType: "gi.Frame", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &ArgView{}, })
ArgViewType is the gti.Type for ArgView
var ColorMapViewType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.ColorMapView", ShortName: "giv.ColorMapView", IDName: "color-map-view", Doc: "ColorMapView is a widget that displays a ColorMap.\nNote that this is not a Value widget", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Orient", >i.Field{Name: "Orient", Type: "goki.dev/mat32/v2.Dims", LocalType: "mat32.Dims", Doc: "orientation along which to display the spectrum", Directives: gti.Directives{}, Tag: ""}}, {"Map", >i.Field{Name: "Map", Type: "*goki.dev/colors/colormap.Map", LocalType: "*colormap.Map", Doc: "the colormap that we view", Directives: gti.Directives{}, Tag: ""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"WidgetBase", >i.Field{Name: "WidgetBase", Type: "goki.dev/gi/v2/gi.WidgetBase", LocalType: "gi.WidgetBase", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &ColorMapView{}, })
ColorMapViewType is the gti.Type for ColorMapView
var ColorViewType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.ColorView", ShortName: "giv.ColorView", IDName: "color-view", Doc: "ColorView shows a color, using sliders or numbers to set values.", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Color", >i.Field{Name: "Color", Type: "image/color.RGBA", LocalType: "color.RGBA", Doc: "the color that we view", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"ColorHSLA", >i.Field{Name: "ColorHSLA", Type: "goki.dev/cam/hsl.HSL", LocalType: "hsl.HSL", Doc: "the color that we view, in HSLA form", Directives: gti.Directives{}, Tag: "edit:\"-\""}}, {"TmpSave", >i.Field{Name: "TmpSave", Type: "goki.dev/gi/v2/giv.Value", LocalType: "Value", Doc: "value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\""}}, {"ViewPath", >i.Field{Name: "ViewPath", Type: "string", LocalType: "string", Doc: "a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows", Directives: gti.Directives{}, Tag: ""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Frame", >i.Field{Name: "Frame", Type: "goki.dev/gi/v2/gi.Frame", LocalType: "gi.Frame", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &ColorView{}, })
ColorViewType is the gti.Type for ColorView
var DefaultTimeFormat = "2006-01-02 15:04:05 MST"
var EditorType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.Editor", ShortName: "giv.Editor", IDName: "editor", Doc: "Editor supports editing of SVG elements", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Trans", >i.Field{Name: "Trans", Type: "goki.dev/mat32/v2.Vec2", LocalType: "mat32.Vec2", Doc: "view translation offset (from dragging)", Directives: gti.Directives{}, Tag: ""}}, {"Scale", >i.Field{Name: "Scale", Type: "float32", LocalType: "float32", Doc: "view scaling (from zooming)", Directives: gti.Directives{}, Tag: ""}}, {"SetDragCursor", >i.Field{Name: "SetDragCursor", Type: "bool", LocalType: "bool", Doc: "has dragging cursor been set yet?", Directives: gti.Directives{}, Tag: "view:\"-\""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"WidgetBase", >i.Field{Name: "WidgetBase", Type: "goki.dev/gi/v2/gi.WidgetBase", LocalType: "gi.WidgetBase", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &Editor{}, })
EditorType is the gti.Type for Editor
var FileViewKindColorMap = map[string]string{
"folder": "pref(link)",
}
STYTODO: get rid of this or make it use actual color values FileViewKindColorMap translates file Kinds into different colors for the file viewer
var FileViewType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.FileView", ShortName: "giv.FileView", IDName: "file-view", Doc: "FileView is a viewer onto files -- core of the file chooser dialog", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"DirPath", >i.Field{Name: "DirPath", Type: "string", LocalType: "string", Doc: "path to directory of files to display", Directives: gti.Directives{}, Tag: ""}}, {"SelFile", >i.Field{Name: "SelFile", Type: "string", LocalType: "string", Doc: "selected file", Directives: gti.Directives{}, Tag: ""}}, {"Ext", >i.Field{Name: "Ext", Type: "string", LocalType: "string", Doc: "target extension(s) (comma separated if multiple, including initial .), if any", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"FilterFunc", >i.Field{Name: "FilterFunc", Type: "goki.dev/gi/v2/giv.FileViewFilterFunc", LocalType: "FileViewFilterFunc", Doc: "optional styling function", Directives: gti.Directives{}, Tag: "view:\"-\" json:\"-\" xml:\"-\""}}, {"ExtMap", >i.Field{Name: "ExtMap", Type: "map[string]string", LocalType: "map[string]string", Doc: "map of lower-cased extensions from Ext -- used for highlighting files with one of these extensions -- maps onto original ext value", Directives: gti.Directives{}, Tag: ""}}, {"Files", >i.Field{Name: "Files", Type: "[]*goki.dev/pi/v2/filecat.FileInfo", LocalType: "[]*filecat.FileInfo", Doc: "files for current directory", Directives: gti.Directives{}, Tag: ""}}, {"SelectedIdx", >i.Field{Name: "SelectedIdx", Type: "int", LocalType: "int", Doc: "index of currently-selected file in Files list (-1 if none)", Directives: gti.Directives{}, Tag: "set:\"-\" edit:\"-\""}}, {"Watcher", >i.Field{Name: "Watcher", Type: "*github.com/fsnotify/fsnotify.Watcher", LocalType: "*fsnotify.Watcher", Doc: "change notify for current dir", Directives: gti.Directives{}, Tag: "set:\"-\" view:\"-\""}}, {"DoneWatcher", >i.Field{Name: "DoneWatcher", Type: "chan bool", LocalType: "chan bool", Doc: "channel to close watcher watcher", Directives: gti.Directives{}, Tag: "set:\"-\" view:\"-\""}}, {"UpdtMu", >i.Field{Name: "UpdtMu", Type: "sync.Mutex", LocalType: "sync.Mutex", Doc: "UpdateFiles mutex", Directives: gti.Directives{}, Tag: "set:\"-\" view:\"-\""}}, {"PrevPath", >i.Field{Name: "PrevPath", Type: "string", LocalType: "string", Doc: "Previous path that was processed via UpdateFiles", Directives: gti.Directives{}, Tag: "set:\"-\" view:\"-\""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Frame", >i.Field{Name: "Frame", Type: "goki.dev/gi/v2/gi.Frame", LocalType: "gi.Frame", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &FileView{}, })
FileViewType is the gti.Type for FileView
var FontChooserSize = units.Pt(18)
show fonts in a bigger size so you can actually see the differences
var FuncButtonType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.FuncButton", ShortName: "giv.FuncButton", IDName: "func-button", Doc: "FuncButton is a button that is set up to call a function when it\nis pressed, using a dialog to prompt the user for any arguments.\nAlso, it automatically sets various properties of the button like\nthe name, text, tooltip, and icon based on the properties of the\nfunction, using reflect and gti. The function must be registered\nwith gti to get documentation information, but that is not required;\nadd a `//gti:add` comment directive and run `goki generate`\nif you want tooltips. If the function is a method, both the method and\nits receiver type must be added to gti to get documentation.", Directives: gti.Directives{ >i.Directive{Tool: "goki", Directive: "no-new", Args: []string{}}, }, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Func", >i.Field{Name: "Func", Type: "*goki.dev/gti.Func", LocalType: "*gti.Func", Doc: "Func is the [gti.Func] associated with this button.\nThis function can also be a method, but it must be\nconverted to a [gti.Func] first. It should typically\nbe set using [FuncButton.SetFunc].", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"ReflectFunc", >i.Field{Name: "ReflectFunc", Type: "reflect.Value", LocalType: "reflect.Value", Doc: "ReflectFunc is the [reflect.Value] of the function or\nmethod associated with this button. It should typically\nbet set using [FuncButton.SetFunc].", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"Args", >i.Field{Name: "Args", Type: "[]goki.dev/gi/v2/giv.Value", LocalType: "[]Value", Doc: "Args are the [Value] objects associated with the\narguments of the function. They are automatically set in\n[SetFunc], but they can be customized to configure\ndefault values and other options.", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"Returns", >i.Field{Name: "Returns", Type: "[]goki.dev/gi/v2/giv.Value", LocalType: "[]Value", Doc: "Returns are the [Value] objects associated with the\nreturn values of the function. They are automatically\nset in [SetFunc], but they can be customized to configure\ndefault values and other options. The [reflect.Value]s of\nthe [Value] objects are not set until the function is\ncalled, and are thus not typically applicable to access.", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"Confirm", >i.Field{Name: "Confirm", Type: "bool", LocalType: "bool", Doc: "Confirm is whether to prompt the user for confirmation\nbefore calling the function.", Directives: gti.Directives{}, Tag: ""}}, {"ShowReturn", >i.Field{Name: "ShowReturn", Type: "bool", LocalType: "bool", Doc: "ShowReturn is whether to display the return values of\nthe function (and a success message if there are none).\nThe way that the return values are shown is determined\nby ShowReturnAsDialog. ShowReturn is on by default, unless\nthe function has no return values.", Directives: gti.Directives{}, Tag: "def:\"true\""}}, {"ShowReturnAsDialog", >i.Field{Name: "ShowReturnAsDialog", Type: "bool", LocalType: "bool", Doc: "ShowReturnAsDialog, if and only if ShowReturn is true,\nindicates to show the return values of the function in\na dialog, instead of in a snackbar, as they are by default.\nIf there are multiple return values from the function, or if\none of them is a complex type (pointer, struct, slice,\narray, map), then ShowReturnAsDialog will\nautomatically be set to true.", Directives: gti.Directives{}, Tag: ""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Button", >i.Field{Name: "Button", Type: "goki.dev/gi/v2/gi.Button", LocalType: "gi.Button", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &FuncButton{}, })
FuncButtonType is the gti.Type for FuncButton
var GiEditorType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.GiEditor", ShortName: "giv.GiEditor", IDName: "gi-editor", Doc: "GiEditor represents a struct, creating a property editor of the fields --\nconstructs Children widgets to show the field names and editor fields for\neach field, within an overall frame with an optional title, and a button\nbox at the bottom where methods can be invoked", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"KiRoot", >i.Field{Name: "KiRoot", Type: "goki.dev/ki/v2.Ki", LocalType: "ki.Ki", Doc: "root of tree being edited", Directives: gti.Directives{}, Tag: ""}}, {"Changed", >i.Field{Name: "Changed", Type: "bool", LocalType: "bool", Doc: "has the root changed via gui actions? updated from treeview and structview for changes", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"Filename", >i.Field{Name: "Filename", Type: "goki.dev/gi/v2/gi.FileName", LocalType: "gi.FileName", Doc: "current filename for saving / loading", Directives: gti.Directives{}, Tag: ""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Frame", >i.Field{Name: "Frame", Type: "goki.dev/gi/v2/gi.Frame", LocalType: "gi.Frame", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{ {"Update", >i.Method{Name: "Update", Doc: "Update updates the objects being edited (e.g., updating display changes)", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"Save", >i.Method{Name: "Save", Doc: "Save saves tree to current filename, in a standard JSON-formatted file", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"SaveAs", >i.Method{Name: "SaveAs", Doc: "SaveAs saves tree to given filename, in a standard JSON-formatted file", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"filename", >i.Field{Name: "filename", Type: "goki.dev/gi/v2/gi.FileName", LocalType: "gi.FileName", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"Open", >i.Method{Name: "Open", Doc: "Open opens tree from given filename, in a standard JSON-formatted file", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"filename", >i.Field{Name: "filename", Type: "goki.dev/gi/v2/gi.FileName", LocalType: "gi.FileName", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"EditColorScheme", >i.Method{Name: "EditColorScheme", Doc: "EditColorScheme pulls up a window to edit the current color scheme", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"ToggleSelectionMode", >i.Method{Name: "ToggleSelectionMode", Doc: "ToggleSelectionMode toggles the editor between selection mode or not", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, }), Instance: &GiEditor{}, })
GiEditorType is the gti.Type for GiEditor
var KeyChordEditType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.KeyChordEdit", ShortName: "giv.KeyChordEdit", IDName: "key-chord-edit", Doc: "KeyChordEdit is a label widget that shows a key chord string, and, when in\nfocus (after being clicked) will update to whatever key chord is typed --\nused for representing and editing key chords.", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"FocusActive", >i.Field{Name: "FocusActive", Type: "bool", LocalType: "bool", Doc: "true if the keyboard focus is active or not -- when we lose active focus we apply changes", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Label", >i.Field{Name: "Label", Type: "goki.dev/gi/v2/gi.Label", LocalType: "gi.Label", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &KeyChordEdit{}, })
KeyChordEditType is the gti.Type for KeyChordEdit
var MapViewInlineType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.MapViewInline", ShortName: "giv.MapViewInline", IDName: "map-view-inline", Doc: "MapViewInline represents a map as a single line widget,\nfor smaller maps and those explicitly marked inline.", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Map", >i.Field{Name: "Map", Type: "any", LocalType: "any", Doc: "the map that we are a view onto", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"MapValView", >i.Field{Name: "MapValView", Type: "goki.dev/gi/v2/giv.Value", LocalType: "Value", Doc: "Value for the map itself, if this was created within value view framework -- otherwise nil", Directives: gti.Directives{}, Tag: ""}}, {"Changed", >i.Field{Name: "Changed", Type: "bool", LocalType: "bool", Doc: "has the map been edited?", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"Keys", >i.Field{Name: "Keys", Type: "[]goki.dev/gi/v2/giv.Value", LocalType: "[]Value", Doc: "Value representations of the map keys", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\""}}, {"Values", >i.Field{Name: "Values", Type: "[]goki.dev/gi/v2/giv.Value", LocalType: "[]Value", Doc: "Value representations of the fields", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\""}}, {"TmpSave", >i.Field{Name: "TmpSave", Type: "goki.dev/gi/v2/giv.Value", LocalType: "Value", Doc: "value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent", Directives: gti.Directives{}, Tag: "view:\"-\" json:\"-\" xml:\"-\""}}, {"ViewPath", >i.Field{Name: "ViewPath", Type: "string", LocalType: "string", Doc: "a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows", Directives: gti.Directives{}, Tag: ""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Layout", >i.Field{Name: "Layout", Type: "goki.dev/gi/v2/gi.Layout", LocalType: "gi.Layout", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &MapViewInline{}, })
MapViewInlineType is the gti.Type for MapViewInline
var MapViewType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.MapView", ShortName: "giv.MapView", IDName: "map-view", Doc: "MapView represents a map, creating a property editor of the values --\nconstructs Children widgets to show the key / value pairs, within an\noverall frame.\nAutomatically has a toolbar with Map Toolbar props if defined\nset prop toolbar = false to turn off", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Map", >i.Field{Name: "Map", Type: "any", LocalType: "any", Doc: "the map that we are a view onto", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"MapValView", >i.Field{Name: "MapValView", Type: "goki.dev/gi/v2/giv.Value", LocalType: "Value", Doc: "Value for the map itself, if this was created within value view framework -- otherwise nil", Directives: gti.Directives{}, Tag: ""}}, {"Changed", >i.Field{Name: "Changed", Type: "bool", LocalType: "bool", Doc: "has the map been edited?", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"Keys", >i.Field{Name: "Keys", Type: "[]goki.dev/gi/v2/giv.Value", LocalType: "[]Value", Doc: "Value representations of the map keys", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\""}}, {"Values", >i.Field{Name: "Values", Type: "[]goki.dev/gi/v2/giv.Value", LocalType: "[]Value", Doc: "Value representations of the map values", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\""}}, {"SortVals", >i.Field{Name: "SortVals", Type: "bool", LocalType: "bool", Doc: "sort by values instead of keys", Directives: gti.Directives{}, Tag: ""}}, {"ShowToolbar", >i.Field{Name: "ShowToolbar", Type: "bool", LocalType: "bool", Doc: "whether to show the toolbar or not", Directives: gti.Directives{}, Tag: ""}}, {"NCols", >i.Field{Name: "NCols", Type: "int", LocalType: "int", Doc: "the number of columns in the map; do not set externally; generally only access internally", Directives: gti.Directives{}, Tag: ""}}, {"TmpSave", >i.Field{Name: "TmpSave", Type: "goki.dev/gi/v2/giv.Value", LocalType: "Value", Doc: "value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\""}}, {"ViewPath", >i.Field{Name: "ViewPath", Type: "string", LocalType: "string", Doc: "a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows", Directives: gti.Directives{}, Tag: ""}}, {"ToolbarMap", >i.Field{Name: "ToolbarMap", Type: "any", LocalType: "any", Doc: "the map that we successfully set a toolbar for", Directives: gti.Directives{}, Tag: ""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Frame", >i.Field{Name: "Frame", Type: "goki.dev/gi/v2/gi.Frame", LocalType: "gi.Frame", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &MapView{}, })
MapViewType is the gti.Type for MapView
var SliceViewBaseType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.SliceViewBase", ShortName: "giv.SliceViewBase", IDName: "slice-view-base", Doc: "SliceViewBase is the base for SliceView and TableView and any other viewers\nof array-like data. It automatically computes the number of rows that fit\nwithin its allocated space, and manages the offset view window into the full\nlist of items, and supports row selection, copy / paste, Drag-n-Drop, etc.\nSet to ReadOnly for select-only mode, which emits WidgetSig WidgetSelected\nsignals when selection is updated.\nAutomatically has a toolbar with Slice Toolbar props if defined\nset prop toolbar = false to turn off", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Slice", >i.Field{Name: "Slice", Type: "any", LocalType: "any", Doc: "the slice that we are a view onto -- must be a pointer to that slice", Directives: gti.Directives{}, Tag: "set:\"-\" copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, {"ViewMu", >i.Field{Name: "ViewMu", Type: "*sync.Mutex", LocalType: "*sync.Mutex", Doc: "optional mutex that, if non-nil, will be used around any updates that read / modify the underlying Slice data -- can be used to protect against random updating if your code has specific update points that can be likewise protected with this same mutex", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, {"Changed", >i.Field{Name: "Changed", Type: "bool", LocalType: "bool", Doc: "Changed indicates whether the underlying slice\nhas been edited in any way", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"SliceNPVal", >i.Field{Name: "SliceNPVal", Type: "reflect.Value", LocalType: "reflect.Value", Doc: "non-ptr reflect.Value of the slice", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, {"SliceValView", >i.Field{Name: "SliceValView", Type: "goki.dev/gi/v2/giv.Value", LocalType: "Value", Doc: "Value for the slice itself, if this was created within value view framework -- otherwise nil", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, {"Values", >i.Field{Name: "Values", Type: "[]goki.dev/gi/v2/giv.Value", LocalType: "[]Value", Doc: "Value representations of the slice values", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, {"SelVal", >i.Field{Name: "SelVal", Type: "any", LocalType: "any", Doc: "current selection value -- initially select this value if set", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, {"SelIdx", >i.Field{Name: "SelIdx", Type: "int", LocalType: "int", Doc: "index of currently-selected item, in ReadOnly mode only", Directives: gti.Directives{}, Tag: "copy:\"-\" json:\"-\" xml:\"-\""}}, {"SelIdxs", >i.Field{Name: "SelIdxs", Type: "map[int]struct{}", LocalType: "map[int]struct{}", Doc: "list of currently-selected slice indexes", Directives: gti.Directives{}, Tag: "copy:\"-\""}}, {"DraggedIdxs", >i.Field{Name: "DraggedIdxs", Type: "[]int", LocalType: "[]int", Doc: "list of currently-dragged indexes", Directives: gti.Directives{}, Tag: "copy:\"-\""}}, {"ViewPath", >i.Field{Name: "ViewPath", Type: "string", LocalType: "string", Doc: "a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows", Directives: gti.Directives{}, Tag: ""}}, {"TmpSave", >i.Field{Name: "TmpSave", Type: "goki.dev/gi/v2/giv.Value", LocalType: "Value", Doc: "value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent", Directives: gti.Directives{}, Tag: "copy:\"-\" json:\"-\" xml:\"-\""}}, {"ToolbarSlice", >i.Field{Name: "ToolbarSlice", Type: "any", LocalType: "any", Doc: "the slice that we successfully set a toolbar for", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, {"RowHeight", >i.Field{Name: "RowHeight", Type: "float32", LocalType: "float32", Doc: "height of a single row", Directives: gti.Directives{}, Tag: "edit:\"-\" copy:\"-\" json:\"-\" xml:\"-\""}}, {"LayoutHeight", >i.Field{Name: "LayoutHeight", Type: "float32", LocalType: "float32", Doc: "the height of grid from last layout -- determines when update needed", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, {"VisRows", >i.Field{Name: "VisRows", Type: "int", LocalType: "int", Doc: "total number of rows visible in allocated display size", Directives: gti.Directives{}, Tag: "edit:\"-\" copy:\"-\" json:\"-\" xml:\"-\""}}, {"StartIdx", >i.Field{Name: "StartIdx", Type: "int", LocalType: "int", Doc: "starting slice index of visible rows", Directives: gti.Directives{}, Tag: "edit:\"-\" copy:\"-\" json:\"-\" xml:\"-\""}}, {"RenderedRows", >i.Field{Name: "RenderedRows", Type: "int", LocalType: "int", Doc: "the number of rows rendered -- determines update", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, {"SliceSize", >i.Field{Name: "SliceSize", Type: "int", LocalType: "int", Doc: "size of slice", Directives: gti.Directives{}, Tag: "edit:\"-\" copy:\"-\" json:\"-\" xml:\"-\""}}, {"CurIdx", >i.Field{Name: "CurIdx", Type: "int", LocalType: "int", Doc: "temp idx state for e.g., dnd", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, {"ElVal", >i.Field{Name: "ElVal", Type: "reflect.Value", LocalType: "reflect.Value", Doc: "ElVal is a Value representation of the underlying element type\nwhich is used whenever there are no slice elements available", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Frame", >i.Field{Name: "Frame", Type: "goki.dev/gi/v2/gi.Frame", LocalType: "gi.Frame", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &SliceViewBase{}, })
SliceViewBaseType is the gti.Type for SliceViewBase
var SliceViewInlineType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.SliceViewInline", ShortName: "giv.SliceViewInline", IDName: "slice-view-inline", Doc: "SliceViewInline represents a slice as a single line widget,\nfor smaller slices and those explicitly marked inline.", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Slice", >i.Field{Name: "Slice", Type: "any", LocalType: "any", Doc: "the slice that we are a view onto", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"SliceValView", >i.Field{Name: "SliceValView", Type: "goki.dev/gi/v2/giv.Value", LocalType: "Value", Doc: "Value for the slice itself, if this was created within value view framework -- otherwise nil", Directives: gti.Directives{}, Tag: ""}}, {"IsArray", >i.Field{Name: "IsArray", Type: "bool", LocalType: "bool", Doc: "whether the slice is actually an array -- no modifications", Directives: gti.Directives{}, Tag: ""}}, {"IsFixedLen", >i.Field{Name: "IsFixedLen", Type: "bool", LocalType: "bool", Doc: "whether the slice has a fixed-len flag on it", Directives: gti.Directives{}, Tag: ""}}, {"Changed", >i.Field{Name: "Changed", Type: "bool", LocalType: "bool", Doc: "has the slice been edited?", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"Values", >i.Field{Name: "Values", Type: "[]goki.dev/gi/v2/giv.Value", LocalType: "[]Value", Doc: "Value representations of the fields", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\""}}, {"TmpSave", >i.Field{Name: "TmpSave", Type: "goki.dev/gi/v2/giv.Value", LocalType: "Value", Doc: "value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent", Directives: gti.Directives{}, Tag: "view:\"-\" json:\"-\" xml:\"-\""}}, {"ViewPath", >i.Field{Name: "ViewPath", Type: "string", LocalType: "string", Doc: "a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows", Directives: gti.Directives{}, Tag: ""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Layout", >i.Field{Name: "Layout", Type: "goki.dev/gi/v2/gi.Layout", LocalType: "gi.Layout", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &SliceViewInline{}, })
SliceViewInlineType is the gti.Type for SliceViewInline
var SliceViewType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.SliceView", ShortName: "giv.SliceView", IDName: "slice-view", Doc: "SliceView represents a slice, creating an interactive viewer / editor of the\nelements as rows in a table. Widgets to show the index / value pairs, within an\noverall frame.\nSet to ReadOnly for select-only mode, which emits WidgetSig WidgetSelected\nsignals when selection is updated.", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"StyleFunc", >i.Field{Name: "StyleFunc", Type: "goki.dev/gi/v2/giv.SliceViewStyleFunc", LocalType: "SliceViewStyleFunc", Doc: "optional styling function", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"SliceViewBase", >i.Field{Name: "SliceViewBase", Type: "goki.dev/gi/v2/giv.SliceViewBase", LocalType: "SliceViewBase", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &SliceView{}, })
SliceViewType is the gti.Type for SliceView
var StructViewInlineType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.StructViewInline", ShortName: "giv.StructViewInline", IDName: "struct-view-inline", Doc: "StructViewInline represents a struct as a single line widget,\nfor smaller structs and those explicitly marked inline.", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Struct", >i.Field{Name: "Struct", Type: "any", LocalType: "any", Doc: "the struct that we are a view onto", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"StructValView", >i.Field{Name: "StructValView", Type: "goki.dev/gi/v2/giv.Value", LocalType: "Value", Doc: "Value for the struct itself, if this was created within value view framework -- otherwise nil", Directives: gti.Directives{}, Tag: ""}}, {"AddButton", >i.Field{Name: "AddButton", Type: "bool", LocalType: "bool", Doc: "if true add an edit action button at the end -- other users of this widget can then configure that -- it is called 'edit-action'", Directives: gti.Directives{}, Tag: ""}}, {"FieldViews", >i.Field{Name: "FieldViews", Type: "[]goki.dev/gi/v2/giv.Value", LocalType: "[]Value", Doc: "Value representations of the fields", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\""}}, {"TmpSave", >i.Field{Name: "TmpSave", Type: "goki.dev/gi/v2/giv.Value", LocalType: "Value", Doc: "value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\" view:\"-\""}}, {"ViewPath", >i.Field{Name: "ViewPath", Type: "string", LocalType: "string", Doc: "a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows", Directives: gti.Directives{}, Tag: ""}}, {"HasDefs", >i.Field{Name: "HasDefs", Type: "bool", LocalType: "bool", Doc: "if true, some fields have default values -- update labels when values change", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\" edit:\"-\""}}, {"HasViewIfs", >i.Field{Name: "HasViewIfs", Type: "bool", LocalType: "bool", Doc: "if true, some fields have viewif conditional view tags -- update after..", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\" edit:\"-\""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Frame", >i.Field{Name: "Frame", Type: "goki.dev/gi/v2/gi.Frame", LocalType: "gi.Frame", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &StructViewInline{}, })
StructViewInlineType is the gti.Type for StructViewInline
var StructViewType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.StructView", ShortName: "giv.StructView", IDName: "struct-view", Doc: "StructView represents a struct, creating a property editor of the fields --\nconstructs Children widgets to show the field names and editor fields for\neach field, within an overall frame.\nAutomatically has a toolbar with Struct Toolbar props if defined\nset prop toolbar = false to turn off", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Struct", >i.Field{Name: "Struct", Type: "any", LocalType: "any", Doc: "the struct that we are a view onto", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"StructValView", >i.Field{Name: "StructValView", Type: "goki.dev/gi/v2/giv.Value", LocalType: "Value", Doc: "Value for the struct itself, if this was created within value view framework -- otherwise nil", Directives: gti.Directives{}, Tag: ""}}, {"Changed", >i.Field{Name: "Changed", Type: "bool", LocalType: "bool", Doc: "has the value of any field changed? updated by the ViewSig signals from fields", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"ChangeFlag", >i.Field{Name: "ChangeFlag", Type: "*reflect.Value", LocalType: "*reflect.Value", Doc: "Value for a field marked with changeflag struct tag, which must be a bool type, which is updated when changes are registered in field values.", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\""}}, {"FieldViews", >i.Field{Name: "FieldViews", Type: "[]goki.dev/gi/v2/giv.Value", LocalType: "[]Value", Doc: "Value representations of the fields", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\""}}, {"ShowToolbar", >i.Field{Name: "ShowToolbar", Type: "bool", LocalType: "bool", Doc: "whether to show the toolbar or not", Directives: gti.Directives{}, Tag: ""}}, {"TmpSave", >i.Field{Name: "TmpSave", Type: "goki.dev/gi/v2/giv.Value", LocalType: "Value", Doc: "value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\""}}, {"ViewPath", >i.Field{Name: "ViewPath", Type: "string", LocalType: "string", Doc: "a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows", Directives: gti.Directives{}, Tag: ""}}, {"ToolbarStru", >i.Field{Name: "ToolbarStru", Type: "any", LocalType: "any", Doc: "the struct that we successfully set a toolbar for", Directives: gti.Directives{}, Tag: ""}}, {"HasDefs", >i.Field{Name: "HasDefs", Type: "bool", LocalType: "bool", Doc: "if true, some fields have default values -- update labels when values change", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\" edit:\"-\""}}, {"HasViewIfs", >i.Field{Name: "HasViewIfs", Type: "bool", LocalType: "bool", Doc: "if true, some fields have viewif conditional view tags -- update after..", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\" edit:\"-\""}}, {"TypeFieldTags", >i.Field{Name: "TypeFieldTags", Type: "map[string]string", LocalType: "map[string]string", Doc: "extra tags by field name -- from type properties", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\" edit:\"-\""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Frame", >i.Field{Name: "Frame", Type: "goki.dev/gi/v2/gi.Frame", LocalType: "gi.Frame", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &StructView{}, })
StructViewType is the gti.Type for StructView
var TableViewType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.TableView", ShortName: "giv.TableView", IDName: "table-view", Doc: "TableView represents a slice-of-structs as a table, where the fields are\nthe columns, within an overall frame. It is a full-featured editor with\nmultiple-selection, cut-and-paste, and drag-and-drop.\nIf ReadOnly, it functions as a mutually-exclusive item\nselector, highlighting the selected row and emitting a Selected action.", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"StyleFunc", >i.Field{Name: "StyleFunc", Type: "goki.dev/gi/v2/giv.TableViewStyleFunc", LocalType: "TableViewStyleFunc", Doc: "optional styling function", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, {"SelField", >i.Field{Name: "SelField", Type: "string", LocalType: "string", Doc: "current selection field -- initially select value in this field", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, {"SortIdx", >i.Field{Name: "SortIdx", Type: "int", LocalType: "int", Doc: "current sort index", Directives: gti.Directives{}, Tag: ""}}, {"SortDesc", >i.Field{Name: "SortDesc", Type: "bool", LocalType: "bool", Doc: "whether current sort order is descending", Directives: gti.Directives{}, Tag: ""}}, {"StruType", >i.Field{Name: "StruType", Type: "reflect.Type", LocalType: "reflect.Type", Doc: "struct type for each row", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, {"VisFields", >i.Field{Name: "VisFields", Type: "[]reflect.StructField", LocalType: "[]reflect.StructField", Doc: "the visible fields", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, {"NVisFields", >i.Field{Name: "NVisFields", Type: "int", LocalType: "int", Doc: "number of visible fields", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"SliceViewBase", >i.Field{Name: "SliceViewBase", Type: "goki.dev/gi/v2/giv.SliceViewBase", LocalType: "SliceViewBase", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &TableView{}, })
TableViewType is the gti.Type for TableView
var TreeViewPageSteps = 10
TreeViewPageSteps is the number of steps to take in PageUp / Down events
var TreeViewProps = ki.Props{ "CtxtMenuActive": ki.PropSlice{ {"SrcAddChild", ki.Props{ "label": "Add Child", }}, {"SrcInsertBefore", ki.Props{ "label": "Insert Before", "shortcut": keyfun.Insert, "updtfunc": ActionUpdateFunc(func(tvi any, act *gi.Button) { }), }}, {"SrcInsertAfter", ki.Props{ "label": "Insert After", "shortcut": keyfun.InsertAfter, "updtfunc": ActionUpdateFunc(func(tvi any, act *gi.Button) { }), }}, {"SrcDuplicate", ki.Props{ "label": "Duplicate", "shortcut": keyfun.Duplicate, "updtfunc": ActionUpdateFunc(func(tvi any, act *gi.Button) { }), }}, {"SrcDelete", ki.Props{ "label": "Delete", "shortcut": keyfun.Delete, "updtfunc": ActionUpdateFunc(func(tvi any, act *gi.Button) { }), }}, {"sep-edit", ki.BlankProp{}}, {"Copy", ki.Props{ "shortcut": keyfun.Copy, "Args": ki.PropSlice{ {"reset", ki.Props{ "value": true, }}, }, }}, {"Cut", ki.Props{ "shortcut": keyfun.Cut, "updtfunc": ActionUpdateFunc(func(tvi any, act *gi.Button) { }), }}, {"Paste", ki.Props{ "shortcut": keyfun.Paste, }}, {"sep-win", ki.BlankProp{}}, {"SrcEdit", ki.Props{ "label": "Edit", }}, {"SrcGoGiEditor", ki.Props{ "label": "GoGi Editor", }}, {"sep-open", ki.BlankProp{}}, {"OpenAll", ki.Props{}}, {"CloseAll", ki.Props{}}, }, "CtxtMenuReadOnly": ki.PropSlice{ {"Copy", ki.Props{ "shortcut": keyfun.Copy, "Args": ki.PropSlice{ {"reset", ki.Props{ "value": true, }}, }, }}, {"SrcEdit", ki.Props{ "label": "Edit", }}, {"SrcGoGiEditor", ki.Props{ "label": "GoGi Editor", }}, }, }
var TreeViewType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.TreeView", ShortName: "giv.TreeView", IDName: "tree-view", Doc: "TreeView provides a graphical representation of a tree tructure\nproviding full navigation and manipulation abilities.\n\nIf the SyncNode field is non-nil, typically via\nSyncRootNode method, then the TreeView mirrors another\nKi tree structure, and tree editing functions apply to\nthe source tree first, and then to the TreeView by sync.\n\nOtherwise, data can be directly encoded in a TreeView\nderived type, to represent any kind of tree structure\nand associated data.\n\nStandard events.Event are sent to any listeners, including\nSelect, Change, and DoubleClick. The selected nodes\nare in the root SelectedNodes list.", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"SyncNode", >i.Field{Name: "SyncNode", Type: "goki.dev/ki/v2.Ki", LocalType: "ki.Ki", Doc: "If non-Ki Node that this widget is viewing in the tree -- the source", Directives: gti.Directives{}, Tag: "set:\"-\" copy:\"-\" json:\"-\" xml:\"-\""}}, {"Icon", >i.Field{Name: "Icon", Type: "goki.dev/icons.Icon", LocalType: "icons.Icon", Doc: "optional icon, displayed to the the left of the text label", Directives: gti.Directives{}, Tag: ""}}, {"Indent", >i.Field{Name: "Indent", Type: "goki.dev/girl/units.Value", LocalType: "units.Value", Doc: "amount to indent children relative to this node", Directives: gti.Directives{}, Tag: "copy:\"-\" json:\"-\" xml:\"-\""}}, {"OpenDepth", >i.Field{Name: "OpenDepth", Type: "int", LocalType: "int", Doc: "depth for nodes be initialized as open (default 4).\nNodes beyond this depth will be initialized as closed.", Directives: gti.Directives{}, Tag: "copy:\"-\" json:\"-\" xml:\"-\""}}, {"ViewIdx", >i.Field{Name: "ViewIdx", Type: "int", LocalType: "int", Doc: "linear index of this node within the entire tree.\nupdated on full rebuilds and may sometimes be off,\nbut close enough for expected uses", Directives: gti.Directives{}, Tag: "copy:\"-\" json:\"-\" xml:\"-\" edit:\"-\""}}, {"WidgetSize", >i.Field{Name: "WidgetSize", Type: "goki.dev/mat32/v2.Vec2", LocalType: "mat32.Vec2", Doc: "size of just this node widget.\nour alloc includes all of our children, but we only draw us.", Directives: gti.Directives{}, Tag: "copy:\"-\" json:\"-\" xml:\"-\" edit:\"-\""}}, {"RootView", >i.Field{Name: "RootView", Type: "*goki.dev/gi/v2/giv.TreeView", LocalType: "*TreeView", Doc: "cached root of the view", Directives: gti.Directives{}, Tag: "copy:\"-\" json:\"-\" xml:\"-\" edit:\"-\""}}, {"SelectedNodes", >i.Field{Name: "SelectedNodes", Type: "[]*goki.dev/gi/v2/giv.TreeView", LocalType: "[]*TreeView", Doc: "SelectedNodes holds the currently-selected nodes, on the\nRootView node only.", Directives: gti.Directives{}, Tag: "copy:\"-\" json:\"-\" xml:\"-\" edit:\"-\""}}, {"actStateLayer", >i.Field{Name: "actStateLayer", Type: "float32", LocalType: "float32", Doc: "actStateLayer is the actual state layer of the tree view, which\nshould be used when rendering it and its parts (but not its children).\nthe reason that it exists is so that the children of the tree view\n(other tree views) do not inherit its stateful background color, as\nthat does not look good.", Directives: gti.Directives{}, Tag: "set:\"-\""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"WidgetBase", >i.Field{Name: "WidgetBase", Type: "goki.dev/gi/v2/gi.WidgetBase", LocalType: "gi.WidgetBase", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{ {"InsertAfter", >i.Method{Name: "InsertAfter", Doc: "InsertAfter inserts a new node in the tree\nafter this node, at the same (sibling) level,\nprompting for the type of node to insert.\nIf SyncNode is set, operates on Sync Tree.", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"InsertBefore", >i.Method{Name: "InsertBefore", Doc: "InsertBefore inserts a new node in the tree\nbefore this node, at the same (sibling) level,\nprompting for the type of node to insert\nIf SyncNode is set, operates on Sync Tree.", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"AddChildNode", >i.Method{Name: "AddChildNode", Doc: "AddChildNode adds a new child node to this one in the tree,\nprompting the user for the type of node to add\nIf SyncNode is set, operates on Sync Tree.", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"DeleteNode", >i.Method{Name: "DeleteNode", Doc: "DeleteNode deletes the tree node or sync node corresponding\nto this view node in the sync tree.\nIf SyncNode is set, operates on Sync Tree.", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"Duplicate", >i.Method{Name: "Duplicate", Doc: "Duplicate duplicates the sync node corresponding to this view node in\nthe tree, and inserts the duplicate after this node (as a new sibling).\nIf SyncNode is set, operates on Sync Tree.", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"EditNode", >i.Method{Name: "EditNode", Doc: "EditNode pulls up a StructViewDialog window on the node.\nIf SyncNode is set, operates on Sync Tree.", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"GoGiEditNode", >i.Method{Name: "GoGiEditNode", Doc: "GoGiEditNode pulls up a new GoGiEditor window on the node.\nIf SyncNode is set, operates on Sync Tree.", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"OpenAll", >i.Method{Name: "OpenAll", Doc: "OpenAll opens the given node and all of its sub-nodes", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"CloseAll", >i.Method{Name: "CloseAll", Doc: "CloseAll closes the given node and all of its sub-nodes.", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"Copy", >i.Method{Name: "Copy", Doc: "Copy copies to clip.Board, optionally resetting the selection.\nsatisfies gi.Clipper interface and can be overridden by subtypes", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"reset", >i.Field{Name: "reset", Type: "bool", LocalType: "bool", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"Cut", >i.Method{Name: "Cut", Doc: "Cut copies to clip.Board and deletes selected items.\nsatisfies gi.Clipper interface and can be overridden by subtypes", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, {"Paste", >i.Method{Name: "Paste", Doc: "Paste pastes clipboard at given node.\nsatisfies gi.Clipper interface and can be overridden by subtypes", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Args: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Returns: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{})}}, }), Instance: &TreeView{}, })
TreeViewType is the gti.Type for TreeView
var VCSLogViewType = gti.AddType(>i.Type{ Name: "goki.dev/gi/v2/giv.VCSLogView", ShortName: "giv.VCSLogView", IDName: "vcs-log-view", Doc: "VCSLogView is a view of the variables", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Log", >i.Field{Name: "Log", Type: "goki.dev/vci/v2.Log", LocalType: "vci.Log", Doc: "current log", Directives: gti.Directives{}, Tag: ""}}, {"File", >i.Field{Name: "File", Type: "string", LocalType: "string", Doc: "file that this is a log of -- if blank then it is entire repository", Directives: gti.Directives{}, Tag: ""}}, {"Since", >i.Field{Name: "Since", Type: "string", LocalType: "string", Doc: "date expression for how long ago to include log entries from", Directives: gti.Directives{}, Tag: ""}}, {"Repo", >i.Field{Name: "Repo", Type: "goki.dev/vci/v2.Repo", LocalType: "vci.Repo", Doc: "version control system repository", Directives: gti.Directives{}, Tag: "json:\"-\" xml:\"-\" copy:\"-\""}}, {"RevA", >i.Field{Name: "RevA", Type: "string", LocalType: "string", Doc: "revision A -- defaults to HEAD", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"RevB", >i.Field{Name: "RevB", Type: "string", LocalType: "string", Doc: "revision B -- blank means current working copy", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"SetA", >i.Field{Name: "SetA", Type: "bool", LocalType: "bool", Doc: "double-click will set the A revision -- else B", Directives: gti.Directives{}, Tag: ""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Layout", >i.Field{Name: "Layout", Type: "goki.dev/gi/v2/gi.Layout", LocalType: "gi.Layout", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &VCSLogView{}, })
VCSLogViewType is the gti.Type for VCSLogView
var ValueMap map[string]ValueFunc
The ValueMap is used to connect type names with corresponding Value representations of those types -- this can be used when it is not possible to use the Valuer interface (e.g., interface methods can only be defined within the package that defines the type -- so we need this for all types in gi which don't know about giv). You must use laser.LongTypeName (full package name + "." . type name) for the type name, as that is how it will be looked up.
var VersCtrlSystems = []string{"git", "svn", "bzr", "hg"}
VersCtrlSystems is a list of supported Version Control Systems. These must match the VCS Types from goki/pi/vci which in turn is based on masterminds/vcs
Functions ¶
func FileViewDirOnlyFilter ¶
FileViewDirOnlyFilter is a FileViewFilterFunc that only shows directories (folders).
func FileViewExtOnlyFilter ¶
FileViewExtOnlyFilter is a FileViewFilterFunc that only shows files that match the target extensions, and directories.
func GoGiEditorDialog ¶
func GoGiEditorDialog(obj ki.Ki)
GoGiEditorDialog opens an interactive editor of the given Ki tree, at its root, returns GiEditor and window
func HiStylesView ¶
HiStylesView opens a view of highlighting styles
func IsVersCtrlSystem ¶
IsVersCtrlSystem returns true if the given string matches one of the standard VersCtrlSystems -- uses lowercase version of str.
func PrefsDbgView ¶
func PrefsDbgView(pf *gi.PrefsDebug)
PrefsDbgView opens a view of user debugging preferences
func PrefsDetView ¶
func PrefsDetView(pf *gi.PrefsDetailed)
PrefsDetView opens a view of user detailed preferences
func SetSoloValueIface ¶
SetSoloValueIface sets the value for a singleton standalone value using an interface for the value -- you must pass a pointer. for now, this cannot be a method because gopy doesn't find the key comment below that tells it what to do with the interface gopy:interface=handle
func SliceIdxByValue ¶
SliceIdxByValue searches for first index that contains given value in slice -- returns false if not found
func StructFieldIsDef ¶
StructFieldIsDef processses "def" tag for default value(s) of field defs = default values as strings as either comma-separated list of valid values or low:high value range (only for int or float numeric types) valPtr = pointer to value returns true if value is default, and string to add to tooltip for default values. Uses JSON format for composite types (struct, slice, map), replacing " with ' so it is easier to use in def tag.
func StructNonDefFieldsStr ¶
StructNonDefFieldsStr processses "def" tag for default value(s) of fields in given struct, and returns a string of all those not at their default values, in format: Path.Field: val // default value(s) Uses a recursive strategy -- any fields that are themselves structs are expanded, and the field name represented by dots path separators.
func StructSliceIdxByValue ¶
StructSliceIdxByValue searches for first index that contains given value in field of given name.
func StructTagVal ¶
StructTagVal returns the value for given key in given struct tag string uses reflect.StructTag Lookup method -- just a wrapper for external use (e.g., in Python code)
func StructViewFieldDefTag ¶
StructViewFieldDefTag processes the "def" tag for default values -- can be called multiple times for updating as values change. returns true if value is default, and string to add to tooltip for default vals
func StructViewFieldTags ¶
func StructViewFieldTags(vv Value, lbl *gi.Label, w gi.Widget, isReadOnly bool) (hasDef, readOnlyTag bool)
StructViewFieldTags processes the tags for a field in a struct view, setting the properties on the label or widget appropriately returns true if there were any "def" default tags -- if so, needs updating
func StructViewIf ¶
func StructViewIf(viewif string, field reflect.StructField, stru any) bool
StructViewIf parses given `viewif:"expr"` expression and returns true if should be visible, false if not. Prints an error if the expression is not parsed properly or does not evaluate to a boolean.
func VCSLogViewDialog ¶
VCSLogViewDialog returns a VCS Log View for given repo, log and file (file could be empty)
func ValueMapAdd ¶
ValueMapAdd adds a ValueFunc for a given type name. You must use laser.LongTypeName (full package name + "." . type name) for the type name, as that is how it will be looked up.
func ViewStdKeyMaps ¶
func ViewStdKeyMaps()
ViewStdKeyMaps shows the standard maps that are compiled into the program and have all the lastest key functions bound to standard values. Useful for comparing against custom maps.
Types ¶
type ActionUpdateFunc ¶
ActionUpdateFunc is a function that updates method enabled / disabled status. The first argument is the object on which the method is defined (receiver).
type ArgView ¶
type ArgView struct { gi.Frame // title / prompt to show above the editor fields Title string // the args that we are a view onto Args []Value // a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows ViewPath string }
ArgView represents a slice of reflect.Value's and associated names, for the purpose of supplying arguments to methods called via the MethodView framework.
func NewArgView ¶
NewArgView adds a new ArgView with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*ArgView) ArgsGrid ¶
ArgsGrid returns the grid layout widget, which contains all the fields and values, and its index, within frame
func (*ArgView) ConfigArgsGrid ¶
func (av *ArgView) ConfigArgsGrid()
ConfigArgsGrid configures the ArgsGrid for the current struct
func (*ArgView) ConfigWidget ¶
Config configures the view
func (*ArgView) SetCustomContextMenu ¶
SetCustomContextMenu sets the [ArgView.CustomContextMenu]
func (*ArgView) SetSpacing ¶
SetSpacing sets the [ArgView.Spacing]
func (*ArgView) SetStackTop ¶
SetStackTop sets the [ArgView.StackTop]
func (*ArgView) SetStripes ¶
SetStripes sets the [ArgView.Stripes]
func (*ArgView) SetTitle ¶
SetTitle sets the [ArgView.Title]: title / prompt to show above the editor fields
func (*ArgView) SetTooltip ¶
SetTooltip sets the [ArgView.Tooltip]
func (*ArgView) SetViewPath ¶
SetViewPath sets the [ArgView.ViewPath]: a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows
func (*ArgView) TitleWidget ¶
Title returns the title label widget, and its index, within frame
func (*ArgView) UpdateArgs ¶
func (av *ArgView) UpdateArgs()
UpdateArgs updates each of the value-view widgets for the args
type BitFlagValue ¶
type BitFlagValue struct {
ValueBase
}
BitFlagValue presents chip gi.Switches for editing bitflags
func (*BitFlagValue) ConfigWidget ¶
func (vv *BitFlagValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*BitFlagValue) EnumValue ¶
func (vv *BitFlagValue) EnumValue() enums.BitFlag
func (*BitFlagValue) SetEnumValueFromInt ¶
func (vv *BitFlagValue) SetEnumValueFromInt(ival int64) bool
func (*BitFlagValue) UpdateWidget ¶
func (vv *BitFlagValue) UpdateWidget()
func (*BitFlagValue) WidgetType ¶
func (vv *BitFlagValue) WidgetType() *gti.Type
type BoolValue ¶
type BoolValue struct {
ValueBase
}
BoolValue presents a checkbox for a boolean
func (*BoolValue) UpdateWidget ¶
func (vv *BoolValue) UpdateWidget()
func (*BoolValue) WidgetType ¶
type ByteSliceValue ¶
type ByteSliceValue struct {
ValueBase
}
ByteSliceValue presents a textfield of the bytes
func (*ByteSliceValue) ConfigWidget ¶
func (vv *ByteSliceValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*ByteSliceValue) UpdateWidget ¶
func (vv *ByteSliceValue) UpdateWidget()
func (*ByteSliceValue) WidgetType ¶
func (vv *ByteSliceValue) WidgetType() *gti.Type
type ColorMapName ¶
type ColorMapName string
ColorMapName provides a gui chooser of maps in AvailColorMaps
func (ColorMapName) Value ¶
func (mn ColorMapName) Value() Value
Value registers ColorMapValue as the viewer of ColorMapName
type ColorMapValue ¶
type ColorMapValue struct {
ValueBase
}
ColorMapValue presents an button for displaying a ColorMapName and selecting meshes from a ChooserDialog
func (*ColorMapValue) ConfigWidget ¶
func (vv *ColorMapValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*ColorMapValue) HasButton ¶
func (vv *ColorMapValue) HasButton() bool
func (*ColorMapValue) OpenDialog ¶
func (vv *ColorMapValue) OpenDialog(ctx gi.Widget, fun func(dlg *gi.Dialog))
func (*ColorMapValue) UpdateWidget ¶
func (vv *ColorMapValue) UpdateWidget()
func (*ColorMapValue) WidgetType ¶
func (vv *ColorMapValue) WidgetType() *gti.Type
type ColorMapView ¶
type ColorMapView struct { gi.WidgetBase // orientation along which to display the spectrum Orient mat32.Dims // the colormap that we view Map *colormap.Map }
ColorMapView is a widget that displays a ColorMap. Note that this is not a Value widget
func NewColorMapView ¶
func NewColorMapView(par ki.Ki, name ...string) *ColorMapView
NewColorMapView adds a new ColorMapView with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*ColorMapView) ChooseColorMap ¶
func (cv *ColorMapView) ChooseColorMap()
ChooseColorMap pulls up a chooser to select a color map
func (*ColorMapView) HandleColorMapEvents ¶
func (cv *ColorMapView) HandleColorMapEvents()
func (*ColorMapView) KiType ¶
func (t *ColorMapView) KiType() *gti.Type
KiType returns the *gti.Type of ColorMapView
func (*ColorMapView) OnInit ¶
func (cv *ColorMapView) OnInit()
func (*ColorMapView) Render ¶
func (cv *ColorMapView) Render(sc *gi.Scene)
func (*ColorMapView) RenderColorMap ¶
func (cv *ColorMapView) RenderColorMap(sc *gi.Scene)
func (*ColorMapView) SetClass ¶
func (t *ColorMapView) SetClass(v string) *ColorMapView
SetClass sets the [ColorMapView.Class]
func (*ColorMapView) SetColorMap ¶
func (cv *ColorMapView) SetColorMap(cmap *colormap.Map)
SetColorMap sets the color map and triggers a display update
func (*ColorMapView) SetColorMapAction ¶
func (cv *ColorMapView) SetColorMapAction(cmap *colormap.Map)
SetColorMapAction sets the color map and triggers a display update and signals the ColorMapSig signal
func (*ColorMapView) SetCustomContextMenu ¶
func (t *ColorMapView) SetCustomContextMenu(v func(m *gi.Scene)) *ColorMapView
SetCustomContextMenu sets the [ColorMapView.CustomContextMenu]
func (*ColorMapView) SetMap ¶
func (t *ColorMapView) SetMap(v *colormap.Map) *ColorMapView
SetMap sets the [ColorMapView.Map]: the colormap that we view
func (*ColorMapView) SetOrient ¶
func (t *ColorMapView) SetOrient(v mat32.Dims) *ColorMapView
SetOrient sets the [ColorMapView.Orient]: orientation along which to display the spectrum
func (*ColorMapView) SetTooltip ¶
func (t *ColorMapView) SetTooltip(v string) *ColorMapView
SetTooltip sets the [ColorMapView.Tooltip]
type ColorNameValue ¶
type ColorNameValue struct {
ValueBase
}
ColorNameValue presents an button for displaying a ColorNameName and selecting meshes from a ChooserDialog
func (*ColorNameValue) ConfigWidget ¶
func (vv *ColorNameValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*ColorNameValue) HasButton ¶
func (vv *ColorNameValue) HasButton() bool
func (*ColorNameValue) OpenDialog ¶
func (vv *ColorNameValue) OpenDialog(ctx gi.Widget, fun func(dlg *gi.Dialog))
func (*ColorNameValue) UpdateWidget ¶
func (vv *ColorNameValue) UpdateWidget()
func (*ColorNameValue) WidgetType ¶
func (vv *ColorNameValue) WidgetType() *gti.Type
type ColorValue ¶
ColorValue presents a StructViewInline for a struct plus a ColorView button..
func (*ColorValue) Color ¶
func (vv *ColorValue) Color() (*color.RGBA, bool)
Color returns a standardized color value from whatever value is represented internally
func (*ColorValue) ConfigWidget ¶
func (vv *ColorValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*ColorValue) HasButton ¶
func (vv *ColorValue) HasButton() bool
func (*ColorValue) OpenDialog ¶
func (vv *ColorValue) OpenDialog(ctx gi.Widget, fun func(dlg *gi.Dialog))
func (*ColorValue) SetColor ¶
func (vv *ColorValue) SetColor(clr color.RGBA)
SetColor sets color value from a standard color value -- more robust than plain SetValue
func (*ColorValue) UpdateWidget ¶
func (vv *ColorValue) UpdateWidget()
func (*ColorValue) WidgetType ¶
func (vv *ColorValue) WidgetType() *gti.Type
type ColorView ¶
type ColorView struct { gi.Frame // the color that we view Color color.RGBA `set:"-"` // the color that we view, in HSLA form ColorHSLA hsl.HSL `edit:"-"` // value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent TmpSave Value `json:"-" xml:"-"` // a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows ViewPath string }
ColorView shows a color, using sliders or numbers to set values.
func NewColorView ¶
NewColorView adds a new ColorView with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*ColorView) ConfigPalette ¶
func (cv *ColorView) ConfigPalette()
func (*ColorView) ConfigWidget ¶
Config configures a standard setup of entire view
func (*ColorView) SetColorHsla ¶
SetColorHsla sets the [ColorView.ColorHSLA]: the color that we view, in HSLA form
func (*ColorView) SetCustomContextMenu ¶
SetCustomContextMenu sets the [ColorView.CustomContextMenu]
func (*ColorView) SetHSLValue ¶
func (*ColorView) SetRGBValue ¶
func (*ColorView) SetSpacing ¶
SetSpacing sets the [ColorView.Spacing]
func (*ColorView) SetStackTop ¶
SetStackTop sets the [ColorView.StackTop]
func (*ColorView) SetStripes ¶
SetStripes sets the [ColorView.Stripes]
func (*ColorView) SetTmpSave ¶
SetTmpSave sets the [ColorView.TmpSave]: value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent
func (*ColorView) SetTooltip ¶
SetTooltip sets the [ColorView.Tooltip]
func (*ColorView) SetViewPath ¶
SetViewPath sets the [ColorView.ViewPath]: a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows
func (*ColorView) SliderGrid ¶
func (*ColorView) UpdateImpl ¶
func (cv *ColorView) UpdateImpl()
UpdateImpl does the raw updates based on current value, without UpdateStart / End wrapper
func (*ColorView) UpdateNums ¶
func (cv *ColorView) UpdateNums()
UpdateNums updates the values of the number inputs in the color view to reflect the latest values
func (*ColorView) UpdateSliderGrid ¶
func (cv *ColorView) UpdateSliderGrid()
func (*ColorView) UpdateValueFrame ¶
func (cv *ColorView) UpdateValueFrame()
UpdateValueFrame updates the value frame of the color view that displays the color.
type DurationValue ¶
type DurationValue struct {
ValueBase
}
DurationValue presents a spinner and unit chooser for a time.Duration
func (*DurationValue) ConfigWidget ¶
func (vv *DurationValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*DurationValue) UpdateWidget ¶
func (vv *DurationValue) UpdateWidget()
func (*DurationValue) WidgetType ¶
func (vv *DurationValue) WidgetType() *gti.Type
type Editor ¶
type Editor struct { gi.WidgetBase // view translation offset (from dragging) Trans mat32.Vec2 // view scaling (from zooming) Scale float32 // has dragging cursor been set yet? SetDragCursor bool `view:"-"` }
Editor supports editing of SVG elements
func NewEditor ¶
NewEditor adds a new Editor with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*Editor) CopyFieldsFrom ¶
func (*Editor) HandleEditorEvents ¶
func (sve *Editor) HandleEditorEvents()
HandleEditorEvents handles svg editing events
func (*Editor) InitScale ¶
func (sve *Editor) InitScale()
InitScale ensures that Scale is initialized and non-zero
func (*Editor) SetCustomContextMenu ¶
SetCustomContextMenu sets the [Editor.CustomContextMenu]
func (*Editor) SetSetDragCursor ¶
SetSetDragCursor sets the [Editor.SetDragCursor]: has dragging cursor been set yet?
func (*Editor) SetTooltip ¶
SetTooltip sets the [Editor.Tooltip]
func (*Editor) SetTransform ¶
func (sve *Editor) SetTransform()
SetTransform sets the transform based on Trans and Scale values
type EnumValue ¶
type EnumValue struct {
ValueBase
}
EnumValue presents a chooser for choosing enums
func (*EnumValue) UpdateWidget ¶
func (vv *EnumValue) UpdateWidget()
func (*EnumValue) WidgetType ¶
type FieldValuer ¶
FieldValuer interface supplies the appropriate type of Value for a given field name and current field value on the receiver parent struct -- called on a given receiver struct if defined for that receiver type (tries both pointer and non-pointer receivers) -- if a struct implements this interface, then it is used first for structs -- return nil to fall back on the default ToValue result
type FileValue ¶
type FileValue struct {
ValueBase
}
FileValue presents an action for displaying a FileName and selecting icons from FileChooserDialog
func (*FileValue) OpenDialog ¶
func (*FileValue) UpdateWidget ¶
func (vv *FileValue) UpdateWidget()
func (*FileValue) WidgetType ¶
type FileView ¶
type FileView struct { gi.Frame // path to directory of files to display DirPath string // selected file SelFile string // target extension(s) (comma separated if multiple, including initial .), if any Ext string `set:"-"` // optional styling function FilterFunc FileViewFilterFunc `view:"-" json:"-" xml:"-"` // map of lower-cased extensions from Ext -- used for highlighting files with one of these extensions -- maps onto original ext value ExtMap map[string]string // files for current directory Files []*filecat.FileInfo // index of currently-selected file in Files list (-1 if none) SelectedIdx int `set:"-" edit:"-"` // change notify for current dir Watcher *fsnotify.Watcher `set:"-" view:"-"` // channel to close watcher watcher DoneWatcher chan bool `set:"-" view:"-"` // UpdateFiles mutex UpdtMu sync.Mutex `set:"-" view:"-"` // Previous path that was processed via UpdateFiles PrevPath string `set:"-" view:"-"` }
FileView is a viewer onto files -- core of the file chooser dialog
func NewFileView ¶
NewFileView adds a new FileView with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*FileView) AddPathToFavs ¶
func (fv *FileView) AddPathToFavs()
AddPathToFavs adds the current path to favorites
func (*FileView) ApplyStyle ¶
func (*FileView) ConfigFileView ¶
func (*FileView) ConfigFilesRow ¶
func (fv *FileView) ConfigFilesRow()
func (*FileView) ConfigPathBar ¶
func (fv *FileView) ConfigPathBar()
func (*FileView) ConfigSelRow ¶
func (fv *FileView) ConfigSelRow()
func (*FileView) ConfigWatcher ¶
func (*FileView) ConfigWidget ¶
func (*FileView) DirPathUp ¶
func (fv *FileView) DirPathUp()
DirPathUp moves up one directory in the path
func (*FileView) Disconnect ¶
func (fv *FileView) Disconnect()
func (*FileView) EditPaths ¶
func (fv *FileView) EditPaths()
EditPaths displays a dialog allowing user to delete paths from the path list
func (*FileView) FileComplete ¶
FileComplete finds the possible completions for the file field
func (*FileView) FileCompleteEdit ¶
func (fv *FileView) FileCompleteEdit(data any, text string, cursorPos int, c complete.Completion, seed string) (ed complete.Edit)
FileCompleteEdit is the editing function called when inserting the completion selection in the file field
func (*FileView) FileSelectAction ¶
FileSelectAction updates selection with given selected file and emits selected signal on WidgetSig with full name of selected item
func (*FileView) FileViewStyles ¶
func (fv *FileView) FileViewStyles()
func (*FileView) HandleFileViewEvents ¶
func (fv *FileView) HandleFileViewEvents()
func (*FileView) NewFolder ¶
func (fv *FileView) NewFolder()
NewFolder creates a new folder in current directory
func (*FileView) PathComplete ¶
PathComplete finds the possible completions for the path field
func (*FileView) PathCompleteEdit ¶
func (fv *FileView) PathCompleteEdit(data any, text string, cursorPos int, c complete.Completion, seed string) (ed complete.Edit)
PathCompleteEdit is the editing function called when inserting the completion selection in the path field
func (*FileView) PathFieldHistNext ¶
func (fv *FileView) PathFieldHistNext()
PathFieldHistNext goes to the next path in history
func (*FileView) PathFieldHistPrev ¶
func (fv *FileView) PathFieldHistPrev()
PathFieldHistPrev goes to the previous path in history
func (*FileView) SaveSortPrefs ¶
func (fv *FileView) SaveSortPrefs()
SaveSortPrefs saves current sorting preferences
func (*FileView) SelectFile ¶
SelectFile selects the current file as the selection. if a directory it opens the directory and returns false. if a file it selects the file and returns true. if no selection, returns false.
func (*FileView) SelectedFile ¶
SelectedFile returns the full path to selected file
func (*FileView) SelectedFileInfo ¶
SelectedFileInfo returns the currently-selected fileinfo, returns false if none
func (*FileView) SetCustomContextMenu ¶
SetCustomContextMenu sets the [FileView.CustomContextMenu]
func (*FileView) SetDirPath ¶
SetDirPath sets the [FileView.DirPath]: path to directory of files to display
func (*FileView) SetExtAction ¶
SetExtAction sets the current extension to highlight, and redisplays files
func (*FileView) SetExtMap ¶
SetExtMap sets the [FileView.ExtMap]: map of lower-cased extensions from Ext -- used for highlighting files with one of these extensions -- maps onto original ext value
func (*FileView) SetFilename ¶
SetFilename sets the initial filename (splitting out path and filename) and initializes the view
func (*FileView) SetFilterFunc ¶
func (t *FileView) SetFilterFunc(v FileViewFilterFunc) *FileView
SetFilterFunc sets the [FileView.FilterFunc]: optional styling function
func (*FileView) SetPathFile ¶
SetPathFile sets the path, initial select file (or "") and initializes the view
func (*FileView) SetSelFile ¶
SetSelFile sets the [FileView.SelFile]: selected file
func (*FileView) SetSelFileAction ¶
SetSelFileAction sets the currently selected file to given name, and sends selection action with current full file name, and updates selection in table view
func (*FileView) SetSpacing ¶
SetSpacing sets the [FileView.Spacing]
func (*FileView) SetStackTop ¶
SetStackTop sets the [FileView.StackTop]
func (*FileView) SetStripes ¶
SetStripes sets the [FileView.Stripes]
func (*FileView) SetTooltip ¶
SetTooltip sets the [FileView.Tooltip]
func (*FileView) UpdateFavs ¶
func (fv *FileView) UpdateFavs()
UpdateFavs updates list of files and other views for current path
func (*FileView) UpdateFiles ¶
func (fv *FileView) UpdateFiles()
UpdateFiles updates list of files and other views for current path
func (*FileView) UpdateFilesAction ¶
func (fv *FileView) UpdateFilesAction()
UpdateFilesAction updates list of files and other views for current path, emitting FileSig signals around it -- this is for gui-generated actions only.
func (*FileView) UpdatePath ¶
func (fv *FileView) UpdatePath()
UpdatePath ensures that path is in abs form and ready to be used..
func (*FileView) WatchWatcher ¶
func (fv *FileView) WatchWatcher()
type FileViewFilterFunc ¶
FileViewFilterFunc is a filtering function for files -- returns true if the file should be visible in the view, and false if not
type FloatValue ¶
type FloatValue struct {
ValueBase
}
FloatValue presents a spinner
func (*FloatValue) ConfigWidget ¶
func (vv *FloatValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*FloatValue) UpdateWidget ¶
func (vv *FloatValue) UpdateWidget()
func (*FloatValue) WidgetType ¶
func (vv *FloatValue) WidgetType() *gti.Type
type FontValue ¶
type FontValue struct {
ValueBase
}
FontValue presents an action for displaying a FontName and selecting fonts from FontChooserDialog
func (*FontValue) OpenDialog ¶
func (*FontValue) UpdateWidget ¶
func (vv *FontValue) UpdateWidget()
func (*FontValue) WidgetType ¶
type FuncButton ¶
type FuncButton struct { gi.Button // Func is the [gti.Func] associated with this button. // This function can also be a method, but it must be // converted to a [gti.Func] first. It should typically // be set using [FuncButton.SetFunc]. Func *gti.Func `set:"-"` // ReflectFunc is the [reflect.Value] of the function or // method associated with this button. It should typically // bet set using [FuncButton.SetFunc]. ReflectFunc reflect.Value `set:"-"` // Args are the [Value] objects associated with the // arguments of the function. They are automatically set in // [SetFunc], but they can be customized to configure // default values and other options. Args []Value `set:"-"` // Returns are the [Value] objects associated with the // return values of the function. They are automatically // set in [SetFunc], but they can be customized to configure // default values and other options. The [reflect.Value]s of // the [Value] objects are not set until the function is // called, and are thus not typically applicable to access. Returns []Value `set:"-"` // Confirm is whether to prompt the user for confirmation // before calling the function. Confirm bool // ShowReturn is whether to display the return values of // the function (and a success message if there are none). // The way that the return values are shown is determined // by ShowReturnAsDialog. ShowReturn is on by default, unless // the function has no return values. ShowReturn bool `def:"true"` // ShowReturnAsDialog, if and only if ShowReturn is true, // indicates to show the return values of the function in // a dialog, instead of in a snackbar, as they are by default. // If there are multiple return values from the function, or if // one of them is a complex type (pointer, struct, slice, // array, map), then ShowReturnAsDialog will // automatically be set to true. ShowReturnAsDialog bool }
FuncButton is a button that is set up to call a function when it is pressed, using a dialog to prompt the user for any arguments. Also, it automatically sets various properties of the button like the name, text, tooltip, and icon based on the properties of the function, using reflect and gti. The function must be registered with gti to get documentation information, but that is not required; add a `//gti:add` comment directive and run `goki generate` if you want tooltips. If the function is a method, both the method and its receiver type must be added to gti to get documentation.
func NewFuncButton ¶
func NewFuncButton(par ki.Ki, fun any) *FuncButton
NewFuncButton adds a new FuncButton with the given function to the given parent.
func (*FuncButton) CallFunc ¶
func (fb *FuncButton) CallFunc()
CallFunc calls the function or method associated with this button, prompting the user for any arguments.
func (*FuncButton) KiType ¶
func (t *FuncButton) KiType() *gti.Type
KiType returns the *gti.Type of FuncButton
func (*FuncButton) OnInit ¶
func (fb *FuncButton) OnInit()
func (*FuncButton) SetArgs ¶
func (fb *FuncButton) SetArgs()
SetArgs sets the appropriate Value objects for the arguments of the function associated with the function button. It is called in FuncButton.SetFunc and should typically not be called by end-user code.
func (*FuncButton) SetClass ¶
func (t *FuncButton) SetClass(v string) *FuncButton
SetClass sets the [FuncButton.Class]
func (*FuncButton) SetConfirm ¶
func (t *FuncButton) SetConfirm(v bool) *FuncButton
SetConfirm sets the [FuncButton.Confirm]: Confirm is whether to prompt the user for confirmation before calling the function.
func (*FuncButton) SetCustomContextMenu ¶
func (t *FuncButton) SetCustomContextMenu(v func(m *gi.Scene)) *FuncButton
SetCustomContextMenu sets the [FuncButton.CustomContextMenu]
func (*FuncButton) SetData ¶
func (t *FuncButton) SetData(v any) *FuncButton
SetData sets the [FuncButton.Data]
func (*FuncButton) SetFunc ¶
func (fb *FuncButton) SetFunc(fun any) *FuncButton
SetFunc sets the function associated with the FuncButton to the given function or method value. For documentation information for the function to be obtained, it must be added to gti. SetFunc is automatically called by NewFuncButton.
func (*FuncButton) SetFuncImpl ¶
func (fb *FuncButton) SetFuncImpl(gfun *gti.Func, rfun reflect.Value) *FuncButton
SetFuncImpl is the underlying implementation of FuncButton.SetFunc. It should typically not be used by end-user code.
func (*FuncButton) SetIcon ¶
func (t *FuncButton) SetIcon(v icons.Icon) *FuncButton
SetIcon sets the [FuncButton.Icon]
func (*FuncButton) SetIndicator ¶
func (t *FuncButton) SetIndicator(v icons.Icon) *FuncButton
SetIndicator sets the [FuncButton.Indicator]
func (*FuncButton) SetKey ¶
func (fb *FuncButton) SetKey(kf keyfun.Funs) *FuncButton
SetKey sets the shortcut of the function button from the given keyfun.Funs
func (*FuncButton) SetMenu ¶
func (t *FuncButton) SetMenu(v func(m *gi.Scene)) *FuncButton
SetMenu sets the [FuncButton.Menu]
func (*FuncButton) SetMethodImpl ¶
func (fb *FuncButton) SetMethodImpl(gmet *gti.Method, rmet reflect.Value) *FuncButton
SetMethodImpl is the underlying implementation of FuncButton.SetFunc for methods. It should typically not be used by end-user code.
func (*FuncButton) SetReturnValues ¶
func (fb *FuncButton) SetReturnValues(rets []reflect.Value)
SetReturnValues sets the [reflect.Value]s of the return value Value objects. It assumes that FuncButton.SetReturns has already been called. It is called in FuncButton.CallFunc and should typically not be called by end-user code.
func (*FuncButton) SetReturns ¶
func (fb *FuncButton) SetReturns()
SetReturns sets the appropriate Value objects for the return values of the function associated with the function button. It is called in FuncButton.SetFunc and should typically not be called by end-user code.
func (*FuncButton) SetShortcut ¶
func (t *FuncButton) SetShortcut(v key.Chord) *FuncButton
SetShortcut sets the [FuncButton.Shortcut]
func (*FuncButton) SetShowReturn ¶
func (t *FuncButton) SetShowReturn(v bool) *FuncButton
SetShowReturn sets the [FuncButton.ShowReturn]: ShowReturn is whether to display the return values of the function (and a success message if there are none). The way that the return values are shown is determined by ShowReturnAsDialog. ShowReturn is on by default, unless the function has no return values.
func (*FuncButton) SetShowReturnAsDialog ¶
func (t *FuncButton) SetShowReturnAsDialog(v bool) *FuncButton
SetShowReturnAsDialog sets the [FuncButton.ShowReturnAsDialog]: ShowReturnAsDialog, if and only if ShowReturn is true, indicates to show the return values of the function in a dialog, instead of in a snackbar, as they are by default. If there are multiple return values from the function, or if one of them is a complex type (pointer, struct, slice, array, map), then ShowReturnAsDialog will automatically be set to true.
func (*FuncButton) SetText ¶
func (t *FuncButton) SetText(v string) *FuncButton
SetText sets the [FuncButton.Text]
func (*FuncButton) SetTooltip ¶
func (t *FuncButton) SetTooltip(v string) *FuncButton
SetTooltip sets the [FuncButton.Tooltip]
func (*FuncButton) SetType ¶
func (t *FuncButton) SetType(v gi.ButtonTypes) *FuncButton
SetType sets the [FuncButton.Type]
func (*FuncButton) SetUpdateFunc ¶
func (t *FuncButton) SetUpdateFunc(v func()) *FuncButton
SetUpdateFunc sets the [FuncButton.UpdateFunc]
func (*FuncButton) ShowReturnsDialog ¶
func (fb *FuncButton) ShowReturnsDialog(rets []reflect.Value)
ShowReturnsDialog runs a dialog displaying the given function return values for the function associated with the function button. It does nothing if [FuncButton.ShowReturn] is dialog
type FuncValue ¶
type FuncValue struct {
ValueBase
}
FuncValue presents a FuncButton for viewing the information of and calling a function
func (*FuncValue) UpdateWidget ¶
func (vv *FuncValue) UpdateWidget()
func (*FuncValue) WidgetType ¶
type GiEditor ¶
type GiEditor struct { gi.Frame // root of tree being edited KiRoot ki.Ki // has the root changed via gui actions? updated from treeview and structview for changes Changed bool `set:"-"` // current filename for saving / loading Filename gi.FileName }
GiEditor represents a struct, creating a property editor of the fields -- constructs Children widgets to show the field names and editor fields for each field, within an overall frame with an optional title, and a button box at the bottom where methods can be invoked
func NewGiEditor ¶
NewGiEditor adds a new GiEditor with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*GiEditor) ConfigSplits ¶
func (ge *GiEditor) ConfigSplits()
ConfigSplits configures the Splits.
func (*GiEditor) ConfigWidget ¶
Config configures the widget
func (*GiEditor) EditColorScheme ¶
func (ge *GiEditor) EditColorScheme()
EditColorScheme pulls up a window to edit the current color scheme
func (*GiEditor) Save ¶
func (ge *GiEditor) Save()
Save saves tree to current filename, in a standard JSON-formatted file
func (*GiEditor) SelectionLoop ¶
func (ge *GiEditor) SelectionLoop()
SelectionLoop, if [KiRoot] is a gi.RenderWin, runs a loop in a separate goroutine that listens to the [RenderWin.SelectedWidgetChan] channel and selects selected elements.
func (*GiEditor) SetChanged ¶
func (ge *GiEditor) SetChanged()
func (*GiEditor) SetCustomContextMenu ¶
SetCustomContextMenu sets the [GiEditor.CustomContextMenu]
func (*GiEditor) SetFilename ¶
SetFilename sets the [GiEditor.Filename]: current filename for saving / loading
func (*GiEditor) SetRoot ¶
func (ge *GiEditor) SetRoot(root ki.Ki)
SetRoot sets the source root and ensures everything is configured
func (*GiEditor) SetSpacing ¶
SetSpacing sets the [GiEditor.Spacing]
func (*GiEditor) SetStackTop ¶
SetStackTop sets the [GiEditor.StackTop]
func (*GiEditor) SetStripes ¶
SetStripes sets the [GiEditor.Stripes]
func (*GiEditor) SetTooltip ¶
SetTooltip sets the [GiEditor.Tooltip]
func (*GiEditor) StructView ¶
func (ge *GiEditor) StructView() *StructView
StructView returns the main StructView
func (*GiEditor) TitleWidget ¶
Title returns the title label widget, and its index, within frame
func (*GiEditor) ToggleSelectionMode ¶
func (ge *GiEditor) ToggleSelectionMode()
ToggleSelectionMode toggles the editor between selection mode or not
type HiStyleValue ¶
type HiStyleValue struct {
ValueBase
}
HiStyleValue presents an action for displaying a mat32.Y and selecting from styles
func (*HiStyleValue) ConfigWidget ¶
func (vv *HiStyleValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*HiStyleValue) HasDialog ¶
func (vv *HiStyleValue) HasDialog() bool
func (*HiStyleValue) OpenDialog ¶
func (vv *HiStyleValue) OpenDialog(ctx gi.Widget, fun func(dlg *gi.Dialog))
func (*HiStyleValue) UpdateWidget ¶
func (vv *HiStyleValue) UpdateWidget()
func (*HiStyleValue) WidgetType ¶
func (vv *HiStyleValue) WidgetType() *gti.Type
type IconValue ¶
type IconValue struct {
ValueBase
}
IconValue presents an action for displaying an IconName and selecting icons from IconChooserDialog
func (*IconValue) OpenDialog ¶
func (*IconValue) UpdateWidget ¶
func (vv *IconValue) UpdateWidget()
func (*IconValue) WidgetType ¶
type IntValue ¶
type IntValue struct {
ValueBase
}
IntValue presents a spinner
func (*IntValue) UpdateWidget ¶
func (vv *IntValue) UpdateWidget()
func (*IntValue) WidgetType ¶
type KeyChordEdit ¶
type KeyChordEdit struct { gi.Label // true if the keyboard focus is active or not -- when we lose active focus we apply changes FocusActive bool `json:"-" xml:"-"` }
KeyChordEdit is a label widget that shows a key chord string, and, when in focus (after being clicked) will update to whatever key chord is typed -- used for representing and editing key chords.
func NewKeyChordEdit ¶
func NewKeyChordEdit(par ki.Ki, name ...string) *KeyChordEdit
NewKeyChordEdit adds a new KeyChordEdit with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*KeyChordEdit) ContextMenu ¶
func (kc *KeyChordEdit) ContextMenu(m *gi.Scene)
func (*KeyChordEdit) HandleKeyChord ¶
func (kc *KeyChordEdit) HandleKeyChord()
func (*KeyChordEdit) HandleKeyChordEvents ¶
func (kc *KeyChordEdit) HandleKeyChordEvents()
func (*KeyChordEdit) KeyChordStyles ¶
func (kc *KeyChordEdit) KeyChordStyles()
func (*KeyChordEdit) KiType ¶
func (t *KeyChordEdit) KiType() *gti.Type
KiType returns the *gti.Type of KeyChordEdit
func (*KeyChordEdit) OnInit ¶
func (kc *KeyChordEdit) OnInit()
func (*KeyChordEdit) SetClass ¶
func (t *KeyChordEdit) SetClass(v string) *KeyChordEdit
SetClass sets the [KeyChordEdit.Class]
func (*KeyChordEdit) SetCustomContextMenu ¶
func (t *KeyChordEdit) SetCustomContextMenu(v func(m *gi.Scene)) *KeyChordEdit
SetCustomContextMenu sets the [KeyChordEdit.CustomContextMenu]
func (*KeyChordEdit) SetFocusActive ¶
func (t *KeyChordEdit) SetFocusActive(v bool) *KeyChordEdit
SetFocusActive sets the [KeyChordEdit.FocusActive]: true if the keyboard focus is active or not -- when we lose active focus we apply changes
func (*KeyChordEdit) SetText ¶
func (t *KeyChordEdit) SetText(v string) *KeyChordEdit
SetText sets the [KeyChordEdit.Text]
func (*KeyChordEdit) SetTooltip ¶
func (t *KeyChordEdit) SetTooltip(v string) *KeyChordEdit
SetTooltip sets the [KeyChordEdit.Tooltip]
func (*KeyChordEdit) SetType ¶
func (t *KeyChordEdit) SetType(v gi.LabelTypes) *KeyChordEdit
SetType sets the [KeyChordEdit.Type]
type KeyChordValue ¶
type KeyChordValue struct {
ValueBase
}
KeyChordValue presents an KeyChordEdit for key.Chord
func (*KeyChordValue) ConfigWidget ¶
func (vv *KeyChordValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*KeyChordValue) HasDialog ¶
func (vv *KeyChordValue) HasDialog() bool
func (*KeyChordValue) UpdateWidget ¶
func (vv *KeyChordValue) UpdateWidget()
func (*KeyChordValue) WidgetType ¶
func (vv *KeyChordValue) WidgetType() *gti.Type
type KeyMapValue ¶
type KeyMapValue struct {
ValueBase
}
KeyMapValue presents an action for displaying a KeyMapName and selecting from chooser
func (*KeyMapValue) ConfigWidget ¶
func (vv *KeyMapValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*KeyMapValue) HasDialog ¶
func (vv *KeyMapValue) HasDialog() bool
func (*KeyMapValue) OpenDialog ¶
func (vv *KeyMapValue) OpenDialog(ctx gi.Widget, fun func(dlg *gi.Dialog))
func (*KeyMapValue) UpdateWidget ¶
func (vv *KeyMapValue) UpdateWidget()
func (*KeyMapValue) WidgetType ¶
func (vv *KeyMapValue) WidgetType() *gti.Type
type KiPtrValue ¶
type KiPtrValue struct {
ValueBase
}
KiPtrValue provides a chooser for pointers to Ki objects
func (*KiPtrValue) ConfigWidget ¶
func (vv *KiPtrValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*KiPtrValue) HasButton ¶
func (vv *KiPtrValue) HasButton() bool
func (*KiPtrValue) KiStruct ¶
func (vv *KiPtrValue) KiStruct() ki.Ki
get the Ki struct itself (or nil)
func (*KiPtrValue) OpenDialog ¶
func (vv *KiPtrValue) OpenDialog(ctx gi.Widget, fun func(dlg *gi.Dialog))
func (*KiPtrValue) UpdateWidget ¶
func (vv *KiPtrValue) UpdateWidget()
func (*KiPtrValue) WidgetType ¶
func (vv *KiPtrValue) WidgetType() *gti.Type
type LabelFunc ¶
LabelFunc is a function that returns a string to set a label first argument is the object on which the method is defined (receiver)
type MapInlineValue ¶
type MapInlineValue struct {
ValueBase
}
MapInlineValue presents a MapViewInline for a map
func (*MapInlineValue) ConfigWidget ¶
func (vv *MapInlineValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*MapInlineValue) UpdateWidget ¶
func (vv *MapInlineValue) UpdateWidget()
func (*MapInlineValue) WidgetType ¶
func (vv *MapInlineValue) WidgetType() *gti.Type
type MapValue ¶
type MapValue struct {
ValueBase
}
MapValue presents a button to edit maps
func (*MapValue) OpenDialog ¶
func (*MapValue) UpdateWidget ¶
func (vv *MapValue) UpdateWidget()
func (*MapValue) WidgetType ¶
type MapView ¶
type MapView struct { gi.Frame // the map that we are a view onto Map any `set:"-"` // Value for the map itself, if this was created within value view framework -- otherwise nil MapValView Value // has the map been edited? Changed bool `set:"-"` // Value representations of the map keys Keys []Value `json:"-" xml:"-"` // Value representations of the map values Values []Value `json:"-" xml:"-"` // sort by values instead of keys SortVals bool // whether to show the toolbar or not ShowToolbar bool // the number of columns in the map; do not set externally; generally only access internally NCols int // value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent TmpSave Value `json:"-" xml:"-"` // a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows ViewPath string // the map that we successfully set a toolbar for ToolbarMap any }
MapView represents a map, creating a property editor of the values -- constructs Children widgets to show the key / value pairs, within an overall frame. Automatically has a toolbar with Map Toolbar props if defined set prop toolbar = false to turn off
func NewMapView ¶
NewMapView adds a new MapView with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*MapView) ConfigMapGrid ¶
func (mv *MapView) ConfigMapGrid()
ConfigMapGrid configures the MapGrid for the current map
func (*MapView) ConfigToolbar ¶
func (mv *MapView) ConfigToolbar()
ConfigToolbar configures the toolbar actions
func (*MapView) ConfigWidget ¶
Config configures the view
func (*MapView) IsConfiged ¶
IsConfiged returns true if the widget is fully configured
func (*MapView) KiPropTag ¶
KiPropTag returns the PropTag value from Ki owner of this map, if it is..
func (*MapView) MapChangeValueType ¶
MapChangeValueType changes the type of the value for given map element at idx -- for maps with any values
func (*MapView) MapGrid ¶
MapGrid returns the MapGrid grid layout widget, which contains all the fields and values
func (*MapView) MapViewStyles ¶
func (mv *MapView) MapViewStyles()
func (*MapView) SetChanged ¶
func (mv *MapView) SetChanged()
SetChanged sets the Changed flag and emits the ViewSig signal for the MapView, indicating that some kind of edit / change has taken place to the table data.
func (*MapView) SetCustomContextMenu ¶
SetCustomContextMenu sets the [MapView.CustomContextMenu]
func (*MapView) SetMap ¶
SetMap sets the source map that we are viewing. Rebuilds the children to represent this map
func (*MapView) SetMapValView ¶
SetMapValView sets the [MapView.MapValView]: Value for the map itself, if this was created within value view framework -- otherwise nil
func (*MapView) SetNcols ¶
SetNcols sets the [MapView.NCols]: the number of columns in the map; do not set externally; generally only access internally
func (*MapView) SetShowToolbar ¶
SetShowToolbar sets the [MapView.ShowToolbar]: whether to show the toolbar or not
func (*MapView) SetSortVals ¶
SetSortVals sets the [MapView.SortVals]: sort by values instead of keys
func (*MapView) SetSpacing ¶
SetSpacing sets the [MapView.Spacing]
func (*MapView) SetStackTop ¶
SetStackTop sets the [MapView.StackTop]
func (*MapView) SetStripes ¶
SetStripes sets the [MapView.Stripes]
func (*MapView) SetTmpSave ¶
SetTmpSave sets the [MapView.TmpSave]: value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent
func (*MapView) SetToolbarMap ¶
SetToolbarMap sets the [MapView.ToolbarMap]: the map that we successfully set a toolbar for
func (*MapView) SetTooltip ¶
SetTooltip sets the [MapView.Tooltip]
func (*MapView) SetValues ¶
SetValues sets the [MapView.Values]: Value representations of the map values
func (*MapView) SetViewPath ¶
SetViewPath sets the [MapView.ViewPath]: a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows
func (*MapView) ToggleSort ¶
func (mv *MapView) ToggleSort()
ToggleSort toggles sorting by values vs. keys
func (*MapView) UpdateValues ¶
func (mv *MapView) UpdateValues()
UpdateValues updates the widget display of slice values, assuming same slice config
type MapViewInline ¶
type MapViewInline struct { gi.Layout // the map that we are a view onto Map any `set:"-"` // Value for the map itself, if this was created within value view framework -- otherwise nil MapValView Value // has the map been edited? Changed bool `set:"-"` // Value representations of the map keys Keys []Value `json:"-" xml:"-"` // Value representations of the fields Values []Value `json:"-" xml:"-"` // value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent TmpSave Value `view:"-" json:"-" xml:"-"` // a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows ViewPath string }
MapViewInline represents a map as a single line widget, for smaller maps and those explicitly marked inline.
func NewMapViewInline ¶
func NewMapViewInline(par ki.Ki, name ...string) *MapViewInline
NewMapViewInline adds a new MapViewInline with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*MapViewInline) ConfigMap ¶
func (mv *MapViewInline) ConfigMap(sc *gi.Scene) bool
ConfigMap configures children for map view
func (*MapViewInline) ConfigWidget ¶
func (mv *MapViewInline) ConfigWidget(sc *gi.Scene)
func (*MapViewInline) KiType ¶
func (t *MapViewInline) KiType() *gti.Type
KiType returns the *gti.Type of MapViewInline
func (*MapViewInline) MapViewInlineStyles ¶
func (mv *MapViewInline) MapViewInlineStyles()
func (*MapViewInline) New ¶
func (t *MapViewInline) New() ki.Ki
New returns a new *MapViewInline value
func (*MapViewInline) OnInit ¶
func (mv *MapViewInline) OnInit()
func (*MapViewInline) SetChanged ¶
func (mv *MapViewInline) SetChanged()
SetChanged sets the Changed flag and emits the ViewSig signal for the SliceView, indicating that some kind of edit / change has taken place to the table data. It isn't really practical to record all the different types of changes, so this is just generic.
func (*MapViewInline) SetClass ¶
func (t *MapViewInline) SetClass(v string) *MapViewInline
SetClass sets the [MapViewInline.Class]
func (*MapViewInline) SetCustomContextMenu ¶
func (t *MapViewInline) SetCustomContextMenu(v func(m *gi.Scene)) *MapViewInline
SetCustomContextMenu sets the [MapViewInline.CustomContextMenu]
func (*MapViewInline) SetKeys ¶
func (t *MapViewInline) SetKeys(v []Value) *MapViewInline
SetKeys sets the [MapViewInline.Keys]: Value representations of the map keys
func (*MapViewInline) SetLayout ¶
func (t *MapViewInline) SetLayout(v gi.Layouts) *MapViewInline
SetLayout sets the [MapViewInline.Lay]
func (*MapViewInline) SetMap ¶
func (mv *MapViewInline) SetMap(mp any) *MapViewInline
SetMap sets the source map that we are viewing -- rebuilds the children to represent this map
func (*MapViewInline) SetMapValView ¶
func (t *MapViewInline) SetMapValView(v Value) *MapViewInline
SetMapValView sets the [MapViewInline.MapValView]: Value for the map itself, if this was created within value view framework -- otherwise nil
func (*MapViewInline) SetSpacing ¶
func (t *MapViewInline) SetSpacing(v units.Value) *MapViewInline
SetSpacing sets the [MapViewInline.Spacing]
func (*MapViewInline) SetStackTop ¶
func (t *MapViewInline) SetStackTop(v int) *MapViewInline
SetStackTop sets the [MapViewInline.StackTop]
func (*MapViewInline) SetTmpSave ¶
func (t *MapViewInline) SetTmpSave(v Value) *MapViewInline
SetTmpSave sets the [MapViewInline.TmpSave]: value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent
func (*MapViewInline) SetTooltip ¶
func (t *MapViewInline) SetTooltip(v string) *MapViewInline
SetTooltip sets the [MapViewInline.Tooltip]
func (*MapViewInline) SetValues ¶
func (t *MapViewInline) SetValues(v []Value) *MapViewInline
SetValues sets the [MapViewInline.Values]: Value representations of the fields
func (*MapViewInline) SetViewPath ¶
func (t *MapViewInline) SetViewPath(v string) *MapViewInline
SetViewPath sets the [MapViewInline.ViewPath]: a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows
func (*MapViewInline) UpdateValues ¶
func (mv *MapViewInline) UpdateValues()
type NilValue ¶
type NilValue struct {
ValueBase
}
NilValue presents a label saying 'nil' -- for any nil or otherwise unrepresentable items
func (*NilValue) UpdateWidget ¶
func (vv *NilValue) UpdateWidget()
func (*NilValue) WidgetType ¶
type RuneSliceValue ¶
type RuneSliceValue struct {
ValueBase
}
RuneSliceValue presents a textfield of the bytes
func (*RuneSliceValue) ConfigWidget ¶
func (vv *RuneSliceValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*RuneSliceValue) UpdateWidget ¶
func (vv *RuneSliceValue) UpdateWidget()
func (*RuneSliceValue) WidgetType ¶
func (vv *RuneSliceValue) WidgetType() *gti.Type
type ShortcutFunc ¶
ShortcutFunc is a function that returns a key.Chord string for a shortcut used in MethodView shortcut-func option first argument is the object on which the method is defined (receiver)
type SliceInlineValue ¶
type SliceInlineValue struct {
ValueBase
}
SliceInlineValue presents a SliceViewInline for a map
func (*SliceInlineValue) ConfigWidget ¶
func (vv *SliceInlineValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*SliceInlineValue) UpdateWidget ¶
func (vv *SliceInlineValue) UpdateWidget()
func (*SliceInlineValue) WidgetType ¶
func (vv *SliceInlineValue) WidgetType() *gti.Type
type SliceValue ¶
type SliceValue struct { ValueBase IsArray bool // is an array, not a slice ElType reflect.Type // type of element in the slice -- has pointer if slice has pointers ElIsStruct bool // whether non-pointer element type is a struct or not }
SliceValue presents a button to edit slices
func (*SliceValue) ConfigWidget ¶
func (vv *SliceValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*SliceValue) GetTypeInfo ¶
func (vv *SliceValue) GetTypeInfo()
func (*SliceValue) HasButton ¶
func (vv *SliceValue) HasButton() bool
func (*SliceValue) OpenDialog ¶
func (vv *SliceValue) OpenDialog(ctx gi.Widget, fun func(dlg *gi.Dialog))
func (*SliceValue) UpdateWidget ¶
func (vv *SliceValue) UpdateWidget()
func (*SliceValue) WidgetType ¶
func (vv *SliceValue) WidgetType() *gti.Type
type SliceView ¶
type SliceView struct { SliceViewBase // optional styling function StyleFunc SliceViewStyleFunc `copy:"-" view:"-" json:"-" xml:"-"` }
SliceView represents a slice, creating an interactive viewer / editor of the elements as rows in a table. Widgets to show the index / value pairs, within an overall frame. Set to ReadOnly for select-only mode, which emits WidgetSig WidgetSelected signals when selection is updated.
func NewSliceView ¶
NewSliceView adds a new SliceView with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*SliceView) SetCustomContextMenu ¶
SetCustomContextMenu sets the [SliceView.CustomContextMenu]
func (*SliceView) SetDraggedIdxs ¶
SetDraggedIdxs sets the [SliceView.DraggedIdxs]
func (*SliceView) SetLayoutHeight ¶
SetLayoutHeight sets the [SliceView.LayoutHeight]
func (*SliceView) SetRenderedRows ¶
SetRenderedRows sets the [SliceView.RenderedRows]
func (*SliceView) SetRowHeight ¶
SetRowHeight sets the [SliceView.RowHeight]
func (*SliceView) SetSelIdxs ¶
SetSelIdxs sets the [SliceView.SelIdxs]
func (*SliceView) SetSliceNpval ¶
SetSliceNpval sets the [SliceView.SliceNPVal]
func (*SliceView) SetSliceSize ¶
SetSliceSize sets the [SliceView.SliceSize]
func (*SliceView) SetSliceValView ¶
SetSliceValView sets the [SliceView.SliceValView]
func (*SliceView) SetSpacing ¶
SetSpacing sets the [SliceView.Spacing]
func (*SliceView) SetStackTop ¶
SetStackTop sets the [SliceView.StackTop]
func (*SliceView) SetStartIdx ¶
SetStartIdx sets the [SliceView.StartIdx]
func (*SliceView) SetStripes ¶
SetStripes sets the [SliceView.Stripes]
func (*SliceView) SetStyleFunc ¶
func (t *SliceView) SetStyleFunc(v SliceViewStyleFunc) *SliceView
SetStyleFunc sets the [SliceView.StyleFunc]: optional styling function
func (*SliceView) SetTmpSave ¶
SetTmpSave sets the [SliceView.TmpSave]
func (*SliceView) SetToolbarSlice ¶
SetToolbarSlice sets the [SliceView.ToolbarSlice]
func (*SliceView) SetTooltip ¶
SetTooltip sets the [SliceView.Tooltip]
func (*SliceView) SetViewPath ¶
SetViewPath sets the [SliceView.ViewPath]
func (*SliceView) SetVisRows ¶
SetVisRows sets the [SliceView.VisRows]
type SliceViewBase ¶
type SliceViewBase struct { gi.Frame // the slice that we are a view onto -- must be a pointer to that slice Slice any `set:"-" copy:"-" view:"-" json:"-" xml:"-"` // optional mutex that, if non-nil, will be used around any updates that read / modify the underlying Slice data -- can be used to protect against random updating if your code has specific update points that can be likewise protected with this same mutex ViewMu *sync.Mutex `copy:"-" view:"-" json:"-" xml:"-"` // Changed indicates whether the underlying slice // has been edited in any way Changed bool `set:"-"` // non-ptr reflect.Value of the slice SliceNPVal reflect.Value `copy:"-" view:"-" json:"-" xml:"-"` // Value for the slice itself, if this was created within value view framework -- otherwise nil SliceValView Value `copy:"-" view:"-" json:"-" xml:"-"` // Value representations of the slice values Values []Value `copy:"-" view:"-" json:"-" xml:"-"` // current selection value -- initially select this value if set SelVal any `copy:"-" view:"-" json:"-" xml:"-"` // index of currently-selected item, in ReadOnly mode only SelIdx int `copy:"-" json:"-" xml:"-"` // list of currently-selected slice indexes SelIdxs map[int]struct{} `copy:"-"` // list of currently-dragged indexes DraggedIdxs []int `copy:"-"` // a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows ViewPath string // value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent TmpSave Value `copy:"-" json:"-" xml:"-"` // the slice that we successfully set a toolbar for ToolbarSlice any `copy:"-" view:"-" json:"-" xml:"-"` // height of a single row RowHeight float32 `edit:"-" copy:"-" json:"-" xml:"-"` // the height of grid from last layout -- determines when update needed LayoutHeight float32 `copy:"-" view:"-" json:"-" xml:"-"` // total number of rows visible in allocated display size VisRows int `edit:"-" copy:"-" json:"-" xml:"-"` // starting slice index of visible rows StartIdx int `edit:"-" copy:"-" json:"-" xml:"-"` // the number of rows rendered -- determines update RenderedRows int `copy:"-" view:"-" json:"-" xml:"-"` // size of slice SliceSize int `edit:"-" copy:"-" json:"-" xml:"-"` // temp idx state for e.g., dnd CurIdx int `copy:"-" view:"-" json:"-" xml:"-"` // ElVal is a Value representation of the underlying element type // which is used whenever there are no slice elements available ElVal reflect.Value `copy:"-" view:"-" json:"-" xml:"-"` }
SliceViewBase is the base for SliceView and TableView and any other viewers of array-like data. It automatically computes the number of rows that fit within its allocated space, and manages the offset view window into the full list of items, and supports row selection, copy / paste, Drag-n-Drop, etc. Set to ReadOnly for select-only mode, which emits WidgetSig WidgetSelected signals when selection is updated. Automatically has a toolbar with Slice Toolbar props if defined set prop toolbar = false to turn off
func NewSliceViewBase ¶
func NewSliceViewBase(par ki.Ki, name ...string) *SliceViewBase
NewSliceViewBase adds a new SliceViewBase with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*SliceViewBase) AsSliceViewBase ¶
func (sv *SliceViewBase) AsSliceViewBase() *SliceViewBase
func (*SliceViewBase) AvailHeight ¶
func (sv *SliceViewBase) AvailHeight() float32
func (*SliceViewBase) BindSelectDialog ¶
func (sv *SliceViewBase) BindSelectDialog(d *gi.Dialog, val *int) *SliceViewBase
BindSelectDialog makes the slice view a read-only selection slice view and then binds its events to the given dialog and its current selection index to the given value.
func (*SliceViewBase) ConfigFrame ¶
func (sv *SliceViewBase) ConfigFrame(sc *gi.Scene)
func (*SliceViewBase) ConfigOneRow ¶
func (sv *SliceViewBase) ConfigOneRow(sc *gi.Scene)
ConfigOneRow configures one row for initial row height measurement
func (*SliceViewBase) ConfigRows ¶
func (sv *SliceViewBase) ConfigRows(sc *gi.Scene)
ConfigRows configures VisRows worth of widgets to display slice data. It should only be called when NeedsConfigRows is true: when VisRows changes.
func (*SliceViewBase) ConfigScroll ¶
func (sv *SliceViewBase) ConfigScroll()
ConfigScroll configures the scrollbar
func (*SliceViewBase) ConfigSliceView ¶
func (sv *SliceViewBase) ConfigSliceView(sc *gi.Scene)
ConfigSliceView handles entire config. ReConfig calls this, followed by ApplyStyleTree so we don't need to call that.
func (*SliceViewBase) ConfigToolbar ¶
func (sv *SliceViewBase) ConfigToolbar()
ConfigToolbar configures the toolbar actions
func (*SliceViewBase) ConfigWidget ¶
func (sv *SliceViewBase) ConfigWidget(sc *gi.Scene)
Config configures a standard setup of the overall Frame
func (*SliceViewBase) Copy ¶
func (sv *SliceViewBase) Copy(reset bool)
Copy copies selected rows to clip.Board, optionally resetting the selection satisfies gi.Clipper interface and can be overridden by subtypes
func (*SliceViewBase) CopyIdxs ¶
func (sv *SliceViewBase) CopyIdxs(reset bool)
CopyIdxs copies selected idxs to clip.Board, optionally resetting the selection
func (*SliceViewBase) CopySelToMime ¶
func (sv *SliceViewBase) CopySelToMime() mimedata.Mimes
CopySelToMime copies selected rows to mime data
func (*SliceViewBase) Cut ¶
func (sv *SliceViewBase) Cut()
Cut copies selected indexes to clip.Board and deletes selected indexes satisfies gi.Clipper interface and can be overridden by subtypes
func (*SliceViewBase) CutIdxs ¶
func (sv *SliceViewBase) CutIdxs()
CutIdxs copies selected indexes to clip.Board and deletes selected indexes
func (*SliceViewBase) DeleteIdxs ¶
func (sv *SliceViewBase) DeleteIdxs()
DeleteIdxs deletes all selected indexes
func (*SliceViewBase) DragNDropFinalize ¶
func (sv *SliceViewBase) DragNDropFinalize(mod events.DropMods)
DragNDropFinalize is called to finalize actions on the Source node prior to performing target actions -- mod must indicate actual action taken by the target, including ignore -- ends up calling DragNDropSource if us..
func (*SliceViewBase) DragNDropSource ¶
func (sv *SliceViewBase) DragNDropSource(de events.Event)
DragNDropSource is called after target accepts the drop -- we just remove elements that were moved
func (*SliceViewBase) DragNDropStart ¶
func (sv *SliceViewBase) DragNDropStart()
DragNDropStart starts a drag-n-drop
func (*SliceViewBase) DragNDropTarget ¶
func (sv *SliceViewBase) DragNDropTarget(de events.Event)
DragNDropTarget handles a drag-n-drop drop
func (*SliceViewBase) Drop ¶
func (sv *SliceViewBase) Drop(md mimedata.Mimes, mod events.DropMods)
Drop pops up a menu to determine what specifically to do with dropped items this satisfies gi.DragNDropper interface, and can be overwritten in subtypes
func (*SliceViewBase) DropAssign ¶
func (sv *SliceViewBase) DropAssign(md mimedata.Mimes, idx int)
DropAssign assigns mime data (only the first one!) to this node
func (*SliceViewBase) DropBefore ¶
DropBefore inserts object(s) from mime data before this node
func (*SliceViewBase) DropCancel ¶
func (sv *SliceViewBase) DropCancel()
DropCancel cancels the drop action e.g., preventing deleting of source items in a Move case
func (*SliceViewBase) Duplicate ¶
func (sv *SliceViewBase) Duplicate() int
Duplicate copies selected items and inserts them after current selection -- return idx of start of duplicates if successful, else -1
func (*SliceViewBase) FlagType ¶
func (sv *SliceViewBase) FlagType() enums.BitFlag
func (*SliceViewBase) FromMimeData ¶
func (sv *SliceViewBase) FromMimeData(md mimedata.Mimes) []any
FromMimeData creates a slice of structs from mime data
func (*SliceViewBase) GridLayout ¶
func (sv *SliceViewBase) GridLayout() *gi.Layout
GridLayout returns the Layout containing the Grid and the scrollbar
func (*SliceViewBase) HandleSliceViewEvents ¶
func (sv *SliceViewBase) HandleSliceViewEvents()
func (*SliceViewBase) IdxFromPos ¶
func (sv *SliceViewBase) IdxFromPos(posY int) (int, bool)
IdxFromPos returns the idx that contains given vertical position, false if not found
func (*SliceViewBase) IdxGrabFocus ¶
func (sv *SliceViewBase) IdxGrabFocus(idx int) *gi.WidgetBase
IdxGrabFocus grabs the focus for the first focusable widget in given idx. returns that element or nil if not successful.
func (*SliceViewBase) IdxIsSelected ¶
func (sv *SliceViewBase) IdxIsSelected(idx int) bool
IdxIsSelected returns the selected status of given slice index
func (*SliceViewBase) IdxPos ¶
func (sv *SliceViewBase) IdxPos(idx int) image.Point
IdxPos returns center of window position of index label for idx (ContextMenuPos)
func (*SliceViewBase) IsIdxVisible ¶
func (sv *SliceViewBase) IsIdxVisible(idx int) bool
IsIdxVisible returns true if slice index is currently visible
func (*SliceViewBase) IsNil ¶
func (sv *SliceViewBase) IsNil() bool
IsNil returns true if the Slice is nil
func (*SliceViewBase) IsRowInBounds ¶
func (sv *SliceViewBase) IsRowInBounds(row int) bool
IsRowInBounds returns true if disp row is in bounds
func (*SliceViewBase) ItemCtxtMenu ¶
func (sv *SliceViewBase) ItemCtxtMenu(idx int)
func (*SliceViewBase) KeyInputEditable ¶
func (sv *SliceViewBase) KeyInputEditable(kt events.Event)
func (*SliceViewBase) KeyInputNav ¶
func (sv *SliceViewBase) KeyInputNav(kt events.Event)
KeyInputNav supports multiple selection navigation keys
func (*SliceViewBase) KeyInputReadOnly ¶
func (sv *SliceViewBase) KeyInputReadOnly(kt events.Event)
func (*SliceViewBase) KiType ¶
func (t *SliceViewBase) KiType() *gti.Type
KiType returns the *gti.Type of SliceViewBase
func (*SliceViewBase) MakeDropMenu ¶
MakeDropMenu makes the menu of options for dropping on a target
func (*SliceViewBase) MakePasteMenu ¶
func (sv *SliceViewBase) MakePasteMenu(m *gi.Scene, data any, idx int)
MakePasteMenu makes the menu of options for paste events
func (*SliceViewBase) MimeDataIdx ¶
func (sv *SliceViewBase) MimeDataIdx(md *mimedata.Mimes, idx int)
MimeDataIdx adds mimedata for given idx: an application/json of the struct
func (*SliceViewBase) MimeDataType ¶
func (sv *SliceViewBase) MimeDataType() string
MimeDataType returns the data type for mime clipboard (copy / paste) data e.g., filecat.DataJson
func (*SliceViewBase) MoveDown ¶
func (sv *SliceViewBase) MoveDown(selMode events.SelectModes) int
MoveDown moves the selection down to next row, using given select mode (from keyboard modifiers) -- returns newly selected row or -1 if failed
func (*SliceViewBase) MoveDownAction ¶
func (sv *SliceViewBase) MoveDownAction(selMode events.SelectModes) int
MoveDownAction moves the selection down to next row, using given select mode (from keyboard modifiers) -- and emits select event for newly selected row
func (*SliceViewBase) MovePageDown ¶
func (sv *SliceViewBase) MovePageDown(selMode events.SelectModes) int
MovePageDown moves the selection down to next page, using given select mode (from keyboard modifiers) -- returns newly selected idx or -1 if failed
func (*SliceViewBase) MovePageDownAction ¶
func (sv *SliceViewBase) MovePageDownAction(selMode events.SelectModes) int
MovePageDownAction moves the selection down to next page, using given select mode (from keyboard modifiers) -- and emits select event for newly selected idx
func (*SliceViewBase) MovePageUp ¶
func (sv *SliceViewBase) MovePageUp(selMode events.SelectModes) int
MovePageUp moves the selection up to previous page, using given select mode (from keyboard modifiers) -- returns newly selected idx or -1 if failed
func (*SliceViewBase) MovePageUpAction ¶
func (sv *SliceViewBase) MovePageUpAction(selMode events.SelectModes) int
MovePageUpAction moves the selection up to previous page, using given select mode (from keyboard modifiers) -- and emits select event for newly selected idx
func (*SliceViewBase) MoveUp ¶
func (sv *SliceViewBase) MoveUp(selMode events.SelectModes) int
MoveUp moves the selection up to previous idx, using given select mode (from keyboard modifiers) -- returns newly selected idx or -1 if failed
func (*SliceViewBase) MoveUpAction ¶
func (sv *SliceViewBase) MoveUpAction(selMode events.SelectModes) int
MoveUpAction moves the selection up to previous idx, using given select mode (from keyboard modifiers) -- and emits select event for newly selected idx
func (*SliceViewBase) NeedsConfigRows ¶
func (sv *SliceViewBase) NeedsConfigRows() bool
NeedsConfigRows returns true if layout size needs diff # of rows
func (*SliceViewBase) New ¶
func (t *SliceViewBase) New() ki.Ki
New returns a new *SliceViewBase value
func (*SliceViewBase) OnInit ¶
func (sv *SliceViewBase) OnInit()
func (*SliceViewBase) Paste ¶
func (sv *SliceViewBase) Paste()
Paste pastes clipboard at CurIdx satisfies gi.Clipper interface and can be overridden by subtypes
func (*SliceViewBase) PasteAssign ¶
func (sv *SliceViewBase) PasteAssign(md mimedata.Mimes, idx int)
PasteAssign assigns mime data (only the first one!) to this idx
func (*SliceViewBase) PasteAtIdx ¶
func (sv *SliceViewBase) PasteAtIdx(md mimedata.Mimes, idx int)
PasteAtIdx inserts object(s) from mime data at (before) given slice index
func (*SliceViewBase) PasteIdx ¶
func (sv *SliceViewBase) PasteIdx(idx int)
PasteIdx pastes clipboard at given idx
func (*SliceViewBase) PasteMenu ¶
func (sv *SliceViewBase) PasteMenu(md mimedata.Mimes, idx int)
PasteMenu performs a paste from the clipboard using given data -- pops up a menu to determine what specifically to do
func (*SliceViewBase) Render ¶
func (sv *SliceViewBase) Render(sc *gi.Scene)
func (*SliceViewBase) ResetSelectedIdxs ¶
func (sv *SliceViewBase) ResetSelectedIdxs()
func (*SliceViewBase) RowFirstWidget ¶
func (sv *SliceViewBase) RowFirstWidget(row int) (*gi.WidgetBase, bool)
RowFirstWidget returns the first widget for given row (could be index or not) -- false if out of range
func (*SliceViewBase) RowFromPos ¶
func (sv *SliceViewBase) RowFromPos(posY int) (int, bool)
RowFromPos returns the row that contains given vertical position, false if not found
func (*SliceViewBase) RowGrabFocus ¶
func (sv *SliceViewBase) RowGrabFocus(row int) *gi.WidgetBase
RowGrabFocus grabs the focus for the first focusable widget in given row. returns that element or nil if not successful note: grid must have already rendered for focus to be grabbed!
func (*SliceViewBase) RowWidgetNs ¶
func (sv *SliceViewBase) RowWidgetNs() (nWidgPerRow, idxOff int)
RowWidgetNs returns number of widgets per row and offset for index label
func (*SliceViewBase) SaveDraggedIdxs ¶
func (sv *SliceViewBase) SaveDraggedIdxs(idx int)
SaveDraggedIdxs saves selectedindexes into dragged indexes taking into account insertion at idx
func (*SliceViewBase) ScrollBar ¶
func (sv *SliceViewBase) ScrollBar() *gi.Slider
ScrollBar returns the SliceGrid scrollbar
func (*SliceViewBase) ScrollToIdx ¶
func (sv *SliceViewBase) ScrollToIdx(idx int) bool
ScrollToIdx ensures that given slice idx is visible by scrolling display as needed.
func (*SliceViewBase) ScrollToIdxNoUpdt ¶
func (sv *SliceViewBase) ScrollToIdxNoUpdt(idx int) bool
ScrollToIdxNoUpdt ensures that given slice idx is visible by scrolling display as needed. This version does not update the slicegrid. Just computes the StartIdx and updates the scrollbar
func (*SliceViewBase) SelectAllIdxs ¶
func (sv *SliceViewBase) SelectAllIdxs()
SelectAllIdxs selects all idxs
func (*SliceViewBase) SelectIdx ¶
func (sv *SliceViewBase) SelectIdx(idx int)
SelectIdx selects given idx (if not already selected) -- updates select status of index label
func (*SliceViewBase) SelectIdxAction ¶
func (sv *SliceViewBase) SelectIdxAction(idx int, mode events.SelectModes)
SelectIdxAction is called when a select action has been received (e.g., a mouse click) -- translates into selection updates -- gets selection mode from mouse event (ExtendContinuous, ExtendOne)
func (*SliceViewBase) SelectIdxWidgets ¶
func (sv *SliceViewBase) SelectIdxWidgets(idx int, sel bool) bool
SelectIdxWidgets sets the selection state of given slice index returns false if index is not visible
func (*SliceViewBase) SelectRowWidgets ¶
func (sv *SliceViewBase) SelectRowWidgets(row int, sel bool)
SelectRowWidgets sets the selection state of given row of widgets
func (*SliceViewBase) SelectVal ¶
func (sv *SliceViewBase) SelectVal(val string) bool
SelectVal sets SelVal and attempts to find corresponding row, setting SelectedIdx and selecting row if found -- returns true if found, false otherwise.
func (*SliceViewBase) SelectedIdxsList ¶
func (sv *SliceViewBase) SelectedIdxsList(descendingSort bool) []int
SelectedIdxsList returns list of selected indexes, sorted either ascending or descending
func (*SliceViewBase) SetChanged ¶
func (sv *SliceViewBase) SetChanged()
SetChanged sets the Changed flag and emits the ViewSig signal for the SliceViewBase, indicating that some kind of edit / change has taken place to the table data. It isn't really practical to record all the different types of changes, so this is just generic.
func (*SliceViewBase) SetClass ¶
func (t *SliceViewBase) SetClass(v string) *SliceViewBase
SetClass sets the [SliceViewBase.Class]
func (*SliceViewBase) SetCurIdx ¶
func (t *SliceViewBase) SetCurIdx(v int) *SliceViewBase
SetCurIdx sets the [SliceViewBase.CurIdx]: temp idx state for e.g., dnd
func (*SliceViewBase) SetCustomContextMenu ¶
func (t *SliceViewBase) SetCustomContextMenu(v func(m *gi.Scene)) *SliceViewBase
SetCustomContextMenu sets the [SliceViewBase.CustomContextMenu]
func (*SliceViewBase) SetDraggedIdxs ¶
func (t *SliceViewBase) SetDraggedIdxs(v []int) *SliceViewBase
SetDraggedIdxs sets the [SliceViewBase.DraggedIdxs]: list of currently-dragged indexes
func (*SliceViewBase) SetElVal ¶
func (t *SliceViewBase) SetElVal(v reflect.Value) *SliceViewBase
SetElVal sets the [SliceViewBase.ElVal]: ElVal is a Value representation of the underlying element type which is used whenever there are no slice elements available
func (*SliceViewBase) SetLayout ¶
func (t *SliceViewBase) SetLayout(v gi.Layouts) *SliceViewBase
SetLayout sets the [SliceViewBase.Lay]
func (*SliceViewBase) SetLayoutHeight ¶
func (t *SliceViewBase) SetLayoutHeight(v float32) *SliceViewBase
SetLayoutHeight sets the [SliceViewBase.LayoutHeight]: the height of grid from last layout -- determines when update needed
func (*SliceViewBase) SetRenderedRows ¶
func (t *SliceViewBase) SetRenderedRows(v int) *SliceViewBase
SetRenderedRows sets the [SliceViewBase.RenderedRows]: the number of rows rendered -- determines update
func (*SliceViewBase) SetRowHeight ¶
func (t *SliceViewBase) SetRowHeight(v float32) *SliceViewBase
SetRowHeight sets the [SliceViewBase.RowHeight]: height of a single row
func (*SliceViewBase) SetSelIdx ¶
func (t *SliceViewBase) SetSelIdx(v int) *SliceViewBase
SetSelIdx sets the [SliceViewBase.SelIdx]: index of currently-selected item, in ReadOnly mode only
func (*SliceViewBase) SetSelIdxs ¶
func (t *SliceViewBase) SetSelIdxs(v map[int]struct{}) *SliceViewBase
SetSelIdxs sets the [SliceViewBase.SelIdxs]: list of currently-selected slice indexes
func (*SliceViewBase) SetSelVal ¶
func (t *SliceViewBase) SetSelVal(v any) *SliceViewBase
SetSelVal sets the [SliceViewBase.SelVal]: current selection value -- initially select this value if set
func (*SliceViewBase) SetSlice ¶
func (sv *SliceViewBase) SetSlice(sl any) *SliceViewBase
SetSlice sets the source slice that we are viewing. This ReConfigs the view for this slice if different. Note: it is important to at least set an empty slice of the desired type at the start to enable initial configuration.
func (*SliceViewBase) SetSliceNpval ¶
func (t *SliceViewBase) SetSliceNpval(v reflect.Value) *SliceViewBase
SetSliceNpval sets the [SliceViewBase.SliceNPVal]: non-ptr reflect.Value of the slice
func (*SliceViewBase) SetSliceSize ¶
func (t *SliceViewBase) SetSliceSize(v int) *SliceViewBase
SetSliceSize sets the [SliceViewBase.SliceSize]: size of slice
func (*SliceViewBase) SetSliceValView ¶
func (t *SliceViewBase) SetSliceValView(v Value) *SliceViewBase
SetSliceValView sets the [SliceViewBase.SliceValView]: Value for the slice itself, if this was created within value view framework -- otherwise nil
func (*SliceViewBase) SetSpacing ¶
func (t *SliceViewBase) SetSpacing(v units.Value) *SliceViewBase
SetSpacing sets the [SliceViewBase.Spacing]
func (*SliceViewBase) SetStackTop ¶
func (t *SliceViewBase) SetStackTop(v int) *SliceViewBase
SetStackTop sets the [SliceViewBase.StackTop]
func (*SliceViewBase) SetStartIdx ¶
func (t *SliceViewBase) SetStartIdx(v int) *SliceViewBase
SetStartIdx sets the [SliceViewBase.StartIdx]: starting slice index of visible rows
func (*SliceViewBase) SetStripes ¶
func (t *SliceViewBase) SetStripes(v gi.Stripes) *SliceViewBase
SetStripes sets the [SliceViewBase.Stripes]
func (*SliceViewBase) SetTmpSave ¶
func (t *SliceViewBase) SetTmpSave(v Value) *SliceViewBase
SetTmpSave sets the [SliceViewBase.TmpSave]: value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent
func (*SliceViewBase) SetToolbarSlice ¶
func (t *SliceViewBase) SetToolbarSlice(v any) *SliceViewBase
SetToolbarSlice sets the [SliceViewBase.ToolbarSlice]: the slice that we successfully set a toolbar for
func (*SliceViewBase) SetTooltip ¶
func (t *SliceViewBase) SetTooltip(v string) *SliceViewBase
SetTooltip sets the [SliceViewBase.Tooltip]
func (*SliceViewBase) SetValues ¶
func (t *SliceViewBase) SetValues(v []Value) *SliceViewBase
SetValues sets the [SliceViewBase.Values]: Value representations of the slice values
func (*SliceViewBase) SetViewMu ¶
func (t *SliceViewBase) SetViewMu(v *sync.Mutex) *SliceViewBase
SetViewMu sets the [SliceViewBase.ViewMu]: optional mutex that, if non-nil, will be used around any updates that read / modify the underlying Slice data -- can be used to protect against random updating if your code has specific update points that can be likewise protected with this same mutex
func (*SliceViewBase) SetViewPath ¶
func (t *SliceViewBase) SetViewPath(v string) *SliceViewBase
SetViewPath sets the [SliceViewBase.ViewPath]: a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows
func (*SliceViewBase) SetVisRows ¶
func (t *SliceViewBase) SetVisRows(v int) *SliceViewBase
SetVisRows sets the [SliceViewBase.VisRows]: total number of rows visible in allocated display size
func (*SliceViewBase) SliceDeleteAt ¶
func (sv *SliceViewBase) SliceDeleteAt(idx int)
SliceDeleteAt deletes element at given index from slice
func (*SliceViewBase) SliceDeleteAtRow ¶
func (sv *SliceViewBase) SliceDeleteAtRow(row int)
SliceDeleteAtRow deletes element at given display row if updt is true, then update the grid after
func (*SliceViewBase) SliceDeleteAtSel ¶
func (sv *SliceViewBase) SliceDeleteAtSel(idx int)
SliceDeleteAtSel updates selected rows based on deleting element at given index must be called with successful SliceDeleteAt
func (*SliceViewBase) SliceGrid ¶
func (sv *SliceViewBase) SliceGrid() *gi.Frame
SliceGrid returns the SliceGrid grid frame widget, which contains all the fields and values
func (*SliceViewBase) SliceNewAt ¶
func (sv *SliceViewBase) SliceNewAt(idx int)
SliceNewAt inserts a new blank element at given index in the slice -- -1 means the end
func (*SliceViewBase) SliceNewAtRow ¶
func (sv *SliceViewBase) SliceNewAtRow(row int)
SliceNewAtRow inserts a new blank element at given display row
func (*SliceViewBase) SliceNewAtSel ¶
func (sv *SliceViewBase) SliceNewAtSel(idx int)
SliceNewAtSel updates selected rows based on inserting new element at given index. must be called with successful SliceNewAt
func (*SliceViewBase) SliceVal ¶
func (sv *SliceViewBase) SliceVal(idx int) any
SliceVal returns value interface at given slice index must be protected by mutex
func (*SliceViewBase) SliceViewBaseInit ¶
func (sv *SliceViewBase) SliceViewBaseInit()
func (*SliceViewBase) StdCtxtMenu ¶
func (sv *SliceViewBase) StdCtxtMenu(m *gi.Scene, idx int)
func (*SliceViewBase) Toolbar ¶
func (sv *SliceViewBase) Toolbar() *gi.Toolbar
Toolbar returns the toolbar widget
func (*SliceViewBase) UnselectAllIdxs ¶
func (sv *SliceViewBase) UnselectAllIdxs()
UnselectAllIdxs unselects all selected idxs
func (*SliceViewBase) UnselectIdx ¶
func (sv *SliceViewBase) UnselectIdx(idx int)
UnselectIdx unselects given idx (if selected)
func (*SliceViewBase) UnselectIdxAction ¶
func (sv *SliceViewBase) UnselectIdxAction(idx int)
UnselectIdxAction unselects this idx (if selected) -- and emits a signal
func (*SliceViewBase) UpdateScroll ¶
func (sv *SliceViewBase) UpdateScroll()
UpdateScroll updates grid scrollbar based on display
func (*SliceViewBase) UpdateSelectIdx ¶
func (sv *SliceViewBase) UpdateSelectIdx(idx int, sel bool)
UpdateSelectIdx updates the selection for the given index
func (*SliceViewBase) UpdateSelectRow ¶
func (sv *SliceViewBase) UpdateSelectRow(row int)
UpdateSelectRow updates the selection for the given row callback from widgetsig select
func (*SliceViewBase) UpdateStartIdx ¶
func (sv *SliceViewBase) UpdateStartIdx()
UpdateStartIdx updates StartIdx to fit current view
func (*SliceViewBase) UpdateWidgets ¶
func (sv *SliceViewBase) UpdateWidgets()
UpdateWidgets updates the row widget display to represent the current state of the slice data, including which range of data is being displayed. This is called for scrolling, navigation etc.
func (*SliceViewBase) UpdtSliceSize ¶
func (sv *SliceViewBase) UpdtSliceSize() int
UpdtSliceSize updates and returns the size of the slice and sets SliceSize
func (*SliceViewBase) ViewMuLock ¶
func (sv *SliceViewBase) ViewMuLock()
ViewMuLock locks the ViewMu if non-nil
func (*SliceViewBase) ViewMuUnlock ¶
func (sv *SliceViewBase) ViewMuUnlock()
ViewMuUnlock Unlocks the ViewMu if non-nil
func (*SliceViewBase) VisRowsAvail ¶
func (sv *SliceViewBase) VisRowsAvail() (rows int, rowht, layht float32)
VisRowsAvail returns the number of visible rows available to display given the current layout parameters.
type SliceViewFlags ¶
type SliceViewFlags gi.WidgetFlags //enums:bitflag -trim-prefix SliceView
SliceViewFlags extend WidgetFlags to hold SliceView state
const ( // flagged after first configuration SliceViewConfiged SliceViewFlags = SliceViewFlags(gi.WidgetFlagsN) + iota // if true, user cannot add elements to the slice SliceViewNoAdd // if true, user cannot delete elements from the slice SliceViewNoDelete // if the type we're viewing has its own CtxtMenu property defined, should we also still show the view's standard context menu? SliceViewShowViewCtxtMenu // whether the slice is actually an array -- no modifications -- set by SetSlice SliceViewIsArray // whether to show index or not SliceViewShowIndex // whether to show the toolbar or not SliceViewShowToolbar SliceViewReadOnlyKeyNav // editing-mode select rows mode SliceViewSelectMode // if view is ReadOnly, default selection mode is to choose one row only -- if this is true, standard multiple selection logic with modifier keys is instead supported SliceViewReadOnlyMultiSel // guard for recursive focus grabbing SliceViewInFocusGrab // guard for recursive rebuild SliceViewInFullRebuild )
const SliceViewFlagsN SliceViewFlags = 21
SliceViewFlagsN is the highest valid value for type SliceViewFlags, plus one.
func SliceViewFlagsValues ¶
func SliceViewFlagsValues() []SliceViewFlags
SliceViewFlagsValues returns all possible values for the type SliceViewFlags.
func (SliceViewFlags) BitIndexString ¶
func (i SliceViewFlags) BitIndexString() string
BitIndexString returns the string representation of this SliceViewFlags value if it is a bit index value (typically an enum constant), and not an actual bit flag value.
func (SliceViewFlags) Desc ¶
func (i SliceViewFlags) Desc() string
Desc returns the description of the SliceViewFlags value.
func (SliceViewFlags) HasFlag ¶
func (i SliceViewFlags) HasFlag(f enums.BitFlag) bool
HasFlag returns whether these bit flags have the given bit flag set.
func (SliceViewFlags) Int64 ¶
func (i SliceViewFlags) Int64() int64
Int64 returns the SliceViewFlags value as an int64.
func (SliceViewFlags) IsValid ¶
func (i SliceViewFlags) IsValid() bool
IsValid returns whether the value is a valid option for type SliceViewFlags.
func (SliceViewFlags) MarshalText ¶
func (i SliceViewFlags) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface.
func (*SliceViewFlags) SetFlag ¶
func (i *SliceViewFlags) SetFlag(on bool, f ...enums.BitFlag)
SetFlag sets the value of the given flags in these flags to the given value.
func (*SliceViewFlags) SetInt64 ¶
func (i *SliceViewFlags) SetInt64(in int64)
SetInt64 sets the SliceViewFlags value from an int64.
func (*SliceViewFlags) SetString ¶
func (i *SliceViewFlags) SetString(s string) error
SetString sets the SliceViewFlags value from its string representation, and returns an error if the string is invalid.
func (*SliceViewFlags) SetStringOr ¶
func (i *SliceViewFlags) SetStringOr(s string) error
SetStringOr sets the SliceViewFlags value from its string representation while preserving any bit flags already set, and returns an error if the string is invalid.
func (SliceViewFlags) String ¶
func (i SliceViewFlags) String() string
String returns the string representation of this SliceViewFlags value.
func (*SliceViewFlags) UnmarshalText ¶
func (i *SliceViewFlags) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (SliceViewFlags) Values ¶
func (i SliceViewFlags) Values() []enums.Enum
Values returns all possible values for the type SliceViewFlags.
type SliceViewInline ¶
type SliceViewInline struct { gi.Layout // the slice that we are a view onto Slice any `set:"-"` // Value for the slice itself, if this was created within value view framework -- otherwise nil SliceValView Value // whether the slice is actually an array -- no modifications IsArray bool // whether the slice has a fixed-len flag on it IsFixedLen bool // has the slice been edited? Changed bool `set:"-"` // Value representations of the fields Values []Value `json:"-" xml:"-"` // value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent TmpSave Value `view:"-" json:"-" xml:"-"` // a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows ViewPath string }
SliceViewInline represents a slice as a single line widget, for smaller slices and those explicitly marked inline.
func NewSliceViewInline ¶
func NewSliceViewInline(par ki.Ki, name ...string) *SliceViewInline
NewSliceViewInline adds a new SliceViewInline with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*SliceViewInline) ConfigSlice ¶
func (sv *SliceViewInline) ConfigSlice(sc *gi.Scene) bool
ConfigSlice configures children for slice view
func (*SliceViewInline) ConfigWidget ¶
func (sv *SliceViewInline) ConfigWidget(sc *gi.Scene)
func (*SliceViewInline) KiType ¶
func (t *SliceViewInline) KiType() *gti.Type
KiType returns the *gti.Type of SliceViewInline
func (*SliceViewInline) New ¶
func (t *SliceViewInline) New() ki.Ki
New returns a new *SliceViewInline value
func (*SliceViewInline) OnInit ¶
func (sv *SliceViewInline) OnInit()
func (*SliceViewInline) SetChanged ¶
func (sv *SliceViewInline) SetChanged()
SetChanged sets the Changed flag and emits the ViewSig signal for the SliceView, indicating that some kind of edit / change has taken place to the table data. It isn't really practical to record all the different types of changes, so this is just generic.
func (*SliceViewInline) SetClass ¶
func (t *SliceViewInline) SetClass(v string) *SliceViewInline
SetClass sets the [SliceViewInline.Class]
func (*SliceViewInline) SetCustomContextMenu ¶
func (t *SliceViewInline) SetCustomContextMenu(v func(m *gi.Scene)) *SliceViewInline
SetCustomContextMenu sets the [SliceViewInline.CustomContextMenu]
func (*SliceViewInline) SetIsArray ¶
func (t *SliceViewInline) SetIsArray(v bool) *SliceViewInline
SetIsArray sets the [SliceViewInline.IsArray]: whether the slice is actually an array -- no modifications
func (*SliceViewInline) SetIsFixedLen ¶
func (t *SliceViewInline) SetIsFixedLen(v bool) *SliceViewInline
SetIsFixedLen sets the [SliceViewInline.IsFixedLen]: whether the slice has a fixed-len flag on it
func (*SliceViewInline) SetLayout ¶
func (t *SliceViewInline) SetLayout(v gi.Layouts) *SliceViewInline
SetLayout sets the [SliceViewInline.Lay]
func (*SliceViewInline) SetSlice ¶
func (sv *SliceViewInline) SetSlice(sl any) *SliceViewInline
SetSlice sets the source slice that we are viewing -- rebuilds the children to represent this slice
func (*SliceViewInline) SetSliceValView ¶
func (t *SliceViewInline) SetSliceValView(v Value) *SliceViewInline
SetSliceValView sets the [SliceViewInline.SliceValView]: Value for the slice itself, if this was created within value view framework -- otherwise nil
func (*SliceViewInline) SetSpacing ¶
func (t *SliceViewInline) SetSpacing(v units.Value) *SliceViewInline
SetSpacing sets the [SliceViewInline.Spacing]
func (*SliceViewInline) SetStackTop ¶
func (t *SliceViewInline) SetStackTop(v int) *SliceViewInline
SetStackTop sets the [SliceViewInline.StackTop]
func (*SliceViewInline) SetTmpSave ¶
func (t *SliceViewInline) SetTmpSave(v Value) *SliceViewInline
SetTmpSave sets the [SliceViewInline.TmpSave]: value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent
func (*SliceViewInline) SetTooltip ¶
func (t *SliceViewInline) SetTooltip(v string) *SliceViewInline
SetTooltip sets the [SliceViewInline.Tooltip]
func (*SliceViewInline) SetValues ¶
func (t *SliceViewInline) SetValues(v []Value) *SliceViewInline
SetValues sets the [SliceViewInline.Values]: Value representations of the fields
func (*SliceViewInline) SetViewPath ¶
func (t *SliceViewInline) SetViewPath(v string) *SliceViewInline
SetViewPath sets the [SliceViewInline.ViewPath]: a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows
func (*SliceViewInline) SliceNewAt ¶
func (sv *SliceViewInline) SliceNewAt(idx int)
SliceNewAt inserts a new blank element at given index in the slice -- -1 means the end
func (*SliceViewInline) SliceViewInlineStyles ¶
func (sv *SliceViewInline) SliceViewInlineStyles()
func (*SliceViewInline) UpdateValues ¶
func (sv *SliceViewInline) UpdateValues()
type SliceViewStyleFunc ¶
SliceViewStyleFunc is a styling function for custom styling / configuration of elements in the view. If style properties are set then you must call w.AsNode2dD().SetFullReRender() to trigger re-styling during re-render
type SliceViewer ¶
type SliceViewer interface { // AsSliceViewBase returns the base for direct access to relevant fields etc AsSliceViewBase() *SliceViewBase // SliceGrid returns the SliceGrid grid frame widget, // which contains all the fields and values SliceGrid() *gi.Frame // ScrollBar returns the SliceGrid scrollbar ScrollBar() *gi.Slider // RowWidgetNs returns number of widgets per row and // offset for index label RowWidgetNs() (nWidgPerRow, idxOff int) // UpdtSliceSize updates the current size of the slice // and sets SliceSize if changed. UpdtSliceSize() int // NeedsConfigRows returns true if a call to ConfigRows is needed, // whenever the current layout allocation requires a different // number of rows than currently configured. NeedsConfigRows() bool // ConfigRows configures VisRows worth of widgets // to display slice data. It should only be called // when NeedsConfigRows is true: when VisRows changes. ConfigRows(sc *gi.Scene) // UpdateWidgets updates the row widget display to // represent the current state of the slice data, // including which range of data is being displayed. // This is called for scrolling, navigation etc. UpdateWidgets() // ConfigOneRow configures one row, just to get sizing, // only called at the start. ConfigOneRow(sc *gi.Scene) // StyleRow calls a custom style function on given row (and field) StyleRow(w gi.Widget, idx, fidx int) // RowFirstWidget returns the first widget for given row // (could be index or not) -- false if out of range RowFirstWidget(row int) (*gi.WidgetBase, bool) // RowGrabFocus grabs the focus for the first focusable // widget in given row. // returns that element or nil if not successful // note: grid must have already rendered for focus to be grabbed! RowGrabFocus(row int) *gi.WidgetBase // SelectRowWidgets sets the selection state of given row of widgets SelectRowWidgets(row int, sel bool) // SliceNewAt inserts a new blank element at given // index in the slice. -1 means the end. SliceNewAt(idx int) // SliceDeleteAt deletes element at given index from slice // if updt is true, then update the grid after SliceDeleteAt(idx int) // MimeDataType returns the data type for mime clipboard // (copy / paste) data e.g., filecat.DataJson MimeDataType() string // CopySelToMime copies selected rows to mime data CopySelToMime() mimedata.Mimes // PasteAssign assigns mime data (only the first one!) to this idx PasteAssign(md mimedata.Mimes, idx int) // PasteAtIdx inserts object(s) from mime data at // (before) given slice index PasteAtIdx(md mimedata.Mimes, idx int) // ItemCtxtMenu pulls up the context menu for given slice index ItemCtxtMenu(idx int) // StdCtxtMenu generates the standard context menu for this view StdCtxtMenu(m *gi.Scene, idx int) }
SliceViewer is the interface used by SliceViewBase to support any abstractions needed for different types of slice views.
type StructFieldVals ¶
type StructFieldVals struct { // path of field.field parent fields to this field Path string // type information for field Field reflect.StructField // value of field (as a pointer) Val reflect.Value // def tag information for default values Defs string }
StructFieldVals represents field values in a struct, at multiple levels of depth potentially (represented by the Path field) used for StructNonDefFields for example.
func StructNonDefFields ¶
func StructNonDefFields(structPtr any, path string) []StructFieldVals
StructNonDefFields processses "def" tag for default value(s) of fields in given struct and starting path, and returns all fields not at their default values. See also StructNoDefFieldsStr for a string representation of this information. Uses laser.FlatFieldsValueFunc to get all embedded fields. Uses a recursive strategy -- any fields that are themselves structs are expanded, and the field name represented by dots path separators.
type StructInlineValue ¶
type StructInlineValue struct {
ValueBase
}
StructInlineValue presents a StructViewInline for a struct
func (*StructInlineValue) ConfigWidget ¶
func (vv *StructInlineValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*StructInlineValue) UpdateWidget ¶
func (vv *StructInlineValue) UpdateWidget()
func (*StructInlineValue) WidgetType ¶
func (vv *StructInlineValue) WidgetType() *gti.Type
type StructValue ¶
type StructValue struct {
ValueBase
}
StructValue presents a button to edit the struct
func (*StructValue) ConfigWidget ¶
func (vv *StructValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*StructValue) HasButton ¶
func (vv *StructValue) HasButton() bool
func (*StructValue) OpenDialog ¶
func (vv *StructValue) OpenDialog(ctx gi.Widget, fun func(dlg *gi.Dialog))
func (*StructValue) UpdateWidget ¶
func (vv *StructValue) UpdateWidget()
func (*StructValue) WidgetType ¶
func (vv *StructValue) WidgetType() *gti.Type
type StructView ¶
type StructView struct { gi.Frame // the struct that we are a view onto Struct any `set:"-"` // Value for the struct itself, if this was created within value view framework -- otherwise nil StructValView Value // has the value of any field changed? updated by the ViewSig signals from fields Changed bool `set:"-"` // Value for a field marked with changeflag struct tag, which must be a bool type, which is updated when changes are registered in field values. ChangeFlag *reflect.Value `json:"-" xml:"-"` // Value representations of the fields FieldViews []Value `json:"-" xml:"-"` // whether to show the toolbar or not ShowToolbar bool // value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent TmpSave Value `json:"-" xml:"-"` // a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows ViewPath string // the struct that we successfully set a toolbar for ToolbarStru any // if true, some fields have default values -- update labels when values change HasDefs bool `json:"-" xml:"-" edit:"-"` // if true, some fields have viewif conditional view tags -- update after.. HasViewIfs bool `json:"-" xml:"-" edit:"-"` // extra tags by field name -- from type properties TypeFieldTags map[string]string `json:"-" xml:"-" edit:"-"` }
StructView represents a struct, creating a property editor of the fields -- constructs Children widgets to show the field names and editor fields for each field, within an overall frame. Automatically has a toolbar with Struct Toolbar props if defined set prop toolbar = false to turn off
func NewStructView ¶
func NewStructView(par ki.Ki, name ...string) *StructView
NewStructView adds a new StructView with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*StructView) ConfigStructGrid ¶
func (sv *StructView) ConfigStructGrid(sc *gi.Scene) bool
ConfigStructGrid configures the StructGrid for the current struct. returns true if any fields changed.
func (*StructView) ConfigToolbar ¶
func (sv *StructView) ConfigToolbar()
ConfigToolbar adds a toolbar based on the methodview ToolbarView function, if one has been defined for this struct type through its registered type properties.
func (*StructView) ConfigWidget ¶
func (sv *StructView) ConfigWidget(sc *gi.Scene)
Config configures the view
func (*StructView) FieldTags ¶
func (sv *StructView) FieldTags(fld reflect.StructField) reflect.StructTag
FieldTags returns the integrated tags for this field
func (*StructView) IsConfiged ¶
func (sv *StructView) IsConfiged() bool
IsConfiged returns true if the widget is fully configured
func (*StructView) KiType ¶
func (t *StructView) KiType() *gti.Type
KiType returns the *gti.Type of StructView
func (*StructView) OnInit ¶
func (sv *StructView) OnInit()
func (*StructView) Render ¶
func (sv *StructView) Render(sc *gi.Scene)
func (*StructView) SetChangeFlag ¶
func (t *StructView) SetChangeFlag(v *reflect.Value) *StructView
SetChangeFlag sets the [StructView.ChangeFlag]: Value for a field marked with changeflag struct tag, which must be a bool type, which is updated when changes are registered in field values.
func (*StructView) SetClass ¶
func (t *StructView) SetClass(v string) *StructView
SetClass sets the [StructView.Class]
func (*StructView) SetCustomContextMenu ¶
func (t *StructView) SetCustomContextMenu(v func(m *gi.Scene)) *StructView
SetCustomContextMenu sets the [StructView.CustomContextMenu]
func (*StructView) SetFieldViews ¶
func (t *StructView) SetFieldViews(v []Value) *StructView
SetFieldViews sets the [StructView.FieldViews]: Value representations of the fields
func (*StructView) SetHasDefs ¶
func (t *StructView) SetHasDefs(v bool) *StructView
SetHasDefs sets the [StructView.HasDefs]: if true, some fields have default values -- update labels when values change
func (*StructView) SetHasViewIfs ¶
func (t *StructView) SetHasViewIfs(v bool) *StructView
SetHasViewIfs sets the [StructView.HasViewIfs]: if true, some fields have viewif conditional view tags -- update after..
func (*StructView) SetLayout ¶
func (t *StructView) SetLayout(v gi.Layouts) *StructView
SetLayout sets the [StructView.Lay]
func (*StructView) SetShowToolbar ¶
func (t *StructView) SetShowToolbar(v bool) *StructView
SetShowToolbar sets the [StructView.ShowToolbar]: whether to show the toolbar or not
func (*StructView) SetSpacing ¶
func (t *StructView) SetSpacing(v units.Value) *StructView
SetSpacing sets the [StructView.Spacing]
func (*StructView) SetStackTop ¶
func (t *StructView) SetStackTop(v int) *StructView
SetStackTop sets the [StructView.StackTop]
func (*StructView) SetStripes ¶
func (t *StructView) SetStripes(v gi.Stripes) *StructView
SetStripes sets the [StructView.Stripes]
func (*StructView) SetStruct ¶
func (sv *StructView) SetStruct(st any) *StructView
SetStruct sets the source struct that we are viewing -- rebuilds the children to represent this struct
func (*StructView) SetStructValView ¶
func (t *StructView) SetStructValView(v Value) *StructView
SetStructValView sets the [StructView.StructValView]: Value for the struct itself, if this was created within value view framework -- otherwise nil
func (*StructView) SetTmpSave ¶
func (t *StructView) SetTmpSave(v Value) *StructView
SetTmpSave sets the [StructView.TmpSave]: value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent
func (*StructView) SetToolbarStru ¶
func (t *StructView) SetToolbarStru(v any) *StructView
SetToolbarStru sets the [StructView.ToolbarStru]: the struct that we successfully set a toolbar for
func (*StructView) SetTooltip ¶
func (t *StructView) SetTooltip(v string) *StructView
SetTooltip sets the [StructView.Tooltip]
func (*StructView) SetTypeFieldTags ¶
func (t *StructView) SetTypeFieldTags(v map[string]string) *StructView
SetTypeFieldTags sets the [StructView.TypeFieldTags]: extra tags by field name -- from type properties
func (*StructView) SetViewPath ¶
func (t *StructView) SetViewPath(v string) *StructView
SetViewPath sets the [StructView.ViewPath]: a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows
func (*StructView) StructGrid ¶
func (sv *StructView) StructGrid() *gi.Frame
StructGrid returns the grid layout widget, which contains all the fields and values
func (*StructView) Toolbar ¶
func (sv *StructView) Toolbar() *gi.Toolbar
Toolbar returns the toolbar widget
func (*StructView) UpdateField ¶
func (sv *StructView) UpdateField(field string)
UpdateField updates the value-view widget for the named field
func (*StructView) UpdateFieldAction ¶
func (sv *StructView) UpdateFieldAction()
func (*StructView) UpdateFields ¶
func (sv *StructView) UpdateFields()
UpdateFields updates each of the value-view widgets for the fields -- called by the ViewSig update
type StructViewInline ¶
type StructViewInline struct { gi.Frame // the struct that we are a view onto Struct any `set:"-"` // Value for the struct itself, if this was created within value view framework -- otherwise nil StructValView Value // if true add an edit action button at the end -- other users of this widget can then configure that -- it is called 'edit-action' AddButton bool // Value representations of the fields FieldViews []Value `json:"-" xml:"-"` // value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent TmpSave Value `json:"-" xml:"-" view:"-"` // a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows ViewPath string // if true, some fields have default values -- update labels when values change HasDefs bool `json:"-" xml:"-" edit:"-"` // if true, some fields have viewif conditional view tags -- update after.. HasViewIfs bool `json:"-" xml:"-" edit:"-"` }
StructViewInline represents a struct as a single line widget, for smaller structs and those explicitly marked inline.
func NewStructViewInline ¶
func NewStructViewInline(par ki.Ki, name ...string) *StructViewInline
NewStructViewInline adds a new StructViewInline with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*StructViewInline) ConfigStruct ¶
func (sv *StructViewInline) ConfigStruct(sc *gi.Scene) bool
ConfigStruct configures the children for the current struct
func (*StructViewInline) ConfigWidget ¶
func (sv *StructViewInline) ConfigWidget(sc *gi.Scene)
func (*StructViewInline) KiType ¶
func (t *StructViewInline) KiType() *gti.Type
KiType returns the *gti.Type of StructViewInline
func (*StructViewInline) New ¶
func (t *StructViewInline) New() ki.Ki
New returns a new *StructViewInline value
func (*StructViewInline) OnInit ¶
func (sv *StructViewInline) OnInit()
func (*StructViewInline) SetAddButton ¶
func (t *StructViewInline) SetAddButton(v bool) *StructViewInline
SetAddButton sets the [StructViewInline.AddButton]: if true add an edit action button at the end -- other users of this widget can then configure that -- it is called 'edit-action'
func (*StructViewInline) SetClass ¶
func (t *StructViewInline) SetClass(v string) *StructViewInline
SetClass sets the [StructViewInline.Class]
func (*StructViewInline) SetCustomContextMenu ¶
func (t *StructViewInline) SetCustomContextMenu(v func(m *gi.Scene)) *StructViewInline
SetCustomContextMenu sets the [StructViewInline.CustomContextMenu]
func (*StructViewInline) SetFieldViews ¶
func (t *StructViewInline) SetFieldViews(v []Value) *StructViewInline
SetFieldViews sets the [StructViewInline.FieldViews]: Value representations of the fields
func (*StructViewInline) SetHasDefs ¶
func (t *StructViewInline) SetHasDefs(v bool) *StructViewInline
SetHasDefs sets the [StructViewInline.HasDefs]: if true, some fields have default values -- update labels when values change
func (*StructViewInline) SetHasViewIfs ¶
func (t *StructViewInline) SetHasViewIfs(v bool) *StructViewInline
SetHasViewIfs sets the [StructViewInline.HasViewIfs]: if true, some fields have viewif conditional view tags -- update after..
func (*StructViewInline) SetLayout ¶
func (t *StructViewInline) SetLayout(v gi.Layouts) *StructViewInline
SetLayout sets the [StructViewInline.Lay]
func (*StructViewInline) SetSpacing ¶
func (t *StructViewInline) SetSpacing(v units.Value) *StructViewInline
SetSpacing sets the [StructViewInline.Spacing]
func (*StructViewInline) SetStackTop ¶
func (t *StructViewInline) SetStackTop(v int) *StructViewInline
SetStackTop sets the [StructViewInline.StackTop]
func (*StructViewInline) SetStripes ¶
func (t *StructViewInline) SetStripes(v gi.Stripes) *StructViewInline
SetStripes sets the [StructViewInline.Stripes]
func (*StructViewInline) SetStruct ¶
func (sv *StructViewInline) SetStruct(st any) *StructViewInline
SetStruct sets the source struct that we are viewing -- rebuilds the children to represent this struct
func (*StructViewInline) SetStructValView ¶
func (t *StructViewInline) SetStructValView(v Value) *StructViewInline
SetStructValView sets the [StructViewInline.StructValView]: Value for the struct itself, if this was created within value view framework -- otherwise nil
func (*StructViewInline) SetTmpSave ¶
func (t *StructViewInline) SetTmpSave(v Value) *StructViewInline
SetTmpSave sets the [StructViewInline.TmpSave]: value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent
func (*StructViewInline) SetTooltip ¶
func (t *StructViewInline) SetTooltip(v string) *StructViewInline
SetTooltip sets the [StructViewInline.Tooltip]
func (*StructViewInline) SetViewPath ¶
func (t *StructViewInline) SetViewPath(v string) *StructViewInline
SetViewPath sets the [StructViewInline.ViewPath]: a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows
func (*StructViewInline) StructViewInlineStyles ¶
func (sv *StructViewInline) StructViewInlineStyles()
func (*StructViewInline) UpdateFieldAction ¶
func (sv *StructViewInline) UpdateFieldAction()
func (*StructViewInline) UpdateFields ¶
func (sv *StructViewInline) UpdateFields()
type SubMenuFunc ¶
SubMenuFunc is a function that returns a string slice of submenu items used in MethodView submenu-func option first argument is the object on which the method is defined (receiver)
type SubSubMenuFunc ¶
SubSubMenuFunc is a function that returns a slice of string slices to create submenu items each having their own submenus. used in MethodView submenu-func option first argument is the object on which the method is defined (receiver)
type TableView ¶
type TableView struct { SliceViewBase // optional styling function StyleFunc TableViewStyleFunc `copy:"-" view:"-" json:"-" xml:"-"` // current selection field -- initially select value in this field SelField string `copy:"-" view:"-" json:"-" xml:"-"` // current sort index SortIdx int // whether current sort order is descending SortDesc bool // struct type for each row StruType reflect.Type `copy:"-" view:"-" json:"-" xml:"-"` // the visible fields VisFields []reflect.StructField `copy:"-" view:"-" json:"-" xml:"-"` // number of visible fields NVisFields int `copy:"-" view:"-" json:"-" xml:"-"` }
TableView represents a slice-of-structs as a table, where the fields are the columns, within an overall frame. It is a full-featured editor with multiple-selection, cut-and-paste, and drag-and-drop. If ReadOnly, it functions as a mutually-exclusive item selector, highlighting the selected row and emitting a Selected action.
func NewTableView ¶
NewTableView adds a new TableView with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*TableView) CacheVisFields ¶
func (tv *TableView) CacheVisFields()
CacheVisFields computes the number of visible fields in nVisFields and caches those to skip in fieldSkip
func (*TableView) ConfigFrame ¶
func (*TableView) ConfigHeader ¶
func (*TableView) ConfigHeaderStyleWidth ¶
func (*TableView) ConfigOneRow ¶
ConfigOneRow configures one row for initial row height measurement
func (*TableView) ConfigRows ¶
ConfigRows configures VisRows worth of widgets to display slice data. It should only be called when NeedsConfigRows is true: when VisRows changes.
func (*TableView) ConfigTableView ¶
func (*TableView) ConfigToolbar ¶
func (tv *TableView) ConfigToolbar()
ConfigToolbar configures the toolbar actions
func (*TableView) ConfigWidget ¶
Config configures the view
func (*TableView) GridLayout ¶
GridLayout returns the SliceGrid grid-layout widget, with grid and scrollbar
func (*TableView) IsConfiged ¶
IsConfiged returns true if the widget is fully configured
func (*TableView) RowFirstVisWidget ¶
func (tv *TableView) RowFirstVisWidget(row int) (*gi.WidgetBase, bool)
RowFirstVisWidget returns the first visible widget for given row (could be index or not) -- false if out of range
func (*TableView) RowGrabFocus ¶
func (tv *TableView) RowGrabFocus(row int) *gi.WidgetBase
RowGrabFocus grabs the focus for the first focusable widget in given row -- returns that element or nil if not successful -- note: grid must have already rendered for focus to be grabbed!
func (*TableView) RowWidgetNs ¶
RowWidgetNs returns number of widgets per row and offset for index label
func (*TableView) SelectFieldVal ¶
SelectFieldVal sets SelField and SelVal and attempts to find corresponding row, setting SelectedIdx and selecting row if found -- returns true if found, false otherwise
func (*TableView) SelectRowWidgets ¶
SelectRowWidgets sets the selection state of given row of widgets
func (*TableView) SetCustomContextMenu ¶
SetCustomContextMenu sets the [TableView.CustomContextMenu]
func (*TableView) SetDraggedIdxs ¶
SetDraggedIdxs sets the [TableView.DraggedIdxs]
func (*TableView) SetLayoutHeight ¶
SetLayoutHeight sets the [TableView.LayoutHeight]
func (*TableView) SetNvisFields ¶
SetNvisFields sets the [TableView.NVisFields]: number of visible fields
func (*TableView) SetRenderedRows ¶
SetRenderedRows sets the [TableView.RenderedRows]
func (*TableView) SetRowHeight ¶
SetRowHeight sets the [TableView.RowHeight]
func (*TableView) SetSelField ¶
SetSelField sets the [TableView.SelField]: current selection field -- initially select value in this field
func (*TableView) SetSelIdxs ¶
SetSelIdxs sets the [TableView.SelIdxs]
func (*TableView) SetSlice ¶
SetSlice sets the source slice that we are viewing -- rebuilds the children to represent this slice (does Update if already viewing).
func (*TableView) SetSliceNpval ¶
SetSliceNpval sets the [TableView.SliceNPVal]
func (*TableView) SetSliceSize ¶
SetSliceSize sets the [TableView.SliceSize]
func (*TableView) SetSliceValView ¶
SetSliceValView sets the [TableView.SliceValView]
func (*TableView) SetSortDesc ¶
SetSortDesc sets the [TableView.SortDesc]: whether current sort order is descending
func (*TableView) SetSortFieldName ¶
SetSortField sets sorting to happen on given field and direction -- see SortFieldName for details
func (*TableView) SetSortIdx ¶
SetSortIdx sets the [TableView.SortIdx]: current sort index
func (*TableView) SetSpacing ¶
SetSpacing sets the [TableView.Spacing]
func (*TableView) SetStackTop ¶
SetStackTop sets the [TableView.StackTop]
func (*TableView) SetStartIdx ¶
SetStartIdx sets the [TableView.StartIdx]
func (*TableView) SetStripes ¶
SetStripes sets the [TableView.Stripes]
func (*TableView) SetStruType ¶
SetStruType sets the [TableView.StruType]: struct type for each row
func (*TableView) SetStyleFunc ¶
func (t *TableView) SetStyleFunc(v TableViewStyleFunc) *TableView
SetStyleFunc sets the [TableView.StyleFunc]: optional styling function
func (*TableView) SetTmpSave ¶
SetTmpSave sets the [TableView.TmpSave]
func (*TableView) SetToolbarSlice ¶
SetToolbarSlice sets the [TableView.ToolbarSlice]
func (*TableView) SetTooltip ¶
SetTooltip sets the [TableView.Tooltip]
func (*TableView) SetViewPath ¶
SetViewPath sets the [TableView.ViewPath]
func (*TableView) SetVisFields ¶
func (t *TableView) SetVisFields(v []reflect.StructField) *TableView
SetVisFields sets the [TableView.VisFields]: the visible fields
func (*TableView) SetVisRows ¶
SetVisRows sets the [TableView.VisRows]
func (*TableView) SliceDeleteAt ¶
SliceDeleteAt deletes element at given index from slice
func (*TableView) SliceFrame ¶
SliceFrame returns the outer frame widget, which contains all the header, fields and values
func (*TableView) SliceGrid ¶
SliceGrid returns the SliceGrid grid frame widget, which contains all the fields and values, within SliceFrame
func (*TableView) SliceHeader ¶
SliceHeader returns the Toolbar header for slice grid
func (*TableView) SliceNewAt ¶
SliceNewAt inserts a new blank element at given index in the slice -- -1 means the end
func (*TableView) SortFieldName ¶
SortFieldName returns the name of the field being sorted, along with :up or :down depending on descending
func (*TableView) SortSlice ¶
func (tv *TableView) SortSlice()
SortSlice sorts the slice according to current settings
func (*TableView) SortSliceAction ¶
SortSliceAction sorts the slice for given field index -- toggles ascending vs. descending if already sorting on this dimension
func (*TableView) StructType ¶
StructType sets the StruType and returns the type of the struct within the slice -- this is a non-ptr type even if slice has pointers to structs
func (*TableView) TableViewInit ¶
func (tv *TableView) TableViewInit()
func (*TableView) UpdateWidgets ¶
func (tv *TableView) UpdateWidgets()
UpdateWidgets updates the row widget display to represent the current state of the slice data, including which range of data is being displayed. This is called for scrolling, navigation etc.
type TableViewStyleFunc ¶
TableViewStyleFunc is a styling function for custom styling / configuration of elements in the view. If style properties are set then you must call w.AsNode2dD().SetFullReRender() to trigger re-styling during re-render
type TextEditorValue ¶
type TextEditorValue struct {
ValueBase
}
TextEditorValue presents a texteditor.Editor for editing longer text
func (*TextEditorValue) ConfigWidget ¶
func (vv *TextEditorValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*TextEditorValue) UpdateWidget ¶
func (vv *TextEditorValue) UpdateWidget()
func (*TextEditorValue) WidgetType ¶
func (vv *TextEditorValue) WidgetType() *gti.Type
type TimeValue ¶
type TimeValue struct {
ValueBase
}
TimeValue presents a text field for a time
func (*TimeValue) TimeVal ¶
TimeVal decodes Value into a *time.Time value -- also handles FileTime case
func (*TimeValue) UpdateWidget ¶
func (vv *TimeValue) UpdateWidget()
func (*TimeValue) WidgetType ¶
type TreeView ¶
type TreeView struct { gi.WidgetBase // If non-Ki Node that this widget is viewing in the tree -- the source SyncNode ki.Ki `set:"-" copy:"-" json:"-" xml:"-"` // optional icon, displayed to the the left of the text label Icon icons.Icon // amount to indent children relative to this node Indent units.Value `copy:"-" json:"-" xml:"-"` // depth for nodes be initialized as open (default 4). // Nodes beyond this depth will be initialized as closed. OpenDepth int `copy:"-" json:"-" xml:"-"` // linear index of this node within the entire tree. // updated on full rebuilds and may sometimes be off, // but close enough for expected uses ViewIdx int `copy:"-" json:"-" xml:"-" edit:"-"` // size of just this node widget. // our alloc includes all of our children, but we only draw us. WidgetSize mat32.Vec2 `copy:"-" json:"-" xml:"-" edit:"-"` // cached root of the view RootView *TreeView `copy:"-" json:"-" xml:"-" edit:"-"` // SelectedNodes holds the currently-selected nodes, on the // RootView node only. SelectedNodes []*TreeView `copy:"-" json:"-" xml:"-" edit:"-"` // contains filtered or unexported fields }
TreeView provides a graphical representation of a tree tructure providing full navigation and manipulation abilities.
If the SyncNode field is non-nil, typically via SyncRootNode method, then the TreeView mirrors another Ki tree structure, and tree editing functions apply to the source tree first, and then to the TreeView by sync.
Otherwise, data can be directly encoded in a TreeView derived type, to represent any kind of tree structure and associated data.
Standard events.Event are sent to any listeners, including Select, Change, and DoubleClick. The selected nodes are in the root SelectedNodes list.
func AsTreeView ¶
func AsTreeView(k ki.Ki) *TreeView
AsTreeView returns the given value as a value of type TreeView if the type of the given value embeds TreeView, or nil otherwise
func NewTreeView ¶
NewTreeView adds a new TreeView with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*TreeView) AddChildNode ¶
func (tv *TreeView) AddChildNode()
AddChildNode adds a new child node to this one in the tree, prompting the user for the type of node to add If SyncNode is set, operates on Sync Tree.
func (*TreeView) AddSyncNodes ¶
func (*TreeView) AddTreeNodes ¶
func (*TreeView) ApplyStyle ¶
func (*TreeView) AsTreeView ¶
AsTreeView satisfies the [TreeViewEmbedder] interface
func (*TreeView) BranchPart ¶
BranchPart returns the branch in parts, if it exists
func (*TreeView) Close ¶
func (tv *TreeView) Close()
Close closes the given node and updates the view accordingly (if it is not already closed). Calls OnClose in TreeViewer interface for extensible actions.
func (*TreeView) CloseAll ¶
func (tv *TreeView) CloseAll()
CloseAll closes the given node and all of its sub-nodes.
func (*TreeView) ConfigParts ¶
func (*TreeView) ConfigWidget ¶
func (*TreeView) ContextMenu ¶
func (*TreeView) ContextMenuPos ¶
func (*TreeView) Copy ¶
Copy copies to clip.Board, optionally resetting the selection. satisfies gi.Clipper interface and can be overridden by subtypes
func (*TreeView) CopyFieldsFrom ¶
func (*TreeView) Cut ¶
func (tv *TreeView) Cut()
Cut copies to clip.Board and deletes selected items. satisfies gi.Clipper interface and can be overridden by subtypes
func (*TreeView) CutSync ¶
func (tv *TreeView) CutSync()
CutSync copies to clip.Board and deletes selected items. satisfies gi.Clipper interface and can be overridden by subtypes
func (*TreeView) DeleteNode ¶
func (tv *TreeView) DeleteNode()
DeleteNode deletes the tree node or sync node corresponding to this view node in the sync tree. If SyncNode is set, operates on Sync Tree.
func (*TreeView) DoLayoutParts ¶
func (*TreeView) DragNDropStart ¶
func (tv *TreeView) DragNDropStart()
DragNDropStart starts a drag-n-drop on this node -- it includes any other selected nodes as well, each as additional records in mimedata
func (*TreeView) Duplicate ¶
func (tv *TreeView) Duplicate()
Duplicate duplicates the sync node corresponding to this view node in the tree, and inserts the duplicate after this node (as a new sibling). If SyncNode is set, operates on Sync Tree.
func (*TreeView) DuplicateSync ¶
func (tv *TreeView) DuplicateSync()
func (*TreeView) EditNode ¶
func (tv *TreeView) EditNode()
EditNode pulls up a StructViewDialog window on the node. If SyncNode is set, operates on Sync Tree.
func (*TreeView) FindSyncNode ¶
FindSyncNode finds TreeView node for given source node, or nil if not found
func (*TreeView) GoGiEditNode ¶
func (tv *TreeView) GoGiEditNode()
GoGiEditNode pulls up a new GoGiEditor window on the node. If SyncNode is set, operates on Sync Tree.
func (*TreeView) HandleTreeViewDrag ¶
func (tv *TreeView) HandleTreeViewDrag()
func (*TreeView) HandleTreeViewEvents ¶
func (tv *TreeView) HandleTreeViewEvents()
func (*TreeView) HandleTreeViewKeyChord ¶
func (*TreeView) HandleTreeViewMouse ¶
func (tv *TreeView) HandleTreeViewMouse()
func (*TreeView) HasSelection ¶
HasSelection returns true if there are currently selected items
func (*TreeView) InsertAfter ¶
func (tv *TreeView) InsertAfter()
InsertAfter inserts a new node in the tree after this node, at the same (sibling) level, prompting for the type of node to insert. If SyncNode is set, operates on Sync Tree.
func (*TreeView) InsertAt ¶
InsertAt inserts a new node in the tree at given relative offset from this node, at the same (sibling) level, prompting for the type of node to insert If SyncNode is set, operates on Sync Tree.
func (*TreeView) InsertBefore ¶
func (tv *TreeView) InsertBefore()
InsertBefore inserts a new node in the tree before this node, at the same (sibling) level, prompting for the type of node to insert If SyncNode is set, operates on Sync Tree.
func (*TreeView) Label ¶
Label returns the display label for this node, satisfying the Labeler interface
func (*TreeView) MakePasteMenu ¶
MakePasteMenu makes the menu of options for paste events
func (*TreeView) MimeData ¶
MimeData adds mimedata for this node: a text/plain of the Path. satisfies Clipper.MimeData interface
func (*TreeView) MimeDataSync ¶
MimeDataSync adds mimedata for this node: a text/plain of the Path, and an application/json of the sync node. satisfies Clipper.MimeData interface
func (*TreeView) MoveDown ¶
func (tv *TreeView) MoveDown(selMode events.SelectModes) *TreeView
MoveDown moves the selection down to next element in the tree, using given select mode (from keyboard modifiers). Returns newly selected node.
func (*TreeView) MoveDownAction ¶
func (tv *TreeView) MoveDownAction(selMode events.SelectModes) *TreeView
MoveDownAction moves the selection down to next element in the tree, using given select mode (from keyboard modifiers). Sends select event for newly selected item.
func (*TreeView) MoveDownSibling ¶
func (tv *TreeView) MoveDownSibling(selMode events.SelectModes) *TreeView
MoveDownSibling moves down only to siblings, not down into children, using given select mode (from keyboard modifiers)
func (*TreeView) MoveEndAction ¶
func (tv *TreeView) MoveEndAction(selMode events.SelectModes) *TreeView
MoveEndAction moves the selection to the very last node in the tree, using given select mode (from keyboard modifiers) Sends select event for newly selected item.
func (*TreeView) MoveHomeAction ¶
func (tv *TreeView) MoveHomeAction(selMode events.SelectModes) *TreeView
MoveHomeAction moves the selection up to top of the tree, using given select mode (from keyboard modifiers) and emits select event for newly selected item
func (*TreeView) MovePageDownAction ¶
func (tv *TreeView) MovePageDownAction(selMode events.SelectModes) *TreeView
MovePageDownAction moves the selection up to previous TreeViewPageSteps elements in the tree, using given select mode (from keyboard modifiers). Sends select event for newly selected item.
func (*TreeView) MovePageUpAction ¶
func (tv *TreeView) MovePageUpAction(selMode events.SelectModes) *TreeView
MovePageUpAction moves the selection up to previous TreeViewPageSteps elements in the tree, using given select mode (from keyboard modifiers). Sends select event for newly selected item.
func (*TreeView) MoveToLastChild ¶
func (tv *TreeView) MoveToLastChild(selMode events.SelectModes) *TreeView
MoveToLastChild moves to the last child under me, using given select mode (from keyboard modifiers)
func (*TreeView) MoveUp ¶
func (tv *TreeView) MoveUp(selMode events.SelectModes) *TreeView
MoveUp moves selection up to previous element in the tree, using given select mode (from keyboard modifiers). Returns newly selected node
func (*TreeView) MoveUpAction ¶
func (tv *TreeView) MoveUpAction(selMode events.SelectModes) *TreeView
MoveUpAction moves the selection up to previous element in the tree, using given select mode (from keyboard modifiers). Sends select event for newly selected item.
func (*TreeView) NodesFromMimeData ¶
NodesFromMimeData returns a slice of Ki nodes for the TreeView nodes and paths from mime data.
func (*TreeView) OnClose ¶
func (tv *TreeView) OnClose()
OnClose is called when a node is closed. The base version does nothing.
func (*TreeView) OnOpen ¶
func (tv *TreeView) OnOpen()
OnOpen is called when a node is opened. The base version does nothing.
func (*TreeView) Open ¶
func (tv *TreeView) Open()
Open opens the given node and updates the view accordingly (if it is not already opened) Calls OnOpen in TreeViewer interface for extensible actions.
func (*TreeView) OpenAll ¶
func (tv *TreeView) OpenAll()
OpenAll opens the given node and all of its sub-nodes
func (*TreeView) OpenParents ¶
func (tv *TreeView) OpenParents()
OpenParents opens all the parents of this node, so that it will be visible.
func (*TreeView) Paste ¶
func (tv *TreeView) Paste()
Paste pastes clipboard at given node. satisfies gi.Clipper interface and can be overridden by subtypes
func (*TreeView) PasteAfter ¶
PasteAfter inserts object(s) from mime data after this node. If another item with the same name already exists, it will append _Copy on the name of the inserted objects
func (*TreeView) PasteAssign ¶
PasteAssign assigns mime data (only the first one!) to this node
func (*TreeView) PasteAssignSync ¶
PasteAssignSync assigns mime data (only the first one!) to this node
func (*TreeView) PasteAt ¶
PasteAt inserts object(s) from mime data at rel position to this node. If another item with the same name already exists, it will append _Copy on the name of the inserted objects
func (*TreeView) PasteAtSync ¶
PasteAt inserts object(s) from mime data at rel position to this node. If another item with the same name already exists, it will append _Copy on the name of the inserted objects
func (*TreeView) PasteBefore ¶
PasteBefore inserts object(s) from mime data before this node. If another item with the same name already exists, it will append _Copy on the name of the inserted objects
func (*TreeView) PasteChildren ¶
PasteChildren inserts object(s) from mime data at end of children of this node
func (*TreeView) PasteChildrenSync ¶
PasteChildrenSync inserts object(s) from mime data at end of children of this node
func (*TreeView) PasteMenu ¶
PasteMenu performs a paste from the clipboard using given data -- pops up a menu to determine what specifically to do
func (*TreeView) ReSync ¶
func (tv *TreeView) ReSync()
ReSync resynchronizes the view relative to the underlying nodes and forces a full rerender
func (*TreeView) RenderNode ¶
func (*TreeView) RootIsReadOnly ¶
RootIsReadOnly returns the ReadOnly status of the root node, which is what controls the functional inactivity of the tree if individual nodes are ReadOnly that only affects display typically.
func (*TreeView) RootSetViewIdx ¶
RootSetViewIdx sets the RootView and ViewIdx for all nodes. This must be called from the root node after construction or any modification to the tree. Returns the total number of leaves in the tree.
func (*TreeView) Select ¶
func (tv *TreeView) Select()
Select selects this node (if not already selected). Must use this method to update global selection list
func (*TreeView) SelectAction ¶
func (tv *TreeView) SelectAction(mode events.SelectModes) bool
SelectAction updates selection to include this node, using selectmode from mouse event (ExtendContinuous, ExtendOne), and Root sends selection event. Returns true if signal emitted.
func (*TreeView) SelectMode ¶
SelectMode returns true if keyboard movements should automatically select nodes
func (*TreeView) SelectModeToggle ¶
func (tv *TreeView) SelectModeToggle()
SelectModeToggle toggles the SelectMode
func (*TreeView) SelectUpdate ¶
func (tv *TreeView) SelectUpdate(mode events.SelectModes) bool
SelectUpdate updates selection to include this node, using selectmode from mouse event (ExtendContinuous, ExtendOne). Returns true if this node selected
func (*TreeView) SelectedSyncNodes ¶
func (tv *TreeView) SelectedSyncNodes() ki.Slice
SelectedSyncNodes returns a slice of the currently-selected sync source nodes in the entire tree view
func (*TreeView) SelectedViews ¶
SelectedViews returns a slice of the currently-selected TreeViews within the entire tree, using a list maintained by the root node
func (*TreeView) SendChangeEvent ¶
SendChangeEvent sends the events.Change event on the RootView node, using context event if avail (else nil).
func (*TreeView) SendChangeEventReSync ¶
SendChangeEventReSync sends the events.Change event on the RootView node, using context event if avail (else nil). If SyncNode != nil, also does a re-sync from root.
func (*TreeView) SendSelectEvent ¶
SendSelectEvent sends the events.Select event on the RootView node, using context event if avail (else nil).
func (*TreeView) SetBranchState ¶
func (tv *TreeView) SetBranchState()
func (*TreeView) SetClosed ¶
SetClosed sets the closed flag for this node. Call Close() method to close a node and update view.
func (*TreeView) SetCustomContextMenu ¶
SetCustomContextMenu sets the [TreeView.CustomContextMenu]
func (*TreeView) SetIcon ¶
SetIcon sets the [TreeView.Icon]: optional icon, displayed to the the left of the text label
func (*TreeView) SetIndent ¶
SetIndent sets the [TreeView.Indent]: amount to indent children relative to this node
func (*TreeView) SetKidsVisibility ¶
func (*TreeView) SetOpenDepth ¶
SetOpenDepth sets the [TreeView.OpenDepth]: depth for nodes be initialized as open (default 4). Nodes beyond this depth will be initialized as closed.
func (*TreeView) SetRootView ¶
SetRootView sets the [TreeView.RootView]: cached root of the view
func (*TreeView) SetSelectMode ¶
SetSelectMode updates the select mode
func (*TreeView) SetSelectedNodes ¶
SetSelectedNodes sets the [TreeView.SelectedNodes]: SelectedNodes holds the currently-selected nodes, on the RootView node only.
func (*TreeView) SetSelectedViews ¶
SetSelectedViews updates the selected views to given list
func (*TreeView) SetSyncNode ¶
SetSyncNode sets the sync source node that we are viewing, and syncs the view of its tree. It is called routinely via SyncToSrc during tree updating. It uses ki Config mechanism to perform minimal updates to remain in sync.
func (*TreeView) SetTooltip ¶
SetTooltip sets the [TreeView.Tooltip]
func (*TreeView) SetViewIdx ¶
SetViewIdx sets the [TreeView.ViewIdx]: linear index of this node within the entire tree. updated on full rebuilds and may sometimes be off, but close enough for expected uses
func (*TreeView) SetWidgetSize ¶
SetWidgetSize sets the [TreeView.WidgetSize]: size of just this node widget. our alloc includes all of our children, but we only draw us.
func (*TreeView) StyleTreeView ¶
func (*TreeView) SyncNodesFromMimeData ¶
SyncNodesFromMimeData creates a slice of Ki node(s) from given mime data and also a corresponding slice of original paths.
func (*TreeView) SyncRootNode ¶
func (tv *TreeView) SyncRootNode(sk ki.Ki)
SyncRootNode sets the root view to the root of the sync source node for this TreeView, and syncs the rest of the tree to match. Calls ki.UniquifyNamesAll on source tree to ensure that node names are unique which is essential for proper viewing!
func (*TreeView) SyncToSrc ¶
SyncToSrc updates the view tree to match the sync tree, using ConfigChildren to maximally preserve existing tree elements. init means we are doing initial build, and depth tracks depth (only during init).
func (*TreeView) ToggleClose ¶
func (tv *TreeView) ToggleClose()
ToggleClose toggles the close / open status: if closed, opens, and vice-versa
func (*TreeView) TreeViewChanged ¶
TreeViewChanged must be called after any structural change to the TreeView (adding or deleting nodes). It calls: RootSetViewIdx() to update indexes and SendChangeEvent to notify of changes.
func (*TreeView) TreeViewContextMenu ¶
func (*TreeView) TreeViewContextMenuReadOnly ¶
func (*TreeView) TreeViewParent ¶
func (*TreeView) TreeViewStyles ¶
func (tv *TreeView) TreeViewStyles()
func (*TreeView) Unselect ¶
func (tv *TreeView) Unselect()
Unselect unselects this node (if selected). Must use this method to update global selection list.
func (*TreeView) UnselectAction ¶
func (tv *TreeView) UnselectAction()
UnselectAction unselects this node (if selected), and Root sends a selection event.
func (*TreeView) UnselectAll ¶
func (tv *TreeView) UnselectAll()
UnselectAll unselects all selected items in the view
func (*TreeView) UpdateBranchIcons ¶
func (tv *TreeView) UpdateBranchIcons()
func (*TreeView) UpdateReadOnly ¶
UpdateReadOnly updates the ReadOnly state based on SyncNode. Returns true if ReadOnly. The inactivity of individual nodes only affects display properties typically, and not overall functional behavior, which is controlled by inactivity of the root node (i.e, make the root ReadOnly to make entire tree read-only and non-modifiable)
type TreeViewFlags ¶
type TreeViewFlags gi.WidgetFlags //enums:bitflag -trim-prefix TreeViewFlag
TreeViewFlags extend WidgetFlags to hold TreeView state
const ( // TreeViewFlagClosed means node is toggled closed // (children not visible) Otherwise Open. TreeViewFlagClosed TreeViewFlags = TreeViewFlags(gi.WidgetFlagsN) + iota // This flag on the Root node determines whether keyboard movements // update selection or not. TreeViewFlagSelectMode )
const TreeViewFlagsN TreeViewFlags = 11
TreeViewFlagsN is the highest valid value for type TreeViewFlags, plus one.
func TreeViewFlagsValues ¶
func TreeViewFlagsValues() []TreeViewFlags
TreeViewFlagsValues returns all possible values for the type TreeViewFlags.
func (TreeViewFlags) BitIndexString ¶
func (i TreeViewFlags) BitIndexString() string
BitIndexString returns the string representation of this TreeViewFlags value if it is a bit index value (typically an enum constant), and not an actual bit flag value.
func (TreeViewFlags) Desc ¶
func (i TreeViewFlags) Desc() string
Desc returns the description of the TreeViewFlags value.
func (TreeViewFlags) HasFlag ¶
func (i TreeViewFlags) HasFlag(f enums.BitFlag) bool
HasFlag returns whether these bit flags have the given bit flag set.
func (TreeViewFlags) Int64 ¶
func (i TreeViewFlags) Int64() int64
Int64 returns the TreeViewFlags value as an int64.
func (TreeViewFlags) IsValid ¶
func (i TreeViewFlags) IsValid() bool
IsValid returns whether the value is a valid option for type TreeViewFlags.
func (TreeViewFlags) MarshalText ¶
func (i TreeViewFlags) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface.
func (*TreeViewFlags) SetFlag ¶
func (i *TreeViewFlags) SetFlag(on bool, f ...enums.BitFlag)
SetFlag sets the value of the given flags in these flags to the given value.
func (*TreeViewFlags) SetInt64 ¶
func (i *TreeViewFlags) SetInt64(in int64)
SetInt64 sets the TreeViewFlags value from an int64.
func (*TreeViewFlags) SetString ¶
func (i *TreeViewFlags) SetString(s string) error
SetString sets the TreeViewFlags value from its string representation, and returns an error if the string is invalid.
func (*TreeViewFlags) SetStringOr ¶
func (i *TreeViewFlags) SetStringOr(s string) error
SetStringOr sets the TreeViewFlags value from its string representation while preserving any bit flags already set, and returns an error if the string is invalid.
func (TreeViewFlags) String ¶
func (i TreeViewFlags) String() string
String returns the string representation of this TreeViewFlags value.
func (*TreeViewFlags) UnmarshalText ¶
func (i *TreeViewFlags) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (TreeViewFlags) Values ¶
func (i TreeViewFlags) Values() []enums.Enum
Values returns all possible values for the type TreeViewFlags.
type TreeViewer ¶
type TreeViewer interface { // AsTreeView returns the base *TreeView for this node AsTreeView() *TreeView // OnOpen is called when a node is opened. // The base version does nothing. OnOpen() // OnClose is called when a node is closed // The base version does nothing. OnClose() // UpdateBranchIcons is called during DoLayout to update branch icons // when everything should be configured, prior to rendering. UpdateBranchIcons() }
TreeViewer is an interface for TreeView types providing access to the base TreeView and overridable method hooks for actions taken on the TreeView, including OnOpen, OnClose, etc.
type TypeValue ¶
type TypeValue struct {
ValueBase
}
TypeValue presents a chooser for choosing types
func (*TypeValue) UpdateWidget ¶
func (vv *TypeValue) UpdateWidget()
func (*TypeValue) WidgetType ¶
type VCSLogView ¶
type VCSLogView struct { gi.Layout // current log Log vci.Log // file that this is a log of -- if blank then it is entire repository File string // date expression for how long ago to include log entries from Since string // version control system repository Repo vci.Repo `json:"-" xml:"-" copy:"-"` // revision A -- defaults to HEAD RevA string `set:"-"` // revision B -- blank means current working copy RevB string `set:"-"` // double-click will set the A revision -- else B SetA bool }
VCSLogView is a view of the variables
func NewVCSLogView ¶
func NewVCSLogView(par ki.Ki, name ...string) *VCSLogView
NewVCSLogView adds a new VCSLogView with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*VCSLogView) ConfigRepo ¶
func (lv *VCSLogView) ConfigRepo(repo vci.Repo, lg vci.Log, file, since string)
ConfigRepo configures to given repo, log and file (file could be empty)
func (*VCSLogView) KiType ¶
func (t *VCSLogView) KiType() *gti.Type
KiType returns the *gti.Type of VCSLogView
func (*VCSLogView) OnInit ¶
func (lv *VCSLogView) OnInit()
func (*VCSLogView) SetClass ¶
func (t *VCSLogView) SetClass(v string) *VCSLogView
SetClass sets the [VCSLogView.Class]
func (*VCSLogView) SetCustomContextMenu ¶
func (t *VCSLogView) SetCustomContextMenu(v func(m *gi.Scene)) *VCSLogView
SetCustomContextMenu sets the [VCSLogView.CustomContextMenu]
func (*VCSLogView) SetFile ¶
func (t *VCSLogView) SetFile(v string) *VCSLogView
SetFile sets the [VCSLogView.File]: file that this is a log of -- if blank then it is entire repository
func (*VCSLogView) SetLayout ¶
func (t *VCSLogView) SetLayout(v gi.Layouts) *VCSLogView
SetLayout sets the [VCSLogView.Lay]
func (*VCSLogView) SetLog ¶
func (t *VCSLogView) SetLog(v vci.Log) *VCSLogView
SetLog sets the [VCSLogView.Log]: current log
func (*VCSLogView) SetRepo ¶
func (t *VCSLogView) SetRepo(v vci.Repo) *VCSLogView
SetRepo sets the [VCSLogView.Repo]: version control system repository
func (*VCSLogView) SetSetA ¶
func (t *VCSLogView) SetSetA(v bool) *VCSLogView
SetSetA sets the [VCSLogView.SetA]: double-click will set the A revision -- else B
func (*VCSLogView) SetSince ¶
func (t *VCSLogView) SetSince(v string) *VCSLogView
SetSince sets the [VCSLogView.Since]: date expression for how long ago to include log entries from
func (*VCSLogView) SetSpacing ¶
func (t *VCSLogView) SetSpacing(v units.Value) *VCSLogView
SetSpacing sets the [VCSLogView.Spacing]
func (*VCSLogView) SetStackTop ¶
func (t *VCSLogView) SetStackTop(v int) *VCSLogView
SetStackTop sets the [VCSLogView.StackTop]
func (*VCSLogView) SetTooltip ¶
func (t *VCSLogView) SetTooltip(v string) *VCSLogView
SetTooltip sets the [VCSLogView.Tooltip]
func (*VCSLogView) TableView ¶
func (lv *VCSLogView) TableView() *TableView
TableView returns the tableview
func (*VCSLogView) ToggleRev ¶
func (lv *VCSLogView) ToggleRev()
ToggleRev switches the active revision to set
func (*VCSLogView) Toolbar ¶
func (lv *VCSLogView) Toolbar() *gi.Toolbar
Toolbar returns the toolbar
type Value ¶
type Value interface { fmt.Stringer // AsValueBase gives access to the basic data fields so that the // interface doesn't need to provide accessors for them. AsValueBase() *ValueBase // AsWidget returns the widget associated with the value AsWidget() gi.Widget // Name returns the name of the value Name() string // SetName sets the name of the value SetName(name string) // Label returns the label for the value Label() string // SetLabel sets the label for the value SetLabel(label string) // Doc returns the documentation for the value Doc() string // SetDoc sets the documentation for the value SetDoc(doc string) // Is checks if flag is set, using atomic, safe for concurrent access Is(f enums.BitFlag) bool // SetFlag sets the given flag(s) to given state // using atomic, safe for concurrent access SetFlag(on bool, f ...enums.BitFlag) // SetStructValue sets the value, owner and field information for a struct field. SetStructValue(val reflect.Value, owner any, field *reflect.StructField, tmpSave Value, viewPath string) // SetMapKey sets the key value and owner for a map key. SetMapKey(val reflect.Value, owner any, tmpSave Value) // SetMapValue sets the value, owner and map key information for a map // element -- needs pointer to Value representation of key to track // current key value. SetMapValue(val reflect.Value, owner any, key any, keyView Value, tmpSave Value, viewPath string) // SetSliceValue sets the value, owner and index information for a slice element. SetSliceValue(val reflect.Value, owner any, idx int, tmpSave Value, viewPath string) // SetSoloValue sets the value for a singleton standalone value // (e.g., for arg values). SetSoloValue(val reflect.Value) // OwnerKind returns the reflect.Kind of the owner: Struct, Map, or Slice // (or Invalid for standalone values such as args). OwnerKind() reflect.Kind // IsReadOnly returns whether the value is ReadOnly, which prevents modification // of the underlying Value. Can be flagged by container views, or // Map owners have ReadOnly values, and fields can be marked // as ReadOnly using a struct tag. IsReadOnly() bool // SetReadOnly marks this value as ReadOnly or not SetReadOnly(ro bool) // WidgetType returns an appropriate type of widget to represent the // current value. WidgetType() *gti.Type // UpdateWidget updates the widget representation to reflect the current // value. Must first check for a nil widget -- can be called in a // no-widget context (e.g., for single-argument values with actions). UpdateWidget() // ConfigWidget configures a widget of WidgetType for representing the // value, including setting up the signal connections to set the value // when the user edits it (values are always set immediately when the // widget is updated). ConfigWidget(w gi.Widget, sc *gi.Scene) // HasAction returns true if this value has an associated action, such as // pulling up a dialog or chooser for this value. Activate method will // trigger this action. HasDialog() bool // OpenDialog opens a dialog or chooser for this value. // This is called by default for single-argument methods that have value // representations with actions. The ctx Widget provides a context // for opening the dialog, and function is called with the the relevant dialog, // so that the caller can execute its own actions based on the user // hitting Ok or Cancel. OpenDialog(ctx gi.Widget, fun func(dlg *gi.Dialog)) // Val returns the reflect.Value representation for this item. Val() reflect.Value // SetValue assigns given value to this item (if not ReadOnly), using // Ki.SetField for Ki types and laser.SetRobust otherwise -- emits a ViewSig // signal when set. SetValue(val any) bool // SendChange sends events.Change event to all listeners registered on this view. // This is the primary notification event for all Value elements. // It takes an optional original event to base the event on. SendChange(orig ...events.Event) // OnChange registers given listener function for Change events on Value. // This is the primary notification event for all Value elements. OnChange(fun func(e events.Event)) // SetTags sets tags for this valueview, for non-struct values, to // influence interface for this value -- see // https://goki.dev/gi/v2/wiki/Tags for valid options. Adds to // existing tags if some are already set. SetTags(tags map[string]string) // SetTag sets given tag to given value for this valueview, for non-struct // values, to influence interface for this value -- see // https://goki.dev/gi/v2/wiki/Tags for valid options. SetTag(tag, value string) // Tag returns value for given tag -- looks first at tags set by // SetTag(s) methods, and then at field tags if this is a field in a // struct -- returns false if tag was not set. Tag(tag string) (string, bool) // AllTags returns all the tags for this value view, from structfield or set // specifically using SetTag* methods AllTags() map[string]string // SaveTmp saves a temporary copy of a struct to a map -- map values must // be explicitly re-saved and cannot be directly written to by the value // elements -- each Value has a pointer to any parent Value that // might need to be saved after SetValue -- SaveTmp called automatically // in SetValue but other cases that use something different need to call // it explicitly. SaveTmp() }
Value is an interface for managing the GUI representation of values (e.g., fields, map values, slice values) in Views (StructView, MapView, etc). It is a GUI version of the reflect.Value, and uses that for representing the underlying Value being represented graphically. The different types of Value are for different Kinds of values (bool, float, etc) -- which can have different Kinds of owners. The ValueBase class supports all the basic fields for managing the owner kinds.
func FieldToValue ¶
FieldToValue returns the appropriate Value for given field on a struct -- attempts to get the FieldValuer interface, and falls back on ToValue otherwise, using field value (fval) gopy:interface=handle
func NewValue ¶
NewValue makes and returns a new Value from the given value and creates the widget for it with the given parent and optional name. It is the main way that end-user code should interact with giv. The given value needs to be a pointer for it to be settable.
NewValue is not appropriate for internal code configuring non-solo values (for example, in StructView), but it should be fine for most end-user code.
func ToValue ¶
ToValue returns the appropriate Value for given item, based only on its type -- attempts to get the Valuer interface and failing that, falls back on default Kind-based options. tags are optional tags, e.g., from the field in a struct, that control the view properties -- see the gi wiki for details on supported tags -- these are NOT set for the view element, only used for options that affect what kind of view to create. See FieldToValue for version that takes into account the properties of the owner. gopy:interface=handle
type ValueBase ¶
type ValueBase struct { // Nm is locally-unique name of Value Nm string // SavedLabel is the label for the Value SavedLabel string // SavedDoc is the saved documentation for the Value, if any // (only valid if [ValueHasSaveDoc] is true) SavedDoc string // Flags are atomic bit flags for Value state Flags ValueFlags // the reflect.Value representation of the value Value reflect.Value `set:"-"` // kind of owner that we have -- reflect.Struct, .Map, .Slice are supported OwnKind reflect.Kind // a record of parent View names that have led up to this view -- displayed as extra contextual information in view dialog windows ViewPath string // the object that owns this value, either a struct, slice, or map, if non-nil -- if a Ki Node, then SetField is used to set value, to provide proper updating Owner any // if Owner is a struct, this is the reflect.StructField associated with the value Field *reflect.StructField // set of tags that can be set to customize interface for different types of values -- only source for non-structfield values Tags map[string]string `set:"-"` // if Owner is a map, and this is a value, this is the key for this value in the map Key any `set:"-" edit:"-"` // if Owner is a map, and this is a value, this is the value view representing the key -- its value has the *current* value of the key, which can be edited KeyView Value `set:"-" edit:"-"` // if Owner is a slice, this is the index for the value in the slice Idx int `set:"-" edit:"-"` // type of widget to create -- cached during WidgetType method -- chosen based on the Value type and reflect.Value type -- see Valuer interface WidgetTyp *gti.Type `set:"-" edit:"-"` // the widget used to display and edit the value in the interface -- this is created for us externally and we cache it during ConfigWidget Widget gi.Widget `set:"-" edit:"-"` // Listeners are event listener functions for processing events on this widget. // type specific Listeners are added in OnInit when the widget is initialized. Listeners events.Listeners `set:"-" view:"-"` // value view that needs to have SaveTmp called on it whenever a change is made to one of the underlying values -- pass this down to any sub-views created from a parent TmpSave Value `set:"-" view:"-"` }
ValueBase provides the basis for implementations of the Value interface, representing values in the interface -- it implements a generic TextField representation of the string value, and provides the generic fallback for everything that doesn't provide a specific Valuer type.
func (*ValueBase) AsValueBase ¶
func (*ValueBase) CreateTempIfNotPtr ¶
func (*ValueBase) GetTitle ¶
GetTitle returns a title for this item suitable for a window title etc, based on the underlying value type name, owner label, and ViewPath. newPath returns just what should be added to a ViewPath also includes zero value check reported in the isZero bool, which can be used for not proceeding in case of non-value-based types.
func (*ValueBase) HandleEvent ¶
HandleEvent sends the given event to all Listeners for that event type. It also checks if the State has changed and calls ApplyStyle if so. If more significant Config level changes are needed due to an event, the event handler must do this itself.
func (*ValueBase) IsReadOnly ¶
func (*ValueBase) OnChange ¶
OnChange registers given listener function for Change events on Value. This is the primary notification event for all Value elements.
func (*ValueBase) OpenDialog ¶
func (*ValueBase) OwnerKind ¶
we have this one accessor b/c it is more useful for outside consumers vs. internal usage
func (*ValueBase) OwnerLabel ¶
OwnerLabel returns some extra info about the owner of this value view which is useful to put in title of our object
func (*ValueBase) Send ¶
Send sends an NEW event of given type to this widget, optionally starting from values in the given original event (recommended to include where possible). Do NOT send an existing event using this method if you want the Handled state to persist throughout the call chain; call HandleEvent directly for any existing events.
func (*ValueBase) SendChange ¶
SendChange sends events.Change event to all listeners registered on this view. This is the primary notification event for all Value elements. It takes an optional original event to base the event on.
func (*ValueBase) SetFlag ¶
SetFlag sets the given flag(s) to given state using atomic, safe for concurrent access
func (*ValueBase) SetMapValue ¶
func (*ValueBase) SetReadOnly ¶
func (*ValueBase) SetSliceValue ¶
func (*ValueBase) SetSoloValue ¶
SetSoloValue sets the value for a singleton standalone value (e.g., for arg values).
func (*ValueBase) SetStructValue ¶
func (*ValueBase) StdConfigWidget ¶
StdConfigWidget does all of the standard widget configuration tag options
func (*ValueBase) UpdateWidget ¶
func (vv *ValueBase) UpdateWidget()
func (*ValueBase) WidgetType ¶
type ValueFlags ¶
type ValueFlags int64 //enums:bitflag -trim-prefix Value
ValueFlags for Value bool state
const ( // flagged after first configuration ValueReadOnly ValueFlags = iota // for OwnKind = Map, this value represents the Key -- otherwise the Value ValueMapKey // ValueHasSavedLabel is whether the value has a saved version of its // label, which can be set either automatically or explicitly ValueHasSavedLabel // ValueHasSavedDoc is whether the value has a saved version of its // documentation, which can be set either automatically or explicitly ValueHasSavedDoc )
const ValueFlagsN ValueFlags = 4
ValueFlagsN is the highest valid value for type ValueFlags, plus one.
func ValueFlagsValues ¶
func ValueFlagsValues() []ValueFlags
ValueFlagsValues returns all possible values for the type ValueFlags.
func (ValueFlags) BitIndexString ¶
func (i ValueFlags) BitIndexString() string
BitIndexString returns the string representation of this ValueFlags value if it is a bit index value (typically an enum constant), and not an actual bit flag value.
func (ValueFlags) Desc ¶
func (i ValueFlags) Desc() string
Desc returns the description of the ValueFlags value.
func (ValueFlags) HasFlag ¶
func (i ValueFlags) HasFlag(f enums.BitFlag) bool
HasFlag returns whether these bit flags have the given bit flag set.
func (ValueFlags) Int64 ¶
func (i ValueFlags) Int64() int64
Int64 returns the ValueFlags value as an int64.
func (ValueFlags) IsValid ¶
func (i ValueFlags) IsValid() bool
IsValid returns whether the value is a valid option for type ValueFlags.
func (ValueFlags) MarshalText ¶
func (i ValueFlags) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface.
func (*ValueFlags) SetFlag ¶
func (i *ValueFlags) SetFlag(on bool, f ...enums.BitFlag)
SetFlag sets the value of the given flags in these flags to the given value.
func (*ValueFlags) SetInt64 ¶
func (i *ValueFlags) SetInt64(in int64)
SetInt64 sets the ValueFlags value from an int64.
func (*ValueFlags) SetString ¶
func (i *ValueFlags) SetString(s string) error
SetString sets the ValueFlags value from its string representation, and returns an error if the string is invalid.
func (*ValueFlags) SetStringOr ¶
func (i *ValueFlags) SetStringOr(s string) error
SetStringOr sets the ValueFlags value from its string representation while preserving any bit flags already set, and returns an error if the string is invalid.
func (ValueFlags) String ¶
func (i ValueFlags) String() string
String returns the string representation of this ValueFlags value.
func (*ValueFlags) UnmarshalText ¶
func (i *ValueFlags) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (ValueFlags) Values ¶
func (i ValueFlags) Values() []enums.Enum
Values returns all possible values for the type ValueFlags.
type ValueFunc ¶
type ValueFunc func() Value
ValueFunc is a function that returns a new initialized Value of an appropriate type as registered in the ValueMap
type Valuer ¶
type Valuer interface {
Value() Value
}
Valuer interface supplies the appropriate type of Value -- called on a given receiver item if defined for that receiver type (tries both pointer and non-pointer receivers) -- can use this for custom types to provide alternative custom interfaces -- must call Init on Value before returning it
type VersCtrlName ¶
type VersCtrlName string
VersCtrlName is the name of a version control system
func VersCtrlNameProper ¶
func VersCtrlNameProper(vc string) VersCtrlName
func (VersCtrlName) Value ¶
func (kn VersCtrlName) Value() Value
Value registers VersCtrlValue as the viewer of VersCtrlName
type VersCtrlValue ¶
type VersCtrlValue struct {
ValueBase
}
VersCtrlValue presents an action for displaying an VersCtrlName and selecting from StringPopup
func (*VersCtrlValue) ConfigWidget ¶
func (vv *VersCtrlValue) ConfigWidget(w gi.Widget, sc *gi.Scene)
func (*VersCtrlValue) HasDialog ¶
func (vv *VersCtrlValue) HasDialog() bool
func (*VersCtrlValue) OpenDialog ¶
func (vv *VersCtrlValue) OpenDialog(ctx gi.Widget, fun func(dlg *gi.Dialog))
func (*VersCtrlValue) UpdateWidget ¶
func (vv *VersCtrlValue) UpdateWidget()
func (*VersCtrlValue) WidgetType ¶
func (vv *VersCtrlValue) WidgetType() *gti.Type
type ViewIFace ¶
type ViewIFace struct { }
giv.ViewIFace is THE implementation of the gi.ViewIFace interface
func (*ViewIFace) CtxtMenuView ¶
func (*ViewIFace) GoGiEditor ¶
func (vi *ViewIFace) GoGiEditor(obj ki.Ki)
func (*ViewIFace) HiStyleInit ¶
func (vi *ViewIFace) HiStyleInit()
func (*ViewIFace) HiStylesView ¶
func (*ViewIFace) KeyMapsView ¶
func (*ViewIFace) PrefsDbgView ¶
func (vi *ViewIFace) PrefsDbgView(prefs *gi.PrefsDebug)
func (*ViewIFace) PrefsDetApply ¶
func (vi *ViewIFace) PrefsDetApply(pf *gi.PrefsDetailed)
func (*ViewIFace) PrefsDetDefaults ¶
func (vi *ViewIFace) PrefsDetDefaults(pf *gi.PrefsDetailed)
func (*ViewIFace) PrefsDetView ¶
func (vi *ViewIFace) PrefsDetView(prefs *gi.PrefsDetailed)
func (*ViewIFace) PrefsView ¶
func (vi *ViewIFace) PrefsView(prefs *gi.Preferences)
func (*ViewIFace) SetHiStyleDefault ¶
func (vi *ViewIFace) SetHiStyleDefault(hsty gi.HiStyleName)
Source Files ¶
- argview.go
- colormap.go
- colorview.go
- doc.go
- enumgen.go
- fileview.go
- funcbutton.go
- gieditor.go
- gtigen.go
- histyleview.go
- keychordview.go
- keymapsview.go
- mapview.go
- mapviewinline.go
- methodview_old.go
- prefsview.go
- sliceview.go
- sliceviewinline.go
- structview.go
- structviewinline.go
- svgeditor.go
- tableview.go
- timeview.go
- treesync.go
- treeview.go
- value.go
- values.go
- vcslogview.go