Murga-Projects Forums

Full Version: Fl_Light_Button
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

when using Fl_Light_Button the light didn't switch on ;-(
Do I have to set the value manually ?

Code:
fB = fltk:Fl_Light_Button(pos*BorderX+(pos-1)*ButtonSizeX, BorderY, ButtonSizeX, ButtonSizeY, "File Log");
fB:color(31);
fB:selection_color(31);
fB:tooltip("Write messages to file... ");
fB:redraw();

function file_callback(object)
    if(0==logwrite) then
        logwrite=1;
        fB:value(1);
    else
        logwrite=0;
        fB:value(0);
    end
    print("file_callback:"..logwrite.."Value:"..fB:value());
    fB:redraw();
    Fl:check();
end


The light never changes when pressing button...
I'm using OSX (PPC), bug or feature ?
Bye
Chrimo

ReHi,

I think it works,
BUT "ARE the colors too poor" ?!?

sB:selection_color(fltk.FL_GREEN) is needed !!!
My defaults are too bad!

Bye
Chrimo
Yeah, it doesn't work if fB:color() and fB:selection_color() are set to the same value =o)

Something I just bumped into the other day that is useful if you like to make your interface colors match those of other applications on your system:
Fl:get_system_colors()

I don't know how universal this is, but it at least works with X resources (and with KDE, as far as I've heard). I'll eventually test it on Windows.
Reference URL's