On 10/07/11 11:50, David wrote:
> What would be the equivalent of a windows static text
> control in fltk widgets?

        For a plain text widget, you can either use
        Fl_Box or Fl_Widget with the label() as the text.
        eg:

Fl_Box *box = new Fl_Box(x,y,w,h);              // create a box
box->label("Some static text");                 // assign static string to label

        So a complete program might be:

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
int main() {
    Fl_Window *win = new Fl_Window(300,300);
    Fl_Box *box = new Fl_Box(10,10,280,40);     // create a box
    box->label("Some static text");             // assign static string to label
    box->color(FL_RED);                         // OPTIONAL: make the box red
    box->box(FL_FLAT_BOX);                      // OPTIONAL: make the box area 
visible
    win->show();
    return(Fl::run());
}

> Also, Is there a cheat sheet that gives the various windows controls and the 
> equivalent for fltk widget?

        I'm not aware of one.

        Few if any of us use the MS Windows API for making widgets,
        so pretty sure there's no such cheat sheet/rosetta stone
        for converting between Windows <-> FLTK <-> Qt <-> wxwidgets,
        though that would certainly be interesting, assuming someone
        knew at least two widget sets well enough to start one.
_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to