ScriptSpot

Forum topic · General Scripting

help---dynamic label update

By oncire · 2013-09-17

Description

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 (2)

Hi ...you can use this

Budi G · 2013-09-17

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 · 2013-09-17

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