--- In [email protected], "Deen Hameed" <[EMAIL PROTECTED]> wrote:
>
> I want to set up a couple of buttons on my bar... a) to turn on/off
> the screensaver and b) to allow hotkeys on/off..
>
> Is there a way (ok, there is ALWAYS a way with powerpro)... How do I
> set the background colour of the button to a different colour
> depending on its status?
>
You can change a button's background color using cl.setbackcolor or
*format item. Easiest to do in a script since you want it to be
conditional. But also possible to do directly in a command block that
includes some *Script If's and More Commands. *Format item is
documented as being obsolete, but it still works fine. You can get all
its arguments by selecting choices in a bar item's command block.
Here's a sample script using the more recent cl.setbackcolor
approarch. You would save this to a file, e.g.,
togglehkstatus.powerpro in your scripts folder, and then call it from
the bar item's command block with .togglehkstatus:
static hkstatus
if (hkstatus=="" or hkstatus==1) do
hkstatus=0
Exec.Hotkeys("off")
cl.setbackcolor("hkstat",0,255,0,0) ;;red
elseif(hkstatus==0)
hkstatus=1
Exec.Hotkeys("on")
cl.setbackcolor("hkstat",0) ;;bar's normal color
endif
Regards,
Sheri