Documentation
¶
Index ¶
- func CollectionClassList() []string
- func ContainerClassList() []string
- func ContainerOf(obj granio.CanvasObject, c Context) granio.CanvasObject
- func CreateNew(name string, d Context) granio.CanvasObject
- func DecodeMap(m map[string]interface{}, d Context) (granio.CanvasObject, error)
- func DecodeObject(r io.Reader, d Context) (granio.CanvasObject, error)
- func DropZonesForObject(o granio.CanvasObject) []granio.CanvasObject
- func EditorFor(o granio.CanvasObject, d Context, refresh func([]*widget.FormItem), ...) []*widget.FormItem
- func EncodeMap(obj granio.CanvasObject, d Context) (interface{}, error)
- func EncodeObject(obj granio.CanvasObject, d Context, w io.Writer) error
- func ExportGo(obj granio.CanvasObject, d Context, name string, w io.Writer) error
- func ExportGoPreview(obj granio.CanvasObject, d Context, w io.Writer) error
- func GoStringFor(o granio.CanvasObject, d Context, defs map[string]string) string
- func GraphicsClassList() []string
- func NameOf(o granio.CanvasObject) string
- func RegisterCollection(info WidgetInfo)
- func RegisterContainer(info WidgetInfo)
- func RegisterWidget(info WidgetInfo)
- func WidgetClassList() []string
- type Context
- type WidgetInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectionClassList ¶
func CollectionClassList() []string
CollectionClassList returns the list of supported collection widget classes. These can be used for passing to `CreateNew` or `EditorFor`.
func ContainerClassList ¶
func ContainerClassList() []string
ContainerClassList returns the list of supported container classes. These can be used for passing to `CreateNew` or `EditorFor`.
func ContainerOf ¶
func ContainerOf(obj granio.CanvasObject, c Context) granio.CanvasObject
ContainerOf returns the parent of the given CanvasObject, in the specified Context. The returned object will be in the tree descended from `c.Root()`, or nil.
func CreateNew ¶
func CreateNew(name string, d Context) granio.CanvasObject
CreateNew returns a new instance of the given widget type
func DecodeMap ¶
func DecodeMap(m map[string]interface{}, d Context) (granio.CanvasObject, error)
DecodeMap returns a tree of `CanvasObject` elements from the provided JSON map and updates the metadata map to include any additional information.
func DecodeObject ¶
DecodeObject returns a tree of `CanvasObject` elements from the provided JSON `Reader` and updates the metadata map to include any additional information.
func DropZonesForObject ¶
func DropZonesForObject(o granio.CanvasObject) []granio.CanvasObject
DropZonesForObject returns the children of a container that can be used as drag and drop target zones
func EditorFor ¶
func EditorFor(o granio.CanvasObject, d Context, refresh func([]*widget.FormItem), onchanged func()) []*widget.FormItem
EditorFor returns an array of FormItems for editing, taking the widget, properties, callback to refresh the form items, and an optional callback that fires after changes to the widget.
func EncodeMap ¶
func EncodeMap(obj granio.CanvasObject, d Context) (interface{}, error)
EncodeMap returns a JSON map for the tree of `CanvasObject` elements provided, using additional metadata if required. If an error occurs it will be returned, otherwise nil.
func EncodeObject ¶
EncodeObject writes a JSON stream for the tree of `CanvasObject` elements provided. If an error occurs it will be returned, otherwise nil.
func ExportGo ¶
ExportGo generates a full Go package for the given object and writes it to the provided file handle
func ExportGoPreview ¶
ExportGoPreview generates a preview version of the Go code with a `main()` method for the given object and writes it to the file handle
func GoStringFor ¶
GoStringFor generates the Go code for the given widget
func GraphicsClassList ¶
func GraphicsClassList() []string
GraphicsClassList returns the list of supported graphics primitives classes. These can be used for passing to `CreateNew` or `EditorFor`.
func RegisterCollection ¶
func RegisterCollection(info WidgetInfo)
RegisterCollection allows a 3rd party collection widget to be added to those recognised. It is important that the Name field is populated with the typed name (i.e. *myPkg.MyWidget) and your package should be returned in the list from Packages() as well.
func RegisterContainer ¶
func RegisterContainer(info WidgetInfo)
RegisterContainer allows a 3rd party container widget to be added to those recognised. It is important that the Name field is populated with the typed name (i.e. *myPkg.MyWidget) and your package should be returned in the list from Packages() as well.
func RegisterWidget ¶
func RegisterWidget(info WidgetInfo)
RegisterWidget allows a 3rd party Fyne widget to be added to those recognised. It is important that the Name field is populated with the typed name (i.e. *myPkg.MyWidget) and your package should be returned in the list from Packages() as well.
func WidgetClassList ¶
func WidgetClassList() []string
WidgetClassList returns the list of supported widget classes. These can be used for passing to `CreateNew` or `EditorFor`.
Types ¶
type Context ¶
Context defines a graphical builder context that contains metadata and theme information.
func DefaultContext ¶
func DefaultContext() Context
DefaultContext returns a simple context with an empty metadata map that will defer to the default theme for theming information.
type WidgetInfo ¶
type WidgetInfo = guidefs.WidgetInfo
WidgetInfo contains the name and corresponding functions for the widget type