How do I set the textStyle from a button?

Sarah Reichelt sarahr at genesearch.com.au
Mon Dec 17 20:35:01 EST 2001


I think Geoff's idea about the mouseDown is the right way to go, but this
business of a button click changing the focus has further ramifications.

I have a stack that interacts almost completely through a barcode reader. I
get the input from the barcode reader by keyDown & rawKeyDown handlers in
the stack script. I discovered (the hard way) that if the user clicks on a
button, any further input from the reader does not get to the keyDown or
rawKeyDown handlers. Presumably it gets trapped by the button even though no
other keyDown/rawKeyDown handlers exist.

To get around this, at the end of every mouseUp handler, I use
    "click at 0,0"
This gives the focus back to the stack and the barcodes get read in as
usual.

Cheers,
Sarah

> Every time I try from a button:
> 
> on mouseUp
> set the textStyle of the SelectedChunk to bold
> end mouseUp
> 
> it doesn't work. It turns out that when the button is pressed, the focus
> leaves the field and the selectedChunk is now empty.
> 
> I know this should be easy...
> 
> thanks,
> 
> Chipp
> 
> ----------------------------
> |    ___   ____       _ __   |
> |   / _ | / / /___ __(_) /_  |
> |  / __ |/ / __/ // / / __/  |
> | /_/ |_/_/\__/\_,_/_/\__/   |
> |   http://www.altuit.com    |
> |      chipp at altuit.com      |
> ----------------------------
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 




More information about the use-livecode mailing list