Skip to content

Commit 03321ae

Browse files
Merge pull request livecode#2345 from runrevmark/feature-impexp_widget_array
[[ WidgetImpExp ]] Added ability to import / export widget state as a…
2 parents fa7d261 + 622a8e4 commit 03321ae

File tree

10 files changed

+396
-141
lines changed

10 files changed

+396
-141
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Name: export widget
2+
3+
Type: command
4+
5+
Syntax: export <widget> to array arrayVar
6+
7+
Summary: Exports the state of the given widget in a form which can be imported
8+
using <import widget | import widget from array>.
9+
10+
Introduced: 8.0
11+
12+
OS: mac,windows,linux,ios,android
13+
14+
Platforms: desktop,web,mobile
15+
16+
Example:
17+
export widget 1 to array tMyArray
18+
19+
Parameters:
20+
widget: A chunk reference resolving to a widget object.
21+
arrayVar: The variable to place the widget's state array into.
22+
23+
Description:
24+
Use the <export widget> command to save the state of the given widget in a form
25+
which can be used to recreate the widget at a later date.
26+
27+
The returned array has two keys $kind and $state. The $kind key is the fully
28+
qualified name of the widget's extension module. The $state key is an array
29+
representing the widget as it is at that point in time. This is typically the
30+
values of all the widget's persistent properties, although its exact structure
31+
is defined by the widget.
32+
33+
>*Note:* The <export widget> command is subject to change throughout the 8.0
34+
development cycle.
35+
36+
References: import widget (command), create widget (command)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Name: import widget
2+
3+
Type: command
4+
5+
Syntax: import widget from array <arrayVar>
6+
7+
Summary: Creates a widget from the supplied state array.
8+
9+
Introduced: 8.0
10+
11+
OS: mac,windows,linux,ios,android
12+
13+
Platforms: desktop,web,modile
14+
15+
Example:
16+
import widget from array tMyArray
17+
18+
Parameters:
19+
arrayVar: A variable containing a widget state array, previously obtained using
20+
<export widget>
21+
22+
Description:
23+
Use the <import widget> command to recreate a widget previously saved using the <export> command.
24+
25+
The imported object is placed in the current stack.
26+
27+
For details of the format of the widget state array see <export widget>.
28+
29+
>*Note*: The <export widget> command is subject to change throughout the 8.0
30+
development cycle.
31+
32+
References: export widget (command), create widget (command)

0 commit comments

Comments
 (0)