clickText and other clicks
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
clickText and other clicks
I have a field in which a paragraph is displayed. I want to be able to get the clickText when a particular word is clicked. Clicking on a word in the field returns nothing. Neither does clickChunk or clickLine work. I now have the following settings for the field: Visible, Share text. Lock text, Opaque, Focus border, though I have tried a number of other combos of settings for this field without success. I have another field that is a list, and with the List behaviour set, that field works perfectly so LiveCode is receiving some signal that I have clicked the mouse.
The attached image shows the field. The word in bold at the top is a separate field as is the icon in the top right of the box. The field that I am having problems with is the field below that, which displays the definition. The words in blue indicate that the word is in the dictionary. I want the user to be able to click on such words and have the dictionary open to that word with its explanation. That can be done quite simply if I can get the field to return the clickText.
The attached image shows the field. The word in bold at the top is a separate field as is the icon in the top right of the box. The field that I am having problems with is the field below that, which displays the definition. The words in blue indicate that the word is in the dictionary. I want the user to be able to click on such words and have the dictionary open to that word with its explanation. That can be done quite simply if I can get the field to return the clickText.
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: clickText and other clicks
Hi,
Strange.
Clicktext works fine here (OSX 10.14.6, LC 9.6.6)
What version do you use ?
Best regards
Jean-Marc
Strange.
Clicktext works fine here (OSX 10.14.6, LC 9.6.6)
What version do you use ?
Best regards
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 9785
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: clickText and other clicks
I have never had a similar problem. How do you invoke the clickText function?
I assume it is a handler in the field script, and looks something like this:
I bet the issue is something along those lines...
Craig
I assume it is a handler in the field script, and looks something like this:
Code: Select all
on mouseUp
answer the clickText
end mouseUp
Craig
Re: clickText and other clicks
Same result here - as long as the field has it's lockText set to true, clickText returns the clicked word...
Re: clickText and other clicks
Thanks for these suggestions.
Here is the starting script for the mouseUp. Nothing happens. It is the same way I call for click features in another field provides the clicked data requested. As I said in my introduction, I have been away from LiveCode for about 18 years, so a simple solution is likely. Thanks for taking time to help me sort out what should be obvious to me. The lockText of the field is set to true.
on mouseUp
put the clicktext into ct
put the clickline into cl
put the clickchunk into cc
Here is the starting script for the mouseUp. Nothing happens. It is the same way I call for click features in another field provides the clicked data requested. As I said in my introduction, I have been away from LiveCode for about 18 years, so a simple solution is likely. Thanks for taking time to help me sort out what should be obvious to me. The lockText of the field is set to true.
on mouseUp
put the clicktext into ct
put the clickline into cl
put the clickchunk into cc
Re: clickText and other clicks
I should point out that I am using version 10 . 0 . 0-dp-3 | Build 20002
-
- VIP Livecode Opensource Backer
- Posts: 9785
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: clickText and other clicks
Hi.
So you are saying that you have another locked field and all those functions work? Good.
Try making brand new field from scratch and see if that one works for you. I cannot imagine that your original field is "corrupted" in some way, but if this is a path forward, then as I alway say, "I am happy to solve a problem without ever understanding how".
If that does indeed work, it is up to you to find out why. You might compare the results of "the properties" of each field. This will come back as an array, so you will need to "combine" that data with, say, a return and a comma in order to see the output. Likely an academic exercise, but might be instructive.
Craig
So you are saying that you have another locked field and all those functions work? Good.
Try making brand new field from scratch and see if that one works for you. I cannot imagine that your original field is "corrupted" in some way, but if this is a path forward, then as I alway say, "I am happy to solve a problem without ever understanding how".
If that does indeed work, it is up to you to find out why. You might compare the results of "the properties" of each field. This will come back as an array, so you will need to "combine" that data with, say, a return and a comma in order to see the output. Likely an academic exercise, but might be instructive.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9785
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: clickText and other clicks
Well, maybe there is something else going on. Have you tried this in v.9x?I should point out that I am using version 10 . 0 . 0-dp-3 | Build 20002
Craig
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: clickText and other clicks
Hi All,
Clicktext works on LC 10 . 0 . 0-dp-1 | Build 20000
Clicktext works on LC 10 . 0 . 0-dp-1 | Build 20000
https://alternatic.ch
Re: clickText and other clicks
The good news: the clickText function is now working as it should.
The bad news: I am not sure why it is now working. I did not change any of the settings for the field.
I appreciate your help and do wish I could report where the problem was.
The bad news: I am not sure why it is now working. I did not change any of the settings for the field.
I appreciate your help and do wish I could report where the problem was.
-
- VIP Livecode Opensource Backer
- Posts: 9867
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: clickText and other clicks
#ProgrammerLife
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: clickText and other clicks
More than once I’ve had a situation where there’s been a subtle error - by subtle I mean an error that has not raised any exceptions in the IDE and the developer is not notified in any way, but which halts code execution and can cause subsequent incomprehensible errors - code that should work fine doesn’t.
Not so long ago I flagged up such a situation to LC and the bug report was acknowledged and confirmed, but any kind of fix (such as notifying the dev on error) is still pending and I suspect not easy to address. I’m guessing the solution will be the conversion to the new bytecode evaluator.
In the mean time, clues to this being the cause are:
- The error is not reproducible when you extract the code in isolation to a new stack
- the error goes away on quitting and restarting the IDE (assuming the error doesn’t happen every time you run the app).
Do you think it could have been something like that?
Not so long ago I flagged up such a situation to LC and the bug report was acknowledged and confirmed, but any kind of fix (such as notifying the dev on error) is still pending and I suspect not easy to address. I’m guessing the solution will be the conversion to the new bytecode evaluator.
In the mean time, clues to this being the cause are:
- The error is not reproducible when you extract the code in isolation to a new stack
- the error goes away on quitting and restarting the IDE (assuming the error doesn’t happen every time you run the app).
Do you think it could have been something like that?