Re: Lighted Indicator



Hi inbox_pub earthlink net,

On Wed, 04 Jun 2008 15:11:43 -0500 you wrote:
> I compiled and ran your code. It was not exactly what I needed, but it gave me the bits and 
> pieces to do what I wanted. I wanted a LED type panel light above my button. Based on
> your code, I put an event box into an unlabeled frame and sized the event box. It is just what
> I wanted.

Probably not relevant, but when I needed something like this I took a copy of the GTK Button source, renamed it as GTK Lamp, and removed all the user interaction. I then control it by calling gtk_widget_set_state:

            gtk_widget_set_state ( Lamps[cc], GTK_STATE_ACTIVE );

            gtk_widget_set_state ( Lamps[cc], GTK_STATE_NORMAL );

This only gives me direct control of the usual states, but since all I really wanted was an on/off indication that's fine. I can define the colours in an RC file, for example:

style "LampStyle"
{
  bg[NORMAL] = "#401020"
  fg[NORMAL] = "#505050"
  bg[ACTIVE] = "#FF2038"
  fg[ACTIVE] = "#001020"
  font_name = "Sans Bold"
}

class "GtkLamp" style "LampStyle"
widget "*.GtkLamp.*" style "LampStyle"

If a third colour was needed then I could use the PRELIGHT state.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]