ScrolledText in an XmNotebook issues scrollbar warnings - Motif

This is a discussion on ScrolledText in an XmNotebook issues scrollbar warnings - Motif ; When an XmNotebook page is a ScrolledText, if the window is grown horizontally when the scrollbar slider touches the maximum extent, the scroll bar issues a warning message "The specified scrollbar value is greater than the maximum scrollbar value minus ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: ScrolledText in an XmNotebook issues scrollbar warnings

  1. ScrolledText in an XmNotebook issues scrollbar warnings

    When an XmNotebook page is a ScrolledText, if the window is grown
    horizontally when the scrollbar slider touches the maximum extent, the
    scroll bar issues a warning message "The specified scrollbar value is
    greater than the maximum scrollbar value minus the scrollbar slider
    size." The vertical scroll bar works properly and does not issue such
    a warning.

    To demonstrate, compile this code and execute. Move the horizontal
    scrollbar completely to the right, then grow the window horizontally.

    I found this behavior to exist in Motif2.1, 2.2, and 2.3 on all
    platforms I tried.
    #include
    #include
    #include
    #include
    #include
    #include

    int main( Cardinal argc, char **argv) {

    Widget wTabManager;
    Widget wTab;
    Widget wPage;
    Widget wTopLevel;
    Widget wForm;
    Widget wText;
    XtAppContext appContext;
    Arg Args[10];
    int n;

    char *value = "This is the a test of the scrolled text\n\
    inside a form that is a tab page\n\n\n\n\n\n\n\n\n\n\n";

    XtSetLanguageProc (NULL, NULL, NULL);

    wTopLevel = XtVaAppInitialize(&appContext, "menubarExample", NULL,
    0,
    &argc, argv, NULL, NULL);

    wTabManager = XtVaCreateManagedWidget( "tabmgr",
    xmNotebookWidgetClass,
    wTopLevel,
    NULL);
    wTab = XtVaCreateManagedWidget( "tab",
    xmPushButtonWidgetClass, wTabManager,
    XmNnotebookChildType, XmMAJOR_TAB,
    XmNpageNumber, 1,
    NULL ) ;

    wPage = XtVaCreateManagedWidget( "page",
    xmFormWidgetClass, wTabManager,
    XmNwidth, 100,
    XmNheight, 200,
    XmNnotebookChildType, XmPAGE,
    XmNpageNumber, 1,
    NULL ) ;


    n = 0;
    XtSetArg( Args[n], XmNeditable, False ); n++;
    XtSetArg( Args[n], XmNeditMode, XmMULTI_LINE_EDIT ); n++;
    XtSetArg( Args[n], XmNleftAttachment, XmATTACH_FORM ); n++;
    XtSetArg( Args[n], XmNrightAttachment, XmATTACH_FORM ); n++;
    XtSetArg( Args[n], XmNtopAttachment, XmATTACH_FORM ); n++;
    XtSetArg( Args[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
    XtSetArg( Args[n], XmNvalue, value ); n++;
    wText = XmCreateScrolledText(wPage, "text", Args, n);
    XtManageChild(wText);

    XtRealizeWidget(wTopLevel);

    XtAppMainLoop(appContext);
    return 0;
    }

    Any way to fix this short of registering a custom warning message
    handler that will ignore this particular message?
    --
    Fred L. Kleinschmidt
    Boeing Technical Fellow
    Aerodynamics Stability and Control

  2. Re: ScrolledText in an XmNotebook issues scrollbar warnings

    fred.l.kleinschmidt@boeing.com wrote:
    > When an XmNotebook page is a ScrolledText, if the window is grown
    > horizontally when the scrollbar slider touches the maximum extent, the
    > scroll bar issues a warning message "The specified scrollbar value is
    > greater than the maximum scrollbar value minus the scrollbar slider
    > size." The vertical scroll bar works properly and does not issue such
    > a warning.


    I have tried your code and can reproduce your bug on OpenMotif 2.3,
    even with the latest CVS version.

    I found out that bug is not related to XmNotebook.
    It is a genuine XmText bug.

    A quick and dirty non-fix is to change your requirements
    and drop the horizontal scrollbar:

    ....
    > XtSetArg( Args[n], XmNbottomAttachment, XmATTACH_FORM ); n++;

    XtSetArg( Args[n], XmNscrollbarHorizontal, FALSE ); n++
    XtSetArg( Args[n], XmNwordWrap, TRUE ); n++
    > XtSetArg( Args[n], XmNvalue, value ); n++;

    ....

    If you want to fix it properly, then file a bug report
    http://bugs.motifzone.net/
    and also check the OpenMotif source and provide a fix
    for the flawed logic in resize calculations of XmText.

    Some bugs in OM do get fixed, if you are lucky,
    your fix could be included in upcoming OpenMotif 2.3.1

    Sorry, I do not know how to fix the toolkit bug
    by just modifying the application (other than with
    custom warning handler which you mention).

    Best regards,

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

  3. Re: ScrolledText in an XmNotebook issues scrollbar warnings

    On Dec 8, 3:44 pm, arahne wrote:
    > fred.l.kleinschm...@boeing.com wrote:
    > > When an XmNotebook page is a ScrolledText, if the window is grown
    > > horizontally when the scrollbar slider touches the maximum extent, the
    > > scroll bar issues a warning message "The specified scrollbar value is
    > > greater than the maximum scrollbar value minus the scrollbar slider
    > > size." The vertical scroll bar works properly and does not issue such
    > > a warning.

    >
    > I have tried your code and can reproduce your bug on OpenMotif 2.3,
    > even with the latest CVS version.
    >
    > I found out that bug is not related to XmNotebook.
    > It is a genuine XmText bug.
    >
    > A quick and dirty non-fix is to change your requirements
    > and drop the horizontal scrollbar:
    >
    > ...> XtSetArg( Args[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
    >
    > XtSetArg( Args[n], XmNscrollbarHorizontal, FALSE ); n++
    > XtSetArg( Args[n], XmNwordWrap, TRUE ); n++> XtSetArg( Args[n], XmNvalue, value ); n++;
    >
    > ...
    >
    > If you want to fix it properly, then file a bug reporthttp://bugs.motifzone.net/
    > and also check the OpenMotif source and provide a fix
    > for the flawed logic in resize calculations of XmText.
    >
    > Some bugs in OM do get fixed, if you are lucky,
    > your fix could be included in upcoming OpenMotif 2.3.1
    >
    > Sorry, I do not know how to fix the toolkit bug
    > by just modifying the application (other than with
    > custom warning handler which you mention).
    >
    > Best regards,
    >
    > Dušan Peterchttp://www.arahne.si


    It is now registered vis Bugzilla as Bug#1396

+ Reply to Thread