Storing Images for use by Custom Controls

Simon Knight smk at anvic.net
Wed Jul 25 08:05:59 CEST 2018


Hi Scott,

Thank you for your replies.  I apologise for my question, I should have been clearer.  However, I have copied your response to my “hints and tips” document for reference in the future as it seems like a useful workflow to know.

To clarify my question; I have created a simple custom control that uses two list fields and some buttons.  I will probably want to use the control in the future so I am seeking a method of saving the control ready to be used in the future.  At the moment the png images, I use to "skin" the buttons, are stored on a card on a sub-stack named assets.  I do this because I am following some advice that Trevor Devore gave in a video some years ago and I know no better.  

The problem with this storage solution is that my custom control has components stored in different locations and they may well become separated sometime in the future.
Initially, I searched the Livecode forum and found a thread where the prospect of better encapsulation of custom controls was discussed and Mark W. wrote that he was thinking  about it.  This was a few years ago when version 6 was current and I wondered if any features have been added to Livecode to enable fully encapsulated custom controls to be written.  I realise that one answer might be “write a widget” but I don’t really want to take time learning a new language and process in an attempt to recreate a control that I already have.

I had not thought of using a customProp to store images and in truth I did not know it was an option so I will do some research and see what I can learn.

Thanks again and best wishes

Simon
> On 24 Jul 2018, at 23:36, scott--- via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Hello Simon,
> I see I probably misunderstood what you were trying to do. With a custom control I might be tempted to store the images in a customProp if I wanted multiple resolutions to travel with the group object. Then do something like setting the imageData of the image.
>> Scott
> 
> Elementary Software
> (Now with 20% less chalk dust!)
> web       http://elementarysoftware.com/
> email     scott at elementarysoftware.com
> booth     1-800-615-0867
> 
>> On Jul 24, 2018, at 8:44 AM, Simon Knight via use-livecode <use-livecode at lists.runrev.com> wrote:
>> 
>> Is there an elegant method of storing images for use by a custom control?  I have tried adding the images to the custom control group but the buttons in copies of the first group refer back to the first group so there is no advantage when compared to storing the images on a card or in a folder.
>> 
>> best wishes
>> 
>> Simon K.
>> _______________________________________________
>> 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
> 
> 
> _______________________________________________
> 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