SuperCard Project to Rev

Klaus Major klaus at major-k.de
Fri Aug 11 05:39:08 EDT 2006


Hi John,

> Thanks Mark,
> I've decided to work thru a simple project, rather than try to  
> convert all
> my SuperCard code . This way I can take it slow and learn as I go,  
> and then
> go back and make the changes to my SuoerCard stack. I have created a
> mainstack with one field and an "Open Palette" button. I have  
> created a
> substack with three buttons. My goal is to have each button insert a
> different font into the same field. So far I can do the following:
>
> 1) Create a palette from the "Open Palette" button
> 2) Insert a character into the maincard field from the palette  
> buttons.
>
> Here's the code:
>
> on mouseUp
>    set the textfont of field "TabField" of stack "TabCard" to  
> "GuitarTab"
>    set the textsize of field "TabField" of stack "TabCard" to "48"
>    set the textfheight of field "TabField" of stack "TabCard" to "48"
>    put "R" into field "TabField" of stack "TabCard"
> end mouseUp
>
> What I can't do is insert a string of characters. Button 1 inserts a
> character, but Button 2 replaced that character, rather than adding  
> it after
> the first character.

"put xyz into fld zwe" will replace the actual content, right.

You can of course put something AFTER the field, so the content
is not overwritten!

...
    put "S" AFTER field "TabField" of stack "TabCard"
...

And of course "BEFORE".

See these terms in the docs...

> I haven't tested for multiple fonts, since I can only
> insert one character at a time. It's a start, but I need help  
> getting to my
> goal of inserting a string of characters by multiple clicks on the  
> buttons,
> and multiple fonts. I won't be mixing fonts on the same line.
>
> John

Regards

Klaus Major
klaus at major-k.de
http://www.major-k.de




More information about the use-livecode mailing list