widget properties

Brian Milby brian at milby7.com
Mon Feb 26 00:02:45 EST 2018

Looking at the source, when a stack is saved, here is the general flow for
an individual widget (widget.cpp):

OnSave called to get internal widget state (array)
Write uint1 OT_WIDGET to indicate a widget
Save the object state
Save the widget kind
Save the internal widget state
Save the property sets

Suggestion is to add the object state ($object) and property sets ($props)
to the existing export array.

Once the object state function was in place, most of the work to add other
classic controls would already be done.

The couple of OnLoad handlers that I’ve looked into seem to handle extra
data fine since it is just ignored. It gets lost on save though. This is
some of the things that came to light when vertical was added to the
segmented control. This should not have any impact to this idea.
On Sun, Feb 25, 2018 at 10:10 PM Brian Milby <brian at milby7.com> wrote:

> I’m not sure I follow.  The proposal I’m making is no different than what
> the engine does today, just allowing the same information to be saved to an
> array.  The internal state of the widget is the same as what would be used
> on export/import.  It just adds the other properties (rect, ...) to the
> array.
> I’ll need to look again, but I think that export uses OnSave to get the
> array.  Import uses OnLoad.  This would save the step of setting the other
> properties.
> On Sun, Feb 25, 2018 at 10:02 PM hh via use-livecode <
> use-livecode at lists.runrev.com> wrote:
>> > Brian M. wrote:
>> > My 0.02 is that export should mirror what the engine saves to the stack
>> > file such that import could exactly recreate an object (with some logic
>> on
>> > how to handle ID collisions - overwrite, throw error, assign new ID...)
>> If you are developing and testing a widget this would make you crazy.
>> What I want are some persistent properties from "OnSave" and "OnLoad" but
>> NOT the saved state of a probable buggy widget.
>> And if I open a stack half a year later while the widget was updated,
>> then I want, as it is currently, the new version without deleting and
>> reinstalling all widgets of that kind (think of a stack that has a lot of
>> svg-icon-widgets).
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode

More information about the Use-livecode mailing list