Widgets' Use Cases and Bytes Added to App
Richard Gaskin
ambassador at fourthworld.com
Tue Apr 5 10:39:28 EDT 2016
Paul Dupuis wrote:
> On 4/5/2016 6:12 AM, Peter TB Brett wrote:
>>> Frequently we use small groups to instantiate "objects" which are
>>> made of of several controls grouped together. These are then
>>> replicated across some card for whatever purpose. I think that is the
>>> underlying model for the DataGrid.
>>>
>>> Would such a small group be better created as a widget?
>>
>> Unfortunately we don't _quite_ have the engine features required to
>> wrap a set of "classic" controls into a widget. :-/
>
> I'd like to put in a plug that being able to do exactly that (make a
> widget that is a group of classic controls, plus scripts) would be a
> feature I'd very much like to see. I really don't expect to use
> widgets for creating custom buttons (or whatever), but we use groups
> of controls everywhere in our application and making a number of them
> in to widgets that can easily be added to a new window would
> definitely accelerate development.
Widgets have great packaging, and for controls like the ones they're
currently used for it's a nice way to handle things, able to mix OS
calls with lower-level drawing routines to render GUI elements in ways
that are well worth the effort to learn LCB.
But traditional custom controls have a place too, and the LiveCode
Script they rely continues to be enhanced even as LCB is expanded along
with it.
The additional object overhead of custom controls isn't that much higher
than Widgets, and with behaviors can be close to zero depending on the
complexity of the control.
With the group message, behaviors, before and after handlers, getProp
and setProp, and other such goodies, I can't think of a project I've
worked on in recent years that hasn't made extensive use of custom controls.
In fact, many that I need are one-offs needed only for a specific
project. They're easy enough to write on LC Script that it takes almost
no time at all, and keeps the code and property management well
centralized for easy development and maintenance.
I can see writing Widgets for things I'll use across multiple projects,
but as Kevin noted here a while back LC Script is the fastest way to
develop, with LC Builder being the _much_ faster-to-code alternative to
writing in C.
So if you have stuff that can be done in LC Script, go for it. Fast to
develop, performant to run, and will continue working well even as LC
Builder continues to expand to handle other things.
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list