Resizing Scrolled Lists - Motif

This is a discussion on Resizing Scrolled Lists - Motif ; The following bit of ASCII art shows what happens if you have a scrolled list containing (say) 6 items, a, b, c, d, e, f, with d, e, and f visible initially and then resize the window to make room ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Resizing Scrolled Lists

  1. Resizing Scrolled Lists

    The following bit of ASCII art shows what happens if you have a scrolled
    list containing (say) 6 items, a, b, c, d, e, f, with d, e, and f visible
    initially and then resize the window to make room for all 6 items.

    +---+ +---+
    | d | | d |
    | e | | e |
    | f | | f |
    +---+ | |
    | |
    | |
    +---+

    (To see this try the File/Open dialogue on your favourite Motif app.)

    The scrolled window behaves as if the list has extra blank space at the
    bottom. The blank space doesn't disappear when you scroll around in the
    list. This is quite different from what happens if you resize while viewing
    the top of the list.

    This seems wrong to me. Does anyone know of a work-around? My specific
    problem is with a custom command entry dialogue rather than the file
    selection box so I can change the way I create the widgets if I have to.

    Regards,

    Rob.



  2. Re: Resizing Scrolled Lists

    When you resize, it's preserving the topmost visible item. If that's
    not what you want, then catch the resize event, and call XmListSetBottomPos.

  3. Re: Resizing Scrolled Lists

    ST wrote:

    > When you resize, it's preserving the topmost visible item. If that's
    > not what you want, then catch the resize event, and call
    > XmListSetBottomPos.


    Thanks! XmListSetBottomPos does indeed get rid of the unwanted blank space
    as well as positioning the list right. For the record, the following event
    handler did exactly what I want (giving the default behaviour except when
    the blank space would appear).

    static void handle_resize(Widget list_w, XtPointer x, XEvent *y, Boolean *z)
    {
    short num_visible;
    int top_pos, num_entries;
    XtVaGetValues(list_w,
    XmNitemCount, &num_entries,
    XmNvisibleItemCount, &num_visible,
    XmNtopItemPosition, &top_pos,
    NULL);
    if(num_entries - top_pos + 1 < num_visible) {
    XmListSetBottomPos(list_w, 0);
    }
    }

    Regards and thanks again,

    Rob.


  4. Re: Resizing Scrolled Lists

    Rob Arthan wrote:
    > The following bit of ASCII art shows what happens if you have a scrolled
    > list containing (say) 6 items, a, b, c, d, e, f, with d, e, and f visible
    > initially and then resize the window to make room for all 6 items.
    >
    > +---+ +---+
    > | d | | d |
    > | e | | e |
    > | f | | f |
    > +---+ | |
    > | |
    > | |
    > +---+
    >
    > (To see this try the File/Open dialogue on your favourite Motif app.)
    >
    > The scrolled window behaves as if the list has extra blank space at the
    > bottom. The blank space doesn't disappear when you scroll around in the
    > list. This is quite different from what happens if you resize while viewing
    > the top of the list.
    >
    > This seems wrong to me. Does anyone know of a work-around? My specific
    > problem is with a custom command entry dialogue rather than the file
    > selection box so I can change the way I create the widgets if I have to.
    >
    > Regards,
    >
    > Rob.
    >
    >

    Have you attached the bottom of the scrolled list to the form? That
    usually does it for me.

    --
    God's Blessings and love

    Deacon Gary Meerschaert <'}}}}><

    Madison Heights, MI
    Archdiocese of Detroit

    Don't give up on your dreams.
    Wait a bit and they'll give up on you
    and you can start again without all of that guilt.

    Gary.meerschaert@gmail.com

+ Reply to Thread