Scripting the creation of a button

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
rpanbwl
Posts: 5
Joined: Sun Oct 25, 2015 3:00 pm

Scripting the creation of a button

Post by rpanbwl » Tue Nov 10, 2015 10:40 pm

I figured out how to create a button with the create button command, but how do I create a specific type of button like a popup menu?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Scripting the creation of a button

Post by FourthWorld » Tue Nov 10, 2015 10:48 pm

See the style and menuMode properties in the Dictionary.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Scripting the creation of a button

Post by Klaus » Wed Nov 11, 2015 12:02 am

Yep, and "templatebutton"! :D

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

Re: Scripting the creation of a button

Post by dunbarx » Mon Nov 16, 2015 8:43 pm

Hi.

What Richard and Klaus said.

But there are several properties distinguishing each button style, (and that is apart from the layer, name, etc., which are different as a matter of course, not as a matter of, er, style) when they are created, so it may be tedious to manage these. And there is only one templateButton, though you might use it as best you can.

So I suggest making a button for each of the styles you intend, and hiding them. Then when you want a new one of whatever type, simply clone one from stock. You still have to manage the name, etc.

Craig Newman

Post Reply