setting field positions (or sending messages in general)

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
kwinkler
Posts: 61
Joined: Fri Nov 26, 2010 5:59 am

setting field positions (or sending messages in general)

Post by kwinkler » Tue Dec 07, 2010 1:08 am

Here's another "simple" question. How do I programmatically set the position of a field? Or more generally, how do I find a list of the messages that can be sent to an object.

The LiveCode dictionary says-

To see a list of messages that can be sent to a field as a result of user actions or internal Revolution events, open the "Revolution Language Dictionary" page of the main Documentation window, ensure that the field column is visible and use sort and filter to bring the relevant entries to the top.

The field column (after I enable it in Preferences) has several checked entries, but I don't see a list of messages anywhere.

kwinkler
Posts: 61
Joined: Fri Nov 26, 2010 5:59 am

Re: setting field positions (or sending messages in general)

Post by kwinkler » Tue Dec 07, 2010 2:01 am

The short answer is that 'set the location .........to x,y' will set the location of a field.

Also, 'textAlign.......to [left, right, center]' will align the text.

But I discovered both of these by trial and error. The larger question still remains of how to uncover all of the properties that can be set for an object.

kwinkler
Posts: 61
Joined: Fri Nov 26, 2010 5:59 am

Re: setting field positions (or sending messages in general)

Post by kwinkler » Tue Dec 07, 2010 5:54 am

A longer answer is provided by the LiveCode Dictionary under 'Properties'.

The following lines will print the properties of a field into the Message Window. Not all properties are printed ('location', 'width', and 'height' are not), but it does list the rectangle properties, which are equivalent.

get the properties of field "Whatever"
combine it using return and colon -- convert from array to text list
put it

But there must be a more elegant way to view the properties that are available for any object. ???

Post Reply