Label Field - Can I get it to name it's self?

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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
tlottrike
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 11
Joined: Mon Oct 31, 2011 3:46 pm
Location: Edinburgh, Scotland
Contact:

Label Field - Can I get it to name it's self?

Post by tlottrike » Tue Dec 18, 2018 4:43 pm

"Label Field"
I have had a look through the Dictionary and the User Guide and I have found very little that describes what it does and how you can use it.

Is it possible to get a Text Field to display a Label of it's self via the Property Inspector or is this what the "Label Field" tool is for?

I have tried adding this Script to the Label Field but while it doesn't create an error it isn't doing what I want :)

Code: Select all

On cardopen
   Get name of Tooltip of field "BuildingDescription"
   Put name into Content of Me
end cardopen
IMac MacOSX 10.13
Livecode 9.0.0 Build 15103

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5991
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Label Field - Can I get it to name it's self?

Post by dunbarx » Tue Dec 18, 2018 4:53 pm

Hi.

A couple of things.

The tooltip has nothing to do with your question. Hold this off for a while.
Line 2 of your code snippet has problems. It isn't even wrong. :D

(Anyone know where that adorable sentence came from?)

Now then, a label field is just a field with certain properties. It is convenient in that it is set up to be a transparent "label". Its contents (not its name) is what will be read by the user. So you would:

Code: Select all

put "myLabel" into field "myLabelField"
You can use any field to do the same sort of thing, and manipulate its properties to suit you. The label field just gives you a head start on a common theme.

Experiment. See what sort of object properties you find suitable.

Craig Newman

tlottrike
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 11
Joined: Mon Oct 31, 2011 3:46 pm
Location: Edinburgh, Scotland
Contact:

Re: Label Field - Can I get it to name it's self?

Post by tlottrike » Tue Dec 18, 2018 5:51 pm

Cheers Craig I will have a good old rummage and fiddle about.

:)
IMac MacOSX 10.13
Livecode 9.0.0 Build 15103

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5991
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Label Field - Can I get it to name it's self?

Post by dunbarx » Tue Dec 18, 2018 6:43 pm

Do fiddle.

And use "openCard" instead of "cardOpen". 8)

Craig

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 323
Joined: Mon Jun 10, 2013 1:32 pm

Re: Label Field - Can I get it to name it's self?

Post by Lagi Pittas » Thu Dec 20, 2018 12:52 pm

HI Craig,

So you are into QED and QM as well? - Wolfgang Pauli is the answer - brilliant retort.

I would just say "that's Cr*p" because time's too short waiting for the penny to drop - I just save time and use 2 words instead of 4.
Men of few words are the best men - William Shakespeare
and who am I too argue?

:lol: :wink:

Lagi

Edit:

The last bit has nothing to do with the code above by the way - It's to do when someone is spouting Tosh - no offence meant - just my crass humour (?)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3236
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Label Field - Can I get it to name it's self?

Post by richmond62 » Thu Dec 20, 2018 2:09 pm

Here's Richmond's simplistic take on things:

Code: Select all

on openCard
   put 1003 into PAYSAGE
   repeat until PAYSAGE > 1009
      put the short name of fld id PAYSAGE into fld id PAYSAGE
      add 1 to PAYSAGE
   end repeat
end openCard
-
autonamer.png
Attachments
autonamer.livecode.zip
Here's the stack.
(926 Bytes) Downloaded 10 times

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5991
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Label Field - Can I get it to name it's self?

Post by dunbarx » Thu Dec 20, 2018 2:47 pm

Lagi.

You omitted QCD.

Craig

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”