Murga-Projects Forums
Fl_Light_Button - Printable Version

+- Murga-Projects Forums (http://www.murga-projects.com/forum)
+-- Forum: Project Forums (/forumdisplay.php?fid=1)
+--- Forum: MurgaLua - General (/forumdisplay.php?fid=2)
+--- Thread: Fl_Light_Button (/showthread.php?tid=179)


Fl_Light_Button - chrimo - 08-20-2007 06:40 AM

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


RE: Fl_Light_Button - chrimo - 08-20-2007 07:18 AM

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


RE: Fl_Light_Button - mikshaw - 08-20-2007 10:40 AM

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.