Any suggestions for a custom button?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
mokogobo
Posts: 37
Joined: Wed Jun 18, 2008 6:27 pm
Contact:

Any suggestions for a custom button?

Post by mokogobo » Thu Jun 19, 2008 6:25 pm

I'm working on a project that needs to have "buttons" that are basically images stored on the hard-drive. Sometimes, a button will need to be "highlighted" with a thick colored outline.

Right now, I've built my own button with a few Rectangle objects and an Image Area object, and grouped them. I've got the buttons stored on a separate card, and when I need some of them, I copy to a temporary card, rename the group, and adjust any properties that I need to, then copy it to the card where it is needed. This works, but it feels a bit clunky.

I'm new to RunRev, so am curious if anyone more experienced has any suggestions. I'm open to as many ideas as you can toss at me, but ideally, I'm looking for the "best" solution.

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Thu Jun 19, 2008 7:16 pm

You could make your life a little easier, I think, by using a regular button, but setting its style to 'transparent' and setting the different icon properties (icon, hilitedIcon, hoverIcon,...) to the IDs of several images that take care of the look&feel.
An interesting option here, is to use the 'export snapshot' command to create an image out of your group:

Code: Select all

export snapshot from group "MyGroup" to image "MyImage" as PNG
Hope this gets you started,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

mokogobo
Posts: 37
Joined: Wed Jun 18, 2008 6:27 pm
Contact:

Post by mokogobo » Thu Jun 19, 2008 8:06 pm

Interesting... thanks. :-)

Nonsanity
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 86
Joined: Thu May 17, 2007 9:15 pm
Contact:

Post by Nonsanity » Fri Jun 20, 2008 1:34 am

If it's just a matter of an image with a solid or patterned border, Revolution has settings you can give an image object to make borders of almost any thickness, color, or texture... On the fly.
~ Nonsanity
~ Chris Innanen

Post Reply