Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

paned windows (was GUI separation...)

7 views
Skip to first unread message

Bill

unread,
Jul 25, 2009, 7:31:41 AM7/25/09
to
Sorry for the delay. Here are a couple programs that demonstrate
paned window differences between older Motif's and 2.3.2. I got the
2.3.2
files via CVS on 24-Jul-09.


/* in 2.2.3 button2 is at the top, but in 2.3.2 button1 is at the top
*/

#include <Xm/XmAll.h>

int main(int argc, char **argv)
{
Arg args[12];
Widget shell, pane, button1, button2, top;
XtAppContext app;

XtSetArg(args[0], XmNallowShellResize, True);
shell = XtOpenApplication(&app, "pane", NULL, 0, &argc, argv, NULL,
applicationShellWidgetClass, args, 1);
pane = XtCreateManagedWidget("pane", xmPanedWindowWidgetClass,
shell, NULL, 0);

XtSetArg(args[0], XmNpositionIndex, XmLAST_POSITION);
button1 = XtCreateManagedWidget("button1", xmPushButtonWidgetClass,
pane, args, 1);

XtSetArg(args[0], XmNpositionIndex, 0);
button2 = XtCreateManagedWidget("button2", xmPushButtonWidgetClass,
pane, args, 1);

XtRealizeWidget(shell);
XtAppMainLoop(app);
return(0);
}

/* in 2.2.3 there is a movable sash between the buttons, but in 2.3.2
there's just a separator */

#include <Xm/XmAll.h>

int main(int argc, char **argv)
{
Arg args[12];
Widget shell, pane, button1, button2, top;
XtAppContext app;

XtSetArg(args[0], XmNallowShellResize, True);
shell = XtOpenApplication(&app, "pane", NULL, 0, &argc, argv, NULL,
applicationShellWidgetClass, args, 1);
pane = XtCreateManagedWidget("pane", xmPanedWindowWidgetClass,
shell, NULL, 0);

XtSetArg(args[0], XmNpaneMaximum, 1); /* 2 here gets the old
behavior */
button1 = XtCreateManagedWidget("button1", xmPushButtonWidgetClass,
pane, args, 1);
button2 = XtCreateManagedWidget("button2", xmPushButtonWidgetClass,
pane, args, 0);

XtVaSetValues(button1, XmNpaneMaximum, 100, NULL);

XtRealizeWidget(shell);
XtAppMainLoop(app);
return(0);
}


0 new messages