Data of a Segmentet Object
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Data of a Segmentet Object
Hello everyone,
i have a simple question, which is driving me crazy. I have created a segmented object (picture is added). Now i need to get the selected segment.
Can anyone give me the line of code, get the selected segment.
Greets
Jochen
i have a simple question, which is driving me crazy. I have created a segmented object (picture is added). Now i need to get the selected segment.
Can anyone give me the line of code, get the selected segment.
Greets
Jochen
- Attachments
-
- Bildschirmfoto 2015-06-21 um 14.41.56.png (14.28 KiB) Viewed 4343 times
Re: Data of a Segmentet Object
Hi.
When you say "segmented object" do you mean a group of controls? "Segments" is not a native word, so I am interpreting here. That is, are there several images, buttons, fields and graphics that make up the whole?
If so, and I assume so, try this handler in the card script. I am not sure that you made a group at all, ("group" is indeed a LiveCode control) so I am playing it safe and going to the card:
Does clicking on various portions of your assembly produce the name of a control in the message box? Write back if you need more help.
Craig Newman
When you say "segmented object" do you mean a group of controls? "Segments" is not a native word, so I am interpreting here. That is, are there several images, buttons, fields and graphics that make up the whole?
If so, and I assume so, try this handler in the card script. I am not sure that you made a group at all, ("group" is indeed a LiveCode control) so I am playing it safe and going to the card:
Code: Select all
on mouseUp
put the target
end mouseUp
Craig Newman
Re: Data of a Segmentet Object
Hi again.
Did you import that whole thing as an image? If so, there will be no way to directly discern what portion of it you are clicking on, since there are no discrete objects making it up. But there is still a way to work around this, by determining the location within the whole where you clicked. This will require a bit of fooling around, but would be a hill of fun.
Write back...
Craig
Did you import that whole thing as an image? If so, there will be no way to directly discern what portion of it you are clicking on, since there are no discrete objects making it up. But there is still a way to work around this, by determining the location within the whole where you clicked. This will require a bit of fooling around, but would be a hill of fun.
Write back...
Craig
Re: Data of a Segmentet Object
Hallo Jochen,
you are obviously talking about LC 8 and the SEGMENT widget, right?
Please always note the version of LC you are using!
Do this:
...
put the selectedsegment of widget "your segment widget here" into tSelectedSegment
## Will put the NUMBER of the selected segment into the variable
...
BTW: Its all in the dictionary
Best
Klaus
you are obviously talking about LC 8 and the SEGMENT widget, right?
Please always note the version of LC you are using!
Do this:
...
put the selectedsegment of widget "your segment widget here" into tSelectedSegment
## Will put the NUMBER of the selected segment into the variable
...
BTW: Its all in the dictionary

Best
Klaus
Re: Data of a Segmentet Object
Hi,
i just took that control out of livecode, the picture is just a screenshot.
I've added a second picture where the control in livened is. My problem is, that i can not name the objekt
i just took that control out of livecode, the picture is just a screenshot.
I've added a second picture where the control in livened is. My problem is, that i can not name the objekt

Re: Data of a Segmentet Object
Hallo Klaus,
thank you for the help! I thought every bond works in livecode 8. Sorry, my fault.
Greets
Jochen
P.S.: Vielen lieben Dank!
thank you for the help! I thought every bond works in livecode 8. Sorry, my fault.
Greets
Jochen
P.S.: Vielen lieben Dank!
Re: Data of a Segmentet Object
Hi Jochen,
simply double-click the widget and give it a name in the inspector!
See attached screenshot...
Best
Klaus
simply double-click the widget and give it a name in the inspector!
See attached screenshot...
Best
Klaus