widget

Typeobject
DictionaryLCS
LibraryLiveCode Script
Syntax
widget
Summary

A custom control written in LiveCode Builder

Introduced8.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Example
set the visible of widget 1 to false
on newWidget
    if the kind of the target is "com.livecode.widget.colorswatch" then
        set the swatchColor of the target to "0,0,0,255"
    end if 
end newWidget
RelatedCommand: load extension
Glossary: object type, LiveCode Builder extension, command
Keyword: control
Description

Use the widget object type to create a widget control. Widgets are created from LiveCode Builder extensions that have previously been loaded into memory using the load extension command. For more details on how to create widgets, please consult the Extending Livecode guide.

Tagsobjects,extensions
TypeNameSummarySyntax
commandcreate widget

Create a widget control of the specified kind.

create [invisible] widget [<controlName>] as <widgetKind> [in {<group>|<card>}]

messagedeleteWidget

Sent to a widget just before it is removed from the stack.

deleteWidget

- - -newWidget

Sent to a new widget right after it's created.

newWidget

propertybehavior

Allows an object to inherit its script handlers from another object.

set the behavior of <object> to {<button> | <stack>}

- - -container

This property defines how the layout of a control behaves with respect to its owner.

set the container[propertyName] of object to propertyValue

get the container[propertyName] of object

- - -container expanded

Expands the control so that it fills the available space.

set the container["type"] of object to "expanded"

- - -container flexible

Expands the control so that it fills the available space.

set the container["type"] of object to "expanded"

- - -cursorHover

Specifies the mouse cursor to be displayed when pointing over a control.

get the cursorHover of object

set the cursorHover of object to {cursorName | imageID}

- - -flex

The flex factor to use for the control.

get the flex of object

set the flex of object to {<integer>}

- - -kind

The unique identifier of a widget type.

get the kind of <widget>

- - -layoutBreakpoints

Gets the list of layout breakpoints that the object has.

get the layoutBreakpoints of object

- - -layoutMargins

Sets the margin for all four sides of a control.

get the layoutMargins of object

set the layoutMargins of object to {pixels | horizontal, vertical |left, top, right, bottom}

- - -order

The order that has a control within its owner.

get the order of object

set the order of object to {<integer>}

- - -position

Sets how the object is positioned within its owner.

get the position[propertyName] of object

set the position[propertyName] of object to propertyValue

- - -position align

Aligns the control within its owner.

set the position["type"] of object to "align"

- - -position center

Centers the object with respect to its owner.

set the position["type"] of object to "center"

- - -position fixed

Sets the position of one or more sides of a control with respect to its owner.

set the position["type"] of object to "fixed"