scrolling list widget - Motif

This is a discussion on scrolling list widget - Motif ; I'm having the following problem. I want use a list widget to get all of its selection capabilities. However, I need to manage the scroll bars myself because the number of items in my list is VERY large (1,000,000), so ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: scrolling list widget

  1. scrolling list widget

    I'm having the following problem. I want use a list widget to get all of its
    selection capabilities. However, I need to manage the scroll bars myself
    because the number of items in my list is VERY large (1,000,000), so putting
    all the items in a scrolling list is impractical.

    I can handle the scrolling myself except for one problem. The list does not
    have a callback for keyboard cursor movement. As a result, I cannot tell when
    a user cursors off the top or bottom of the list, and hence, when to scroll the
    list. I cannot install an XmNinputCallback on a list to see keyboard input,
    either.

    So is there any mechanism to let me know about keyboard cursor movement for the
    list widget?

    Please respond directly to me as I do not read this newsgroup.

  2. Re: scrolling list widget


    "Peter A. Buhr" wrote in message
    news:dvs6ga$jnh$1@rumours.uwaterloo.ca...
    > I'm having the following problem. I want use a list widget to get all of
    > its
    > selection capabilities. However, I need to manage the scroll bars myself
    > because the number of items in my list is VERY large (1,000,000), so
    > putting
    > all the items in a scrolling list is impractical.
    >
    > I can handle the scrolling myself except for one problem. The list does
    > not
    > have a callback for keyboard cursor movement. As a result, I cannot tell
    > when
    > a user cursors off the top or bottom of the list, and hence, when to
    > scroll the
    > list. I cannot install an XmNinputCallback on a list to see keyboard
    > input,
    > either.
    >
    > So is there any mechanism to let me know about keyboard cursor movement
    > for the
    > list widget?
    >
    > Please respond directly to me as I do not read this newsgroup.


    Well, If you don't read this newsgroup, I guess you won't see this message.
    If you don't read the newsgroup, why post on it?
    One purpose of a newsgroup is for others to see the solution, too.

    You really ought to re-design how you are going to present your selectable
    items.
    A list with 1 Million items is not very useful.

    One way: make a scrolled window with scrollingPolicy = APPLICATION_DEFINED.
    Place a list child in it, with n visible items (n = 10 or so).
    Place callbacks on the scrollbar to determine what to put in the list.
    You can also use the list callbacks - a list DOES respond to arrow keys.
    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Technical Architect, Software Reuse Project



  3. Re: scrolling list widget

    In article ,
    Fred Kleinschmidt wrote:
    >"Peter A. Buhr" wrote in message
    >news:dvs6ga$jnh$1@rumours.uwaterloo.ca...
    >> I'm having the following problem. I want use a list widget to get all of its
    >> selection capabilities. However, I need to manage the scroll bars myself
    >> ...
    >> I can handle the scrolling myself except for one problem. The list does not
    >> have a callback for keyboard cursor movement. As a result, I cannot tell
    >> when a user cursors off the top or bottom of the list, and hence, when to
    >> scroll the list. I cannot install an XmNinputCallback on a list to see
    >> keyboard input, either.


    Sorry for taking so long to reply with some results on this item. Kudos to Fred
    Kleinschmidt for pointing me towards the solution for this problem (separate
    communication).

    It *is* possible to indirectly install a callback for keyboard input along with
    the one already installed for the list widget using:

    XtAddEventHandler( listWidget, KeyPressMask, False, (XtEventHandler)namesInputCB, this );

    and the callback does something like the following:

    void namesInputCB( Widget list, Drawing &This, XEvent &event, Boolean * ) {
    KeySym keysym = XLookupKeysym( &(event.xkey), 0 );
    switch ( keysym ) {
    case XK_Up:
    if ( XmListGetKbdItemPos( list ) == 1 ) ... // scroll list down
    break;
    case XK_Down:
    if ( (unsigned int)XmListGetKbdItemPos( list ) == This.visibleRows ) ... // scroll list up
    break;
    } // switch
    }

    This techniques works fine for my application.

+ Reply to Thread