I would like to report several problems I have encountered with
XFree86 X/Motif in porting an application that is currently
correctly running on a Silicon Graphics computer under Irix.
On the SGI computer X/Motif is based on X11R6.

I have observed different behavior and problems that prevent my
application from running correctly under Linux with XFree86.

I would first like to ask.  Is XFree86 a port of X/Motif code from
the Open Software Foundation to Linux, or is it a reimplementation?
If the same code is ported I would expect the same behavior.  It
was my understand that to port X only a subset of the code has
to be rewritten to accommodate a particular computer architecture.
If a reimplementation, than that would explain the difference in
behavior perhaps.

I bought RedHat Professional 7.2 with the Linux kernel 2.4.7 and
XFree86 4.1.0

---------------------------------------
The first problem is the most serious and prevents correct operation
of my X/Motif user interface.  The user interface creates
popups in separate dialog boxes when the function does not
fit the space otherwise reserved for the user interface.
Some of these dialogs must be full application modal (see pages
151-159, example on page 158, Volume Six A, Motif Programming for
OSF/Motif Release 1.2) as I must block the user from doing anything
other than respond to the popup.

In code I have:

int n;
Arg args[10];

n = 0;
long functions = MWM_FUNC_ALL;  // puts all in
functions  |= MWM_FUNC_CLOSE;   // takes out the close.
// SECOND BIG PROBLEM, I STILL GET THE X
XtSetArg(args[n], XmNmwmFunctions, functions); n++;

// see page 136, VOL 6A.  If user selects CLOSE on the title bar,
// widgets are destroyed.
XtSetArg(args[n], XmNdeleteResponse, XmDESTROY); n++;

dialog_shell =  XmCreateDialogShell( Top_Level_Widget,
                  (char * ) dia_name.GetString(),
                  args,n);

n = 0;
//entire application blocked.  FIRST BIG PROBLEM, THIS DID NOT WORK.
XtSetArg(args[n], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); n++;

dialog_form =  XtCreateWidget("ListSelectDialog",
                   xmFormWidgetClass,
                   dialog_shell, args,n);

// *************** the list label *************************

Widget list_label;
n=0;
XtSetArg(args[n], XmNleftAttachment,   XmATTACH_FORM); n++;
XtSetArg(args[n], XmNtopAttachment,    XmATTACH_FORM); n++;
XtSetArg(args[n], XmNrightAttachment,  XmATTACH_FORM); n++;
list_label =  XtCreateWidget(label_name.GetString(),
                 xmLabelWidgetClass,
                 dialog_form, args,n);

// THIRD PROBLEM occurs here intermittently unless I always
// manage this label widget.
if( label_name.GetLen() > 0) XtManageChild(list_label);

// ***************** list section ***************
n=0;
XtSetArg(args[n], XmNleftAttachment,  XmATTACH_FORM); n++;
XtSetArg(args[n], XmNtopWidget,   list_label); n++;
XtSetArg(args[n], XmNtopAttachment,  XmATTACH_WIDGET); n++;
XtSetArg(args[n], XmNrightAttachment,   XmATTACH_FORM); n++;
...

On the SGI computer application modal work, the other buttons and
widgets on the main window of the application cannot be manipulated.

But on Linux, application modal does not work.  I can push other
buttons, menus, etc..

Another second problem is that in the above code I take out the close
button
that is on the window frame.  Page 136 of Volume Six A states that one
cannot install any callback routine for the menu items that are on
the window frame.  But on Linux
there is still this big "X" in the upper right hand corner of the popup
window which allows one to close the window, thus by passing the
callback
for my Cancel button, which I can't allow to happen.  [Aside: I thought
the
"X" was a MicroSoft Windows thing, I am surprised to see it here.]


Another third problem that occurred with this popup, the first of about
104
popups in the application, is that it came up totally messed up, the
top of the popup at the top of my screen going down and off the bottom
of
the screen (so I guess it was a good thing I had the X).  By X'ing it
off and recreating it again I discovered that it sometimes worked OK,
about half and half.  By trial and error I discovered that if I always
managed the  label that was in this popup, it always works OK.  But
I do not have to always manage this label on SGI.  The label
is the next widget created above.  Note the following widget does
attach to it.  Having unmanaged widgets within a form widget was never
a problem before.

It is not going to be a trivial pursuit for me to rewrite my
application to make this work on Linux with XFree86.  If
XFree86 is a reimplementation, is there any actual port of OSF
X/Motif available for Linux from another source?  I am
aware of XiGraphics (www.xig.com) but have not quite figured out
yet what they are offering.


Another fourth problem occurred during the creation of a
xmDrawingAreaWidgetClass widget.   The drawing area is inside
a frame widget (XmFrame), and as such always comes up filling the frame.

I did not have to specify the width and length of the drawing area
widget.
But with XFree86 my program bombs at this point with the message that
a widget has zero width or height.

The code is:

n = 0;
XtSetArg(args[n], XmNchildType, XmFRAME_WORKAREA_CHILD); n++;
drawarea_widget = XtCreateManagedWidget("",
         xmDrawingAreaWidgetClass,
         frame_parent, args,n);


if I insert a width and height, any width and height, the program
at least does not bomb, i.e. add the arguments:

XtSetArg( args[n], XmNwidth, 10); n++;
XtSetArg( args[n], XmNheight, 10); n++;

The effect is then to get a small drawing area inside the frame.
If I change the size of the window containing the frame even slightly,
the drawing area pops to fill the frame correctly.  A work around is
to get the width and height of the frame widget parent and set
those.  But there are other cases when the drawing area is inside
a form widget and I cannot get the correct size to come up
initially.


This is all from the first day of reviewing the application recompiled
and relinked for Linux.  I have not even reviewed the rest of the
application but all ready I'm in a lot of trouble with this project.

I would appreciate any help or suggestions anyone would have.

  Thank you,
 Wendel Dean Renner

_______________________________________________
Newbie mailing list
[EMAIL PROTECTED]
*** To unsubscribe , or change message options, see:
http://XFree86.Org/mailman/listinfo/newbie

Reply via email to