Re: XForms: printf to a browser or canvas

From: Gayle C Roth (Gayle.C.Roth@grc.nasa.gov)
Date: Fri Oct 11 2002 - 13:27:48 EDT

  • Next message: M Ancher: "XForms: Re: [cc65] Graphics library"

    # To subscribers of the xforms list from Gayle C Roth <Gayle.C.Roth@grc.nasa.gov> :

    At 05:34 PM 10/11/2002 +0200, you (Manuel Maria Diaz Gomez) wrote:
    ># To subscribers of the xforms list from Manuel Maria Diaz Gomez
    ><Manuel.Maria.Diaz.Gomez@cern.ch> :
    >
    >
    >Hi all,
    >
    >I am a newby with xforms, and maybe this question sounds a bit silly;
    >nevertheless here I go.
    >
    >How could I display the output of e.g. printf("Hello world!"); into an
    >object. Should this object be a browser or a canvas?
    >
    >Thanks in advance
    >
    >Manuel

    Manuel,

    There a few ways to do it, depending on exactly what you want to do:

    1) You can output it to a form (i.e. canvas) directly using 'fl_drw_text' --

    void fl_drw_text(int align, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h,
    FL_COLOR c, int style, int size, char* str)

    align - alignment with respect to the bounding rectangle defined by x,y,w,
    & h (FL_ALIGN_CENTER, etc.)

    x,y,w,h - bounding rectangle of area to draw text in

    c - color of text

    style - type of font -- I always use FL_NORMAL_TEXT.

    size - font size - 8,10,12,14,18, and 24 are the allowed values (they have
    names starting with FL_... too but I usually use the numbers).

    str - string to be displayed

    2) If you've created a text FL_OBJECT (using fl_add_text) on the canvas,
    to put text on it do:

    fl_set_object_label(FL_OBJECT* obj, const char* label)

    - Gayle

    >_________________________________________________
    >To unsubscribe, send the message "unsubscribe" to
    >xforms-request@bob.usuhs.mil or see
    >http://bob.usuhs.mil/mailserv/xforms.html
    >XForms Home Page: http://world.std.com/~xforms
    >List Archive: http://bob.usuhs.mil/mailserv/list-archives/

    _________________________________________________
    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    http://bob.usuhs.mil/mailserv/xforms.html
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/



    This archive was generated by hypermail 2b29 : Fri Oct 11 2002 - 13:29:00 EDT