XmText still broken (with patch, looong)

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

6 posts / 0 new
Last post
XmText still broken (with patch, looong)

Submitted by Anonymous on Mon, 02/04/2002 - 19:03. Developers
I sent a report to motif-bugs@opengroup.org in december 13
(with a copy to comp.windows.x.motif) showing that an XmText
doesn`t updates the scrollbars if its parent is not a
XmScrolledWindow. It seems that the bug report was ignored,
since OpenMotif 2.2 doesn`t includes it. So I`m posting it here
again hoping that some kind soul will comit the patch.

Thanks

Submitter Name Carlos A. M. dos Santos
Organization Universidade Regional Integrada - RS/Brazil
Email Address casantos@urisan.tche.br
Phone +55 55 3313-7969
OSF License Number not applicable
Licensee`s Defect Number not applicable

Hardware/Software Configuration
-------------------------------

Offering and Version Motif 2.1.30
Component (Module) lib/Xm/Text.c
Client Hardware Dell OptiPlex GX1
Client Software FreeBSD 4.4, X11R6.5
Server Hardware SAME
Server Software SAME
Compiler GCC 2.95.3

Problem Description
-------------------

Severity Level Severe

Date of First Occurrence December 12, 2001

One Line Description

XmText doesn`t updates scrollbars if parent is not XmScrolledWindow

Full Description

Whet the parent of a XmText widget is of XmScrolledWindow widget
class, scrollbar hummb positions are properly updated when the user
uses the keyboard to navigate up and down. However, if the parent is a
subclass of XmScrolledWindow, like XmMainWindow, this doesen`t
happens. To workarround the problem the programmer must use
XmCreateScrolledText to create the work window of the main window.

Repeat By

Compile and run the following program. Fill the text buffer to make
scrolling necessary and navigate with the keyboard.

/*
* cc -o XmTextBug XmTextBug.c -I/usr/X11R6/include
* -L/usr/X11R6/lib -lXm -lXt -lX11
*/
#include
#include
#include
#include

int main(int argc, char *argv[])
{
XtAppContext app;
Widget top, main_w, menu, button, text;

top = XtAppInitialize(&app, "TextBug", NULL, 0,
&argc, argv, NULL, NULL, 0);
main_w = XtCreateManagedWidget("main_w", xmMainWindowWidgetClass,
top, NULL, 0);
menu = XmCreateMenuBar(main_w, "menu", NULL, 0);
button = XtCreateManagedWidget("Quit", xmPushButtonWidgetClass,
menu, NULL, 0);
XtManageChild(menu);
text = XtVaCreateManagedWidget("text", xmTextWidgetClass, main_w,
XmNeditMode, XmMULTI_LINE_EDIT, XmNcolumns, 80,
XmNrows, 25, NULL);
XtVaSetValues(main_w, XmNmenuBar, menu, XmNworkWindow, text, NULL);
XtRealizeWidget(top);
XtAppMainLoop(app);
return 0;
}

Proposed Solution

Apply the following patch.

--- motif/lib/Xm/Text.c.patch4 Thu Dec 13 015342 2001
+++ motif/lib/Xm/Text.c Thu Dec 13 015949 2001
@@ -2910,19 +2910,19 @@
if (XmDirectionMatch(XmPrim_layout_direction(widget),
XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) {
if (widget->text.output->data->scrollvertical &&
- XtClass(widget->core.parent) == xmScrolledWindowWidgetClass)
+ XmIsScrolledWindow(XtParent(widget)))
_XmRedisplayVBar(widget);
if (widget->text.output->data->scrollhorizontal &&
- XtClass(widget->core.parent) == xmScrolledWindowWidgetClass &&
+ XmIsScrolledWindow(XtParent(widget)) &&
!widget->text.hsbar_scrolling)
_XmChangeHSB(widget);
} else {
if (widget->text.output->data->scrollvertical &&
- XtClass(widget->core.parent) == xmScrolledWindowWidgetClass &&
+ XmIsScrolledWindow(XtParent(widget)) &&
!widget->text.vsbar_scrolling)
_XmChangeVSB(widget);
if (widget->text.output->data->scrollhorizontal &&
- XtClass(widget->core.parent) == xmScrolledWindowWidgetClass)
+ XmIsScrolledWindow(XtParent(widget)))
_XmRedisplayHBar(widget);
}
}

damian

If you could put this into the bug database, it would be great
http//bugs.motifzone.net
I couldn`t find this bug in the database, and this is what we go off of for patches and fixes.
Thanks.
(d)

Anonymous

> If you could put this into the bug database, it would be great

I will do it, but it seems a little bit silly. I already send a bug
report, according to the instructions contained in the file named
BUGREPORT and got a confirmation that it was received!

I thought my bug report would be automatically included in the
database. Why does Open Group has a bug report system that
discards the reported bugs?

ICS_support

There is a second bug -- that BUGREPORT is out of date. Since Motif became Open Motif, that file needs to be changed to reflect new information. While the status of the big bug database is a bit fuzzy, damian points out where you can deposit new bugs. You got an acknowledgement because some machine, probably sitting in a basement Reading, UK, is still running a script to auto-respond to messages, although I don`t know what happens to those reports.

Anonymous

> You got an acknowledgement because some machine,
> probably sitting in a basement Reading, UK, is still running a
> script to auto-respond to messages, although I don`t know
> what happens to those reports.

According to the acknowledgement email heading, the machine
is "mailgate.rdg.opengroup.org".

Anonymous

XmText still broken (with patch, looong)
A bug report was filled. Its number is 1147.