help---dynamic label update

hi... im new to scripting... how to dynamically update the "label" while selecting edges in Editable poly--- the idea is i want to update the label to the "number of edges selected"... ive started a script already but i dont know how to write the code to dynamically update it... i think its a callback thing... thanks in advance....
this is the script..

rollout test "test"
(
label label1 "test label"
fn labelcallback =
(
label1.text = ($.selectedEdges.count as string) + " edges selected"
)

on test open do labelcallback()
)
createDialog test

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Budi G's picture

Hi ...you can use this

Hi ....

you can use this function:

registerRedrawViewsCallback <fn>
-- and
unRegisterRedrawViewsCallback <fn>

such as :

rollout test "test"
(
label label1 "test label"
fn labelcallback =
(
label1.text = ($.selectedEdges.count as string) + " edges selected"
)
 
on test open do registerRedrawViewsCallback labelcallback
on test close do unRegisterRedrawViewsCallback labelcallback
)
createDialog test
oncire's picture

hi budi G... thanks for the

hi budi G... thanks for the reply... i tested it and it works:).. thank you so much for the code now i can i finish my script...

thanks again

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.