Documentation
¶
Index ¶
- Variables
- func AutomationClick(id string) error
- func AutomationSetText(id, text string) error
- func AutomationUnregisterPrefix(prefix string)
- type AutomationBounds
- type AutomationNode
- type Container
- type UIView
- func (v *UIView) AddAutomationChild(child Viewable) *UIView
- func (v *UIView) AddSubview(child Viewable)
- func (v *UIView) AutomationID() string
- func (v *UIView) AutomationName() string
- func (v *UIView) AutomationRole() string
- func (v *UIView) AutomationSnapshot() AutomationNode
- func (v *UIView) BindHost(host Container)
- func (v *UIView) BindRaw(raw fltk_bridge.Widget)
- func (v *UIView) ClearAutomationChildren() *UIView
- func (v *UIView) ObserveSuperviewChanges(observer func(Container, Container)) func()
- func (v *UIView) On(event fltk_bridge.Event, handler func(fltk_bridge.Event) bool)
- func (v *UIView) OnAutomationClick(handler func() error) *UIView
- func (v *UIView) Raw() fltk_bridge.Widget
- func (v *UIView) RemoveAutomationChild(child Viewable) *UIView
- func (v *UIView) RemoveFromSuperview()
- func (v *UIView) SetAutomationID(id string) *UIView
- func (v *UIView) SetAutomationName(name string) *UIView
- func (v *UIView) SetAutomationProperty(key, value string) *UIView
- func (v *UIView) SetAutomationRole(role string) *UIView
- func (v *UIView) SetAutomationTextHandlers(set func(string) error, get func() (string, bool)) *UIView
- func (v *UIView) SetAutomationValueHandler(get func() (string, bool)) *UIView
- func (v *UIView) Superview() Container
- func (v *UIView) View() *UIView
- type Viewable
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAutomationIDRequired is returned when an automation action is attempted without an id. ErrAutomationIDRequired = errors.New("automation id is required") // ErrAutomationNodeNotFound is returned when no registered view has the requested id. ErrAutomationNodeNotFound = errors.New("automation node not found") // ErrAutomationActionUnsupported is returned when the target view does not expose the requested action. ErrAutomationActionUnsupported = errors.New("automation action unsupported") )
Functions ¶
func AutomationClick ¶
func AutomationSetText ¶
func AutomationUnregisterPrefix ¶
func AutomationUnregisterPrefix(prefix string)
Types ¶
type AutomationBounds ¶
type AutomationBounds struct {
X int `json:"x"`
Y int `json:"y"`
Width int `json:"width"`
Height int `json:"height"`
}
AutomationBounds describes a view's current FLTK bounds.
type AutomationNode ¶
type AutomationNode struct {
ID string `json:"id,omitempty"`
Role string `json:"role,omitempty"`
Name string `json:"name,omitempty"`
Label string `json:"label,omitempty"`
Text string `json:"text,omitempty"`
Value string `json:"value,omitempty"`
Actions []string `json:"actions,omitempty"`
Enabled bool `json:"enabled"`
Visible bool `json:"visible"`
Bounds AutomationBounds `json:"bounds"`
Properties map[string]string `json:"properties,omitempty"`
Children []AutomationNode `json:"children,omitempty"`
}
AutomationNode is a serializable snapshot of a registered UIView.
func AutomationSnapshot ¶
func AutomationSnapshot() []AutomationNode
type Container ¶
type Container interface {
Add(w fltk_bridge.Widget)
Remove(w fltk_bridge.Widget)
}
Container:任何能容纳子控件的对象(Window/Group) 你 fltk_bridge.Window 继承了 Group,天然满足 Add/Remove
type UIView ¶
type UIView struct {
// contains filtered or unexported fields
}
UIView:UIKit 风格的基础 View raw:底层 FLTK widget(Box/Button/Group/Window 都是 Widget) host:父容器(Window 或 Group)
func AutomationLookup ¶
func (*UIView) AddAutomationChild ¶
func (*UIView) AddSubview ¶
AddSubview:iOS 语义。如果当前 view 本身是容器,则将 child 添加到当前 view 中; 否则,退回到将 child 添加到当前 view 的父容器中(虽然不推荐,但兼容旧逻辑)。
func (*UIView) AutomationID ¶
func (*UIView) AutomationName ¶
func (*UIView) AutomationRole ¶
func (*UIView) AutomationSnapshot ¶
func (v *UIView) AutomationSnapshot() AutomationNode
func (*UIView) BindRaw ¶
func (v *UIView) BindRaw(raw fltk_bridge.Widget)
BindRaw:框架内部使用,为 view 绑定底层 widget
func (*UIView) ClearAutomationChildren ¶
func (*UIView) ObserveSuperviewChanges ¶ added in v0.0.25
ObserveSuperviewChanges observes logical UIKit ownership changes. The returned function unregisters the observer.
func (*UIView) On ¶
func (v *UIView) On(event fltk_bridge.Event, handler func(fltk_bridge.Event) bool)
On 绑定闭包事件流
func (*UIView) OnAutomationClick ¶
func (*UIView) Raw ¶
func (v *UIView) Raw() fltk_bridge.Widget
func (*UIView) RemoveAutomationChild ¶ added in v0.0.25
RemoveAutomationChild removes one child from the semantic automation tree.
func (*UIView) RemoveFromSuperview ¶
func (v *UIView) RemoveFromSuperview()
RemoveFromSuperview removes the view's raw widget from its current host.
func (*UIView) SetAutomationID ¶
SetAutomationID assigns a stable automation id and registers the view for debug automation.