Progress Indicator - show only 1 Level?

Hi Folks,

is it possible to have only 1 Level showing up when using the progress indicator?

In my application I use the following code:


if con_status is "0" then
set content of control "pegel_con" of tab view item "Connection" of tab view "tab" of window "main" to 1
if con_status is "2" then
set content of control "pegel_con" of tab view item "Connection" of tab view "tab" of window "main" to 2
if con_status is "4" then
set content of control "pegel_con" of tab view item "Connection" of tab view "tab" of window "main" to 3
if con_status is "7" then
set content of control "pegel_con" of tab view item "Connection" of tab view "tab" of window "main" to 4
if con_status is "8" then
set content of control "pegel_con" of tab view item "Connection" of tab view "tab" of window "main" to 5
end if


So far, so good - everything is working fine - when con_status is “8” then all of the Progress Indicator is green - but is it
also possible to have only the last one to be green?

Thanks for any feedback,

Best Regards,

Stefan

I believe you’re talking about a level indicator. How about making multiple level indicators that all have a max of one, or using some other controls?

Also, those if statements don’t compile for me. If you go with multiple indicators, then the if statements should probably look like one of these:

if con_status is "0" then
	set content of control "pegel_con1" of tab view item "Connection" of tab view "tab" of window "main" to 1
end if

-- or
if con_status is "0" then set content of control "pegel_con1" of tab view item "Connection" of tab view "tab" of window "main" to 1

-- or
if con_status is "0" then ¬
	set content of control "pegel_con1" of tab view item "Connection" of tab view "tab" of window "main" to 1

Side note: For your current script, this should also work:

set con_status to "7" -- example

(((con_status as integer) + 2) / 2) as integer
set content of control "pegel_con" of tab view item "Connection" of tab view "tab" of window "main" to result