Bug 8155 - Problem with XmDrawnButton under Motif 2.1.10
Problem with XmDrawnButton under Motif 2.1.10
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
6.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-01-03 19:20 EST by James Oliver
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-01-04 09:24:19 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description James Oliver 2000-01-03 19:20:09 EST
I am not sure if this is the correct place to try to report a bug with this
particular piece of software.  If it is not maybe you could point me in the
right direction.

It seems that there is a bug with Motif that causes the Drawn Button
widgets to lock up after a random number of buttons have been generated.

Using the attached quick and dirty code fragment I can get the list of
100 Drawn Buttons in the button_rowcol widget to stop accepting/handling
events after about 2 redraws.  This is just a simple mock up to mimic
what is going on in a real application that locks all Drawn Buttons
after a seemingly random amount of time.  Most annoying from a users
perspective.  The specific version of Motif is 2.1.10 from RedHat.

Thankyou for your help.

Regards,

James Oliver

#include <X11/Xlib.h>
#include <X11/Xutil.h>

#include <Xm/Xm.h>
#include <Xm/MainW.h>
#include <Xm/DrawnB.h>
#include <Xm/RowColumn.h>
#include <stdio.h>

#define TABSPERWINDOW 10
#define NUM_BUTTONS 100
#define NUM_ROWS 10

// Global variables.
Widget toplevel, top_rowcol, exit_rowcol, button_rowcol;
Widget rowcols[NUM_ROWS];
Widget shell;
Widget buttons[NUM_BUTTONS];

void
my_callback(void *arg)
{
    printf("Callback!\n");
}

void
exit_callback(void *arg)
{
    printf("Exit!\n");
    exit(0);
}

void
create_buttons()
{
    XmString str;
    int i,j;
    char name[100];
    char buf[100];

    for(j = 0; j < NUM_ROWS; j++)
    {
        sprintf(buf, "_rowcol%d", j);
        rowcols[j] = XtVaCreateManagedWidget(buf, xmRowColumnWidgetClass,
button_rowcol, NULL);
        for(i = 0; i < NUM_BUTTONS/NUM_ROWS; i++)
        {
            sprintf(name, "Button %d", (i+j*10));
            str = XmStringCreateLtoR(name, XmSTRING_DEFAULT_CHARSET);
            buttons[i+j*10] = XtVaCreateManagedWidget(name,
                                    xmDrawnButtonWidgetClass, rowcols[j],
                                    XmNmarginWidth, 0,
                                    XmNmarginHeight, 0,
                                    XmNlabelString, str,
                                    NULL);

            XtAddCallback(buttons[i+j*10], XmNactivateCallback,
my_callback, NULL);
        }
    }
}

void
next_callback(void *arg)
{
    int i;

    for(i = 0; i < NUM_BUTTONS/NUM_ROWS; i++)
        XtDestroyWidget(button_rowcol);

    button_rowcol = XtVaCreateManagedWidget("button_rowcol",
xmRowColumnWidgetClass, top_rowcol,
                                            XmNorientation, XmHORIZONTAL,
                                            NULL);
    create_buttons();
}

int
main(int argc, char **argv)
{
    XtAppContext app;
    char name[100];
    XmString str;
    XmString str1;
    Widget exit_button, next_button;


    toplevel = XtVaAppInitialize(&app, "DrawnButtonTest", NULL, 0, &argc,
argv, NULL, NULL);

    top_rowcol = XtVaCreateManagedWidget("top_rowcol",
xmRowColumnWidgetClass, toplevel,
                                            XmNorientation, XmHORIZONTAL,
                                            NULL);
    button_rowcol = XtVaCreateManagedWidget("button_rowcol",
xmRowColumnWidgetClass, top_rowcol,
                                            XmNorientation, XmHORIZONTAL,
                                            NULL);
    exit_rowcol = XtVaCreateManagedWidget("exit_rowcol",
xmRowColumnWidgetClass, top_rowcol, NULL);

    create_buttons();

    sprintf(name, "Next..");
    str1 = XmStringCreateLtoR(name, XmSTRING_DEFAULT_CHARSET);
    next_button = XtVaCreateManagedWidget(name,
                                xmDrawnButtonWidgetClass, exit_rowcol,
                                XmNmarginWidth, 0,
                                XmNmarginHeight, 0,
                                XmNlabelString, str1,
                                NULL);

    XtAddCallback(next_button, XmNactivateCallback, next_callback, NULL);

    sprintf(name, "Exit");
    str = XmStringCreateLtoR(name, XmSTRING_DEFAULT_CHARSET);
    exit_button = XtVaCreateManagedWidget(name,
                                xmDrawnButtonWidgetClass, exit_rowcol,
                                XmNmarginWidth, 0,
                                XmNmarginHeight, 0,
                                XmNlabelString, str,
                                NULL);

    XtAddCallback(exit_button, XmNactivateCallback, exit_callback, NULL);

    XtRealizeWidget(toplevel);
    XtAppMainLoop(app);

    return 0;
}
Comment 1 Jim Kingdon 2000-01-04 09:24:59 EST
The Motif product from Red Hat is discontinued.  In fact, in looking for
evidence of it, I think we only shipped 2.0 and 2.0.1 - I don't see a
2.1.10 from Red Hat.

For Motif information, I'd suggest
  http://www.lesstif.org/
  http://www.opengroup.org/motif/

Note You need to log in before you can comment on or make changes to this bug.