295 png import images

Phil Davis revdev at pdslabs.net
Wed Oct 12 11:26:39 EDT 2011


Ahh! Very clever! It seems this old dog is still learning new tricks.  ;-)

Phil


On 10/12/11 2:23 AM, Jan Schenkel wrote:
> Hi Phil,
>
> The trick is to use an image, set the icon of the button to the id of said image, and then change the filename of the image; your button will automagically be repainted when you change the filename of the image control.
>
> As a quick test, I created a stack with a button and an image; I named the image control "MyButtonIcon"; and then I set the script of the button to:
> ##
> on mouseUp
>     answer file "Select an image for my icon"
>     if it is empty then exit mouseUp
>     set the fileName of image "MyButtonIcon" to it
>     if the icon of me is 0 then set the icon of me to "MyButtonIcon"
> end mouseUp
> ##
>
> When I click the button, I can go find an image file and the button gets it as a shiny new icon :-)
>
>
> HTH,
>
> Jan.
>
> Jan Schenkel
>
> =====
> Quartam Reports&  PDF Library for LiveCode
> www.quartam.com
>
>
> =====
> "As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)
>
>
>
>
> ----- Original Message -----
> From: Phil Davis<revdev at pdslabs.net>
> To: How to use LiveCode<use-livecode at lists.runrev.com>
> Cc:
> Sent: Wednesday, October 12, 2011 8:06 AM
> Subject: Re: 295 png import images
>
> It didn't work here - 'filename' isn't a button property, and setting the icon
> to a url doesn't work either. However, you can make an image object act pretty
> much like a button, responding to mouse clicks and such.
>
> Phil
>
> _______________________________________________
> 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
>

-- 
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net





More information about the use-livecode mailing list