Page 1 of 1

hilite in widget"switch"script does not work, but does in...

Posted: Mon Sep 19, 2016 9:27 pm
by sphere
Hi,

can someone please explain:

in a simple button this works:

Code: Select all

if the hilited of widget"switch" then
   put "localport=" into sPort
   put fld"addthis" after sPort
else
   put "program=" & quote into sPort
   put fld"addthis" & quote after sPort
end if
but in the widget itself this similair code is not working:

Code: Select all

on hiliteChanged
    if the hilited of me then
      set the visible of widget "hithere" to true
else
    set the visible of widget "hithere" to false
  end if
end hiliteChanged
already tried hilite and highlight, which does not help

when you use the standard code "put the hilited of me" then it show true or false so that's ok

So from another button it seems to work using the hilite of it
but in the widget itself not

Using LC8.1 stable

Any suggestions on this?

Thanks a lot!

Re: hilite in widget"switch"script does not work, but does i

Posted: Mon Sep 19, 2016 10:13 pm
by [-hh]
Your script works here as it should. I used a clock-widget (named "hithere") for testing.

[Mac OS 10.11.6 / LC 8.1.0]

Re: hilite in widget"switch"script does not work, but does i

Posted: Tue Sep 20, 2016 6:54 pm
by sphere
I ...guess...i...was...very...tired....yesterday....and...not...thinking....clear....

left the Show Invisible Objects on...................................................................

and it's not the first time i did that..................................................

:oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops:

one lesson, do not code when you're tired.............. :roll: :roll: :roll:

:lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol:

Re: hilite in widget"switch"script does not work, but does i

Posted: Wed Sep 21, 2016 5:04 pm
by jacque
do not code when you're tired
If I followed that rule I'd never get anything done.

Re: hilite in widget"switch"script does not work, but does i

Posted: Wed Sep 21, 2016 7:48 pm
by sphere
i know what you mean, especially when your searching for a solution and know you're almost there and your whole systems tells you 'go to sleep' but you still go on and on and on....eyes like this :shock: