Normal Topic Temporarily changing command button color (Read 1130 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Temporarily changing command button color
Feb 18th, 2011 at 6:12pm
Print Post Print Post  
In this month's Inside Sesame there is a short article about a trick to notify users that the command button they've clicked on is actually doing something.  The article details how to change the button's label from its default of black to red, using the following code:
Code
Select All
RGBColor(ThisElement, 232, 0, 50, -1, -1, -1)
ForceRedraw()

Loiter(500)

RGBColor(ThisElement, 0, 0, 0, -1, -1, -1)
ForceRedraw() 



This works just fine, but I would like to do something different.  I would like to keep the label text black but change the background color from its default of yellow to light green.  I tried the following code:
Code
Select All
RGBColor(ThisElement, -1, -1, -1, 150, 255, 150)
ForceRedraw()

Loiter(500)

RGBColor(ThisElement, -1, -1, -1, 255, 255, 0)
ForceRedraw() 


But this is not working.  The button just changes to a light gray, which is does anyway when clicked.  Am I missing something?

Help is appreciated, as always.
  

**
Captain Infinity
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Temporarily changing command button color
Reply #1 - Feb 18th, 2011 at 9:35pm
Print Post Print Post  
Hello Scott,

I know Sesame itself changes a buttons back fill color and box type when it is clicked. From just a quick look at this, It looks as if the button's background color can not be changed while it is in the down clicked state.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Temporarily changing command button color
Reply #2 - Feb 18th, 2011 at 11:06pm
Print Post Print Post  
Quote:
From just a quick look at this, It looks as if the button's background color can not be changed while it is in the down clicked state.


I routinely change the color of the label (and the text of the label to read "Working...") on command buttons, and I can confirm that what Ray suspects with a "quick look" is indeed accurate -- you have no control over the background color when the button is down.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Temporarily changing command button color
Reply #3 - Feb 22nd, 2011 at 1:42pm
Print Post Print Post  
OK.
  

**
Captain Infinity
Back to top
IP Logged