Help us shape the future of Go! Take the 2026 Go Developer Survey

refyne

package module
v0.0.8-0...-c66cdce Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: BSD-3-Clause Imports: 22 Imported by: 0

README

granio-ui

Компонент независимого проекта Granio — Гранио.

Исходный репозиторий: refyne. Цель форка: Сериализация и чтение описаний интерфейса Granio.

История изменений, лицензии и сведения об исходных авторах сохранены. Go-модули переведены на собственные пути github.com/Uzer007-admin/…; минимальная версия Go — 1.27.1. Ядро и общие API подключаются из granio/v2.

Состояние переноса и результаты проверок приведены в реестре экосистемы. Наличие форка само по себе не означает проверку всех платформ и сценариев.


Документация исходного проекта

Команды установки и ссылки в сохранённом тексте ниже относятся к исходнику. Для Granio используются новые пути модулей, перечисленные выше.

ReFyne

This repo contains a library for working with Fyne user interface serialisation.

Documentation

Index

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

func DecodeObject(r io.Reader, d Context) (granio.CanvasObject, error)

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

func EncodeObject(obj granio.CanvasObject, d Context, w io.Writer) error

EncodeObject writes a JSON stream for the tree of `CanvasObject` elements provided. If an error occurs it will be returned, otherwise nil.

func ExportGo

func ExportGo(obj granio.CanvasObject, d Context, name string, w io.Writer) error

ExportGo generates a full Go package for the given object and writes it to the provided file handle

func ExportGoPreview

func ExportGoPreview(obj granio.CanvasObject, d Context, w io.Writer) error

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

func GoStringFor(o granio.CanvasObject, d Context, defs map[string]string) string

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 NameOf

func NameOf(o granio.CanvasObject) string

NameOf returns the name for a given object

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

type Context = guidefs.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

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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