Formatting and Fields
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Formatting and Fields
Is it possible within LiveCode to have different formatting for text within a field? I don't currently see any way of doing so and thus am led to believe that you can't, though equally it seems like a basic thing to be able to set one line of text to be bold and then the next to be italic, or some such.
Otherwise I'm going to have to create multiple fields and find some way to make one line up with another just to have multiple formats, and that's about ten times as much work as it seems like it should be.
Otherwise I'm going to have to create multiple fields and find some way to make one line up with another just to have multiple formats, and that's about ten times as much work as it seems like it should be.
Re: Formatting and Fields
Hi,
look up "textstyle" in the dictionary.
Also here is a link to a sample stack with formatting options introduce in LC 5.5
http://forums.livecode.com/viewtopic.php?f=7&t=11686
it is an attachement to the second post.
If you have more specific questions feel free to ask
Kind regards
Bernd
look up "textstyle" in the dictionary.
Also here is a link to a sample stack with formatting options introduce in LC 5.5
http://forums.livecode.com/viewtopic.php?f=7&t=11686
it is an attachement to the second post.
If you have more specific questions feel free to ask
Kind regards
Bernd
Re: Formatting and Fields
Hi,
the dictionary has entries for "bold" and also "italic" with examples like:
...
set the textStyle of button "Label" to bold
...
So please dare to always use the dictionary first, it is really better than its reputation!
Best
Klaus
the dictionary has entries for "bold" and also "italic" with examples like:
...
set the textStyle of button "Label" to bold
...
So please dare to always use the dictionary first, it is really better than its reputation!

Best
Klaus
Re: Formatting and Fields
Take five minutes. Trust me.
On a new card, make a button and a field. In the field, place three visible short lines of text. Anything will do. In the button script:
LiveCode can do anything you can think of.
Craig Newman
On a new card, make a button and a field. In the field, place three visible short lines of text. Anything will do. In the button script:
Code: Select all
on mouseUp
repeat 10
set the textStyle of line random(3) of fld 1 to any item of "bold,plain,italic"
wait 10
set the textSize of line random(3) of fld 1 to any item of "9,12,18"
wait 10
set the textColor of line random(3) of fld 1 to any item of "red,orange,blue"
wait 10
end repeat
end mouseUp
Craig Newman
Re: Formatting and Fields
I can think of ending terrorism and world poverty. It can't do that on windows. Can we have feature parity please? 

Re: Formatting and Fields
Hi Sparkout,
it guess you meant:
Kind regards
Bernd
you should use a different spelling checker:I can think of ending terrorism and world poverty
it guess you meant:
That can be done on any platform, even operas...I can think of ending tenorism and word poverty
Kind regards
Bernd
Re: Formatting and Fields
If all terrorists spent their time making fun stacks instead of contemplating murder, then LC would have solved that problem.
The poverty thing is dicier.
Craig
The poverty thing is dicier.
Craig
Re: Formatting and Fields
Thanks for the help, guys, but I'm getting a "can't find" error "near 'Terrorists'":
on SolveWorld
put 0 into Poverty
put 0 into Terrorists
end SolveWorld
Somehow I don't think we can solve this one from here. Maybe with a missile Array?
on SolveWorld
put 0 into Poverty
put 0 into Terrorists
end SolveWorld
Somehow I don't think we can solve this one from here. Maybe with a missile Array?
Re: Formatting and Fields
I don't get a compile-time error with your handler, but it doesn't seem to do anything. Maybe the variables are weakly typed?
Craig
Craig
Re: Formatting and Fields
Maybe we should make them custom properties
Code: Select all
on solveWorld
set the uPoverty of this planet to false
set the uTerrorism of this planet to false
end solveWorld