PDA

View Full Version : Spinner Problem


BebeteLANUITE
01-19-2006, 02:43 PM
Hello.

I need your help.

I made a script with a spinner and a listbox.
I just want when i click on a selection in the listbox the value come in the spinner and when i change the value of the spinner the value of the selection in the listbox change too.

My code.


ListboxItems = #("1","5","14","24","26","36")
Utility listmod "List modifier"
(
label espbet " " height:3
listbox pass "Items:" items:listboxitems
spinner offset "Modify :" type:#integer
label espbet01 " " height:2

on pass selected LinkFrameNo do
(
offset.value = listboxitems[LinkFrameNo] as integer

if offset.value != listboxitems[linkframeNo] as integer then offset.value = listboxitems[LinkFrameNo] as integer

)--end on pass

on offset changed value do
(
pass.selected LinkFrameNo = value
)--end on offset
)--end utility



There is an error in my code.
if i erase "on offset ... end on offset"
I get the value of the selected item in the spinner but when i modify the value in the spinner nothing happen in the listbox.

Do you have an idea to do it ?
Thank a lot for your help. :)

HalfVector
01-19-2006, 02:53 PM
The problem is in the spinner changed event handler. Should be like this:

on offset changed value do
(
pass.selected = value as string
)--end on offset

HalfVector.

BebeteLANUITE
01-19-2006, 03:17 PM
Hello halfvector.

Thanks a lot, it work perfectly :buttrock:

I don't understand conversion in integer or string yet. :sad:

But Halfvector is in the place to save my face !! ;)

Thanks again :applause:

CGTalk Moderation
01-19-2006, 03:17 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.