Horizontal scrolling and word-wrapping problem - Motif

This is a discussion on Horizontal scrolling and word-wrapping problem - Motif ; I want to let users choose whether a text widget in a scrolled window does word-wrapping or has a horizontal scroll bar. This is no problem via resources (the widget is called "script"): *script.scrollHorizontal: false *script.wordWrap: true or: *script.scrollHorizontal: true ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Horizontal scrolling and word-wrapping problem

  1. Horizontal scrolling and word-wrapping problem

    I want to let users choose whether a text widget in a scrolled window does
    word-wrapping or has a horizontal scroll bar. This is no problem via
    resources (the widget is called "script"):

    *script.scrollHorizontal: false
    *script.wordWrap: true

    or:

    *script.scrollHorizontal: true
    *script.wordWrap: false

    but I'd like to provide the choice in a dialogue when the app is running.

    Now the scrollHorizontal resource can't be changed from its initial value. I
    can set scrollHorizontal true initially and then manage and unmanage the
    scroll bar to control whether it is displayed, but the wordWrap resource is
    ignored if scrollHorizontal is true, so I can't change the word wrapping
    policy. I also can't set the scrollBarDisplayPolicy to AS_NEEDED, which
    would give something like the effect I want if it was allowed. Is there a
    way of doing what I want to do?

    Thanks in advance,

    Rob.


  2. Re: Horizontal scrolling and word-wrapping problem

    Rob Arthan wrote:
    >
    > I want to let users choose whether a text widget in a scrolled window does
    > word-wrapping or has a horizontal scroll bar. This is no problem via
    > resources (the widget is called "script"):


    About a year ago, someone gave me the answer to this (you could use
    google to look up word-wrap in 2004)

    What i did was create 2 separate text widgets, one with word wrapping
    and the other without, enclose the widgets in a form. And in the
    program, I manage the "word wrap" form (which contains the text widget
    with word wrapping attributes), and then unmanage it and manage the "no
    wrap" form.

    It seems that you cannot change the word wrapping attribute on the fly.
    I guess that thsi is only checked at widget creation time.

  3. Re: Horizontal scrolling and word-wrapping problem



    JF Mezei wrote:
    >
    > Rob Arthan wrote:
    > >
    > > I want to let users choose whether a text widget in a scrolled window does
    > > word-wrapping or has a horizontal scroll bar. This is no problem via
    > > resources (the widget is called "script"):

    >
    > About a year ago, someone gave me the answer to this (you could use
    > google to look up word-wrap in 2004)
    >
    > What i did was create 2 separate text widgets, one with word wrapping
    > and the other without, enclose the widgets in a form. And in the
    > program, I manage the "word wrap" form (which contains the text widget
    > with word wrapping attributes), and then unmanage it and manage the "no
    > wrap" form.
    >
    > It seems that you cannot change the word wrapping attribute on the fly.
    > I guess that thsi is only checked at widget creation time.


    XmNwordWrap can be changed at any time. The problem is with the scrolled
    window - XmNscrollHorizontal is a create-only resource.
    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Technical Architect, Common User Interface Services
    M/S 2R-94 (206)544-5225

+ Reply to Thread