Line wrap (not word wrap) with XmText - Motif

This is a discussion on Line wrap (not word wrap) with XmText - Motif ; Hi, Is it possible to get an XmText widget to wrap the line at a fixed character position with no regard to keeping whole words together? If the number of columns is set to say 40, does it just stop ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Line wrap (not word wrap) with XmText

  1. Line wrap (not word wrap) with XmText

    Hi,

    Is it possible to get an XmText widget to wrap the line at a fixed character
    position with no regard to keeping whole words together? If the number of
    columns is set to say 40, does it just stop accepting input once 40
    characters have been typed on a line, or does it throw a new line?

    Thanks for any answers.



  2. Re: Line wrap (not word wrap) with XmText

    ng598 wrote:

    > Is it possible to get an XmText widget to wrap the line at a fixed character
    > position with no regard to keeping whole words together? If the number of
    > columns is set to say 40, does it just stop accepting input once 40
    > characters have been typed on a line, or does it throw a new line?

    It throws a new line, but does not insert one in the string -
    it is only displayed as such.

    You will need to use fixed (non-proportional) font for this to
    make sense. XmNcolumns only specifies initial width.
    If your widget is resizeable, the number of characters for word wrap
    could change after resizing the widget.
    I think it is not possible to make it force
    to the next line where you want it, unless you want to play with
    XmNmodifyVerifyCallback to insert spaces in your input string
    where appropriate.

    Best regards,

    Dušan Peterc
    http://www.arahne.si

  3. Re: Line wrap (not word wrap) with XmText


    "ng598" wrote in message
    news:dv3rpe$qoa$1@rdel.co.uk...
    > Hi,
    >
    > Is it possible to get an XmText widget to wrap the line at a fixed
    > character
    > position with no regard to keeping whole words together? If the number of
    > columns is set to say 40, does it just stop accepting input once 40
    > characters have been typed on a line, or does it throw a new line?
    >
    > Thanks for any answers.
    >
    >


    This cannot be done with a simple resource.
    This can be done using an XmNmodifyVerify callback, but you will have to
    keep track of which newlines are added by the callback and which are added
    by the user.
    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Technical Architect, Software Reuse Project



+ Reply to Thread