|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 2188 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 2188.
Report 2188 Actions
Problem Report Number 2188 Submitter's Classification Minor System Fault State Resolved Resolution Test Suite Deficiency (TSD) Problem Resolution ID TSD.X.1107 Raised 1970-01-01 08:00 Updated 2003-03-13 08:00 Published null Product Standard Motif Toolkit Certification Program The Open Brand certification program Test Suite VSM version 4.0.0 Test Identification vsm4/tset/widgets/XmSelectionDialog 3,4 Problem Summary TSD4M.00013 This is caused by the system design problem. Similar cases are XmSelectionDialog 4 about XmNlistVisibleItemCount resource test failure, XmCommandDialog 3 about XmNhistoryVisibleItemCount error. Whenev... Problem Text
This is caused by the system design problem. Similar cases are
XmSelectionDialog 4 about XmNlistVisibleItemCount resource test failure,
XmCommandDialog 3 about XmNhistoryVisibleItemCount error.
Whenever you get XmNlistVisibleItemCount resource, what you get is
not directly from widget->selection_box.list_visible_item_count, is from
widget->selection_box.list.visible_item_count, normally they are same, but
sometimes they could be different. If they are different, it could produce a
problem, this is what we meet in this XmSelectionDialog 3 test case. "widget"
here is whatever the widget we are testing.
This test case is testing the seleciton dialog box widget resources,
The point here is we should get the resources after the widget is realized,
because the geometry manager could change some resource's value, but the
test case get the resources before the widget is realized and later use
this stored resources' values to compare with whatever resources's values
got at the later time, this is the reason to cause the failure. The place to
get the wigdet resouces' values and store them is in file
This is data structure we need to consider:
typedef struct
X/Open Waiver Reference: Page: 1
WAIVER DOCUMENT X/Open Waiver Reference:
{
Widget list_label; /* list Label */
XmString list_label_string;
Widget list; /* List */
XmString *list_items;
int list_item_count;
int list_visible_item_count;
int list_selected_item_position;
Widget selection_label; /* selection Label */
XmString selection_label_string;
Widget text; /* Text */
XmString text_string;
short text_columns;
Widget work_area; /* other widget */
Widget separator; /* separator */
Widget ok_button; /* enter button */
XmString ok_label_string;
Widget apply_button; /* apply button */
XmString apply_label_string;
XmString cancel_label_string; /* cancel button label */
Widget help_button; /* help button */
XmString help_label_string;
XtCallbackList ok_callback; /* callbacks */
XtCallbackList apply_callback;
XtCallbackList cancel_callback;
XtCallbackList no_match_callback;
XtAccelerators text_accelerators;
Boolean must_match; /* flags */
Boolean adding_sel_widgets;
Boolean minimize_buttons;
unsigned char dialog_type; /* prompt or selection */
unsigned char child_placement;
} XmSelectionBoxPart;
In the above data structure, the list widget is the actually widget
to display the listed items, it has a resource called visibleItemCount, see
ListP.h of Xm lib.
X/Open Waiver Reference: Page: 2
WAIVER DOCUMENT X/Open Waiver Reference:
The default value of XmNlistVisibleItemCount for XmSelectionDialog
widget is 8, in XmSelectionDialog 3 test case, we get a 3 value for
XmNlistVisibleItemCount JUST after the widget is realized.
The reason here is because the size of the XmSelectionDialog is set too
small by the test case, it is 125*125(width * height). It is set in
function mvsSetUpGlobalArgs which is in
is called by the following function in file ../vsm4/src/mvslib/resources/
mvsTstStRscs.c:
widget_info = mvsCreateWidget(widget_class_info, parent_info,
UseCommonArgs, (ArgList)NULL,0 );
This size 125*125 is too small to display all the components of the
XmSelectionDialog widget, so the system reset the size to 125*425 or some
other bigger size when it is realized( This is done by related function
of WMShell in Xt lib Shell.c file, such as function ComputeWMSizeHints).
Because the width is still not wide enough , the system wraped "Ok",
"Cancel", "Help" buttons around and squeeze the size of XmText widget
component of XmSelectionDialog widget and cause the system reset
the XmNlistVisibleItemCount to be 3 depending the size of the list widget
component. If you check SelectioB.c of Xm lib, here is the code of how to
get XmNlistVisibleItemCount:
void
#ifdef _NO_PROTO
_XmSelectionBoxGetListVisibleItemCount( wid, resource_offset, value )
Widget wid ;
int resource_offset ;
XtArgVal *value ;
#else
_XmSelectionBoxGetListVisibleItemCount(
Widget wid,
int resource_offset,
XtArgVal *value )
#endif /* _NO_PROTO */
{
XmSelectionBoxWidget sel = (XmSelectionBoxWidget) wid ;
int data ;
Arg al[1] ;
/****************/
if( SB_List( sel) )
{
XtSetArg( al[0], XmNvisibleItemCount, &data) ;
XtGetValues( SB_List( sel), al, 1) ;
*value = (XtArgVal) data ;
}
else
{ *value = (XtArgVal) 0 ;
}
return ;
X/Open Waiver Reference: Page: 3
WAIVER DOCUMENT X/Open Waiver Reference:
}
/****************************************************************/
From the code above, you can see that the system try to make list
widget's resouce XmNvisibleItemCount and the whole selection dialog box widget's
resource XmNlistVisibleItemCount same and they should be same.
The normal size of XmSelectionDialog widget in my machine is 358*416
after it is displayed on the screen.
When XmSelectionDialog widget is just created in file ../vsm4/src/
mvslib/widgets/mvsCreateWid.c:
/* Create actual widget */
widget_info->widget = (*widget_class_info->proc_CreateWidget)
(parent_info->widget,args,nargs);
XmNlistVisibleItemCount here is still 8 because above line will set all the
resource to default, you can get this value and print it out to demo.
XmNlistVisibleItemCount will be changed to be 3 after this line of code:
XtRealizeWidget(widget_info->widget);
Here is the code for function XtRealizeWidget:
{
if (XtIsRealized (widget)) return;
CallChangeManaged(widget);
RealizeWidget(widget);
}
CallChangeManaged(widget) will set XmNlistVisibleItemCount to 0. You
can use the following block after CallChangeManaged(widget) to check:
{
Arg myArg[1];
int ac;
XrmName newArgName;
XrmResourceList *res, *xrmres;
Cardinal num_resources;
char* base;
int i;
WidgetClass wc = XtClass(widget);
res = (XrmResourceList *) wc->core_class.resources;
num_resources = wc->core_class.num_resources;
newArgName = StringToName("listVisibleItemCount");
for (xrmres = res, i = 0; i < num_resources; i++, xrmres++) {
if (newArgName == (*xrmres)->xrm_name) {
base = (char *) widget;
X/Open Waiver Reference: Page: 4
WAIVER DOCUMENT X/Open Waiver Reference:
_XtCopyToArg(
base - (*xrmres)->xrm_offset - 1,
&myArg->value,
(*xrmres)->xrm_size);
printf("XtRealizeWidget listVisibleItemCount before RealizeWidget %d 0,
myArg->value);
break;
}
}
}
RealizeWidget(widget) will set XmNlistVisibleItemCount to the actual
value according to XmText widget component size.
"CallChangeManaged(widget)" will eventually call related function in Xt lib
Shell.c for WMShell which is the ancester of DialogShell( DialogShell widget
is the parent of BulletinBoard, and on BulletinBoard to put the
XmSelectionDialog widget) to compute the size of the selection dialog box.
Because 125x125 is too small, so the geometry manager will change it to a bigger
size, in my case is 125x425. At this state, the system is not consistant,
XmNlistVisibleItemCount of the selection dialog box widget is still 8, the
XmNvisibleItemCount of list widget is 3, from function
_XmSelectionBoxGetListVisibleItemCount
of above you can see that we return XmNvisibleItemCount of list widget for
XmNlistVisibleItemCount of the selection dialog box widget if you try to get
the resource XmNlistVisibleItemCount of the selection dialog box widget, and
this is what the test case is doing.
We think we should not change function
_XmSelectionBoxGetListVisibleItemCount, although we can change this function to
the following and get around, it's not good:
void
#ifdef _NO_PROTO
_XmSelectionBoxGetListVisibleItemCount( wid, resource_offset, value )
Widget wid ;
int resource_offset ;
XtArgVal *value ;
#else
_XmSelectionBoxGetListVisibleItemCount(
Widget wid,
int resource_offset,
XtArgVal *value )
#endif /* _NO_PROTO */
{
XmSelectionBoxWidget sel = (XmSelectionBoxWidget) wid ;
int data ;
Arg al[1] ;
/****************/
X/Open Waiver Reference: Page: 5
WAIVER DOCUMENT X/Open Waiver Reference:
if( SB_List( sel) )
{
data = SB_ListVisibleItemCount(sel);
*value = (XtArgVal) data ;
}
return ;
}
The above change can work fine for this test case, because here later
it will try to set some other resouces' values, so the system will call
SetValues function of SelectioB.c eventually, and this function will reset
XmNvisibleItemCount of list widget according to the XmNlistVisibleItemCount
of the whole selection dialog box widget, and because it will be set to 8
instead of current value 3, the whole selection dialog box widget will blow up,
here is the code in function SetValues to set list widget XmNvisibleItemCount:
(Xm SelectioB.c)
.................................................
if (new_w->selection_box.list_visible_item_count !=
#ifndef OSF_v1_2_4
current->selection_box.list_visible_item_count)
{
XtSetArg (al[ac], XmNvisibleItemCount,
new_w->selection_box.list_visible_item_count); ac++;
#else /* OSF_v1_2_4 */
current->selection_box.list_visible_item_count) {
XtSetArg (al[ac], XmNvisibleItemCount,
new_w->selection_box.list_visible_item_count); ac++;
#endif /* OSF_v1_2_4 */
}
#ifndef OSF_v1_2_4
if (ac)
{
if (SB_List (new_w))
XtSetValues (SB_List (new_w), al, ac);
#else /* OSF_v1_2_4 */
if (ac) {
if (SB_List (new_w))
XtSetValues (SB_List (new_w), al, ac);
new_w->selection_box.list_items = NULL ;
#endif /* OSF_v1_2_4 */
}
..................................................
How about the case that the users just give a very small size for the
Shell widget and don't call XtSetValues? If we make the above change in function
_XmSelectionBoxGetListVisibleItemCount
the users will get a wrong result if you compare the result with the dialog
box, because the list widget can only list 3 items and the dialog box will not
blow up.
X/Open Waiver Reference: Page: 6
WAIVER DOCUMENT X/Open Waiver Reference:
If we do make a change, instead of make changes in function
_XmSelectionBoxGetListVisibleItemCount, assume we can make a change in
XtRealizeWidget function's RealizeWidget to keep selection dialog box's
XmNlistVisibleItemCount same as XmNvisibleItemCount(I am not sure that we must
be able to do so.), then we will get an ugly selection dialog box displayed,
if the user call XtSetValues to set some resouces other than
XmNlistVisibleItemCount, this ugly dialog box will not be changed, this is not
not a good interface.
So I think instead of change the Xm or Xt lib file, it's better to
modify VSM4 itself. We don't want to break the consistence of GUI.
To get around this problem, just set the size to be 500*500 instead of
125*125 in ../vsm4/src/mvslib/resources/mvsSetUpGlob.c's function
mvsSetUpGlobalArgs.Review Information
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Test Suite Deficiency (TSD) Review Conclusion
This is an agreed Test Suite Deficiency.
Problem Reporting System Options:
- View Report 2188
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority