Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Help: Problems with Motif 1.2.4
@ 1996-04-23  4:00 Jay Brack
  1996-04-26  4:00 ` Chuck Dillon
  0 siblings, 1 reply; 4+ messages in thread
From: Jay Brack @ 1996-04-23  4:00 UTC (permalink / raw)



We are switching multiple applications from DEC Alphas
running OSF/1 V1.3 (and Motif V1.1.3) to Digital UNIX V4.0
(and Motif 1.2.4). We've noticed some differences in the
operation of some widgets.  In particular:

   	1.	I-beam cursors in text widgets
		In 1.1.3, the cursor appears only when the text widget
		has focus, whereas in 1.2.4, the cursor appears in all
		text widgets, whether active or not.  Though the cursor
		can be completely eliminated using the XmNcursorPositionVisible
		resource, it is useful for text insertion.


	2.	Return (Enter) key button activation
		In 1.1.3, a pushbutton can be activated by pressing
		either the Return key or the spacebar when the button
		has focus.  In 1.2.4, only the spacebar works.  Attempts
		to override the Return key translations don't have any
		effect (although translation override works with other keys,
		such as "a").  An example program is provided below.


	3.	Focus selection
		In a form containing a scrolled window in turn containing
		a text widget with a horizontal scrollbar above it, the
		XmNdefaultButton resource of the outer form is used to
		set the focus to the text widget on startup.  In 1.1.3,
		it does just this.  In 1.2.4, the focus goes to the
		scrollbar.  An example program for this is shown below.

We have a sizable installed base and would like to provide
continuity between versions. We have beem unable to find
any way duplicate the 1.1.3 functionality under 1.2.4.  Any
information concerning these issues would be most welcome.

Example code follows:
-----------------------------------------------------------------
/*
	button_demo - Example for translation behavior

	The purpose of this example is to illustrate the difference
	in button behavior between Motif versions 1.1.3 and 1.2.4 with
	respect to keyboard activation.  When it has focus, in 1.1.3,
	the button can be activated by pressing either the Return
	(Enter) key or the spacebar.  In 1.2.4, only the spacebar works.
	Attempts at overriding the translation for the Return key to add
	this action have so far been unsuccessful.

	The program is compiled and linked using the following command
	line:

		cc -o button_demo button_demo.c -lXm -lXt -lX11
*/

#include <Xm/RowColumn.h>
#include <Xm/PushB.h>

/******************************************************************/
/*
	Program exit callback function
*/

static	void	bye()

{

	exit(0);
}
/******************************************************************/
/*
	This small demo program just makes a pushbutton, which when pressed,
	exits the program.
*/

main(argc,argv)

int					argc;
char				*argv[];

{

XtAppContext		app;
Widget				toplevel, rowcol,
					button;

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

	rowcol = XtVaCreateWidget("rowcol",
	  xmRowColumnWidgetClass,toplevel,
	  XmNentryAlignment,XmALIGNMENT_CENTER,
	  NULL);

	button = XtVaCreateManagedWidget(
	  "Done", xmPushButtonWidgetClass,
	  rowcol,NULL);

	XtAddCallback(button,
	  XmNactivateCallback,bye,NULL);

	XtManageChild(rowcol);
	XtRealizeWidget(toplevel);

	XtAppMainLoop(app);
}

	-----------------------------------------------------------------

/*
	focus_demo - Example for focus behavior

The purpose of this example is to illustrate the difference
in keyboard focus behavior between Motif versions 1.1.3 and
1.2.4.  A text widget is placed within a scrolled window with
a horizontal scrollbar above the text widget.  The XmNdefaultButton
resource of the container form is used to set the initial keyboard
focus to the text widget.  In 1.1.3, it works; in 1.2.4, the focus
goes to the scrollbar.

The program is compiled and linked using the following command
line:

		cc -o focus_demo focus_demo.c -lXm -lXt -lX11
*/

#include <Xm/Form.h>
#include <Xm/ScrolledW.h>
#include <Xm/Text.h>

/******************************************************************/
/*
	This small demo program just makes a text widget in a scrolled
	window.
*/

main(argc,argv)

int					argc;
char				*argv[];

{

XtAppContext		app;
Widget				toplevel, scrollw,
					bigform, form, text;

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

	bigform = XtVaCreateWidget("bigform",
	  xmFormWidgetClass,toplevel,
	  NULL);

	scrollw = XtVaCreateWidget("scroll",
	  xmScrolledWindowWidgetClass,bigform,
	  XmNscrollBarPlacement,XmTOP_LEFT,
	  XmNscrollingPolicy,XmAUTOMATIC,
	  XmNtopAttachment,XmATTACH_FORM,
	  XmNleftAttachment,XmATTACH_FORM,
	  XmNrightAttachment,XmATTACH_FORM,
	  XmNbottomAttachment,XmATTACH_FORM,
	  NULL);

	form = XtVaCreateWidget("form",
	  xmFormWidgetClass,scrollw,
	  NULL);

	text = XtVaCreateManagedWidget("text",
	  xmTextWidgetClass,form,
	  XmNhighlightOnEnter,True,
	  XmNtopAttachment,XmATTACH_FORM,
	  XmNleftAttachment,XmATTACH_FORM,
	  XmNrightAttachment,XmATTACH_FORM,
	  XmNbottomAttachment,XmATTACH_FORM,
	  NULL);

	XtVaSetValues(bigform,
	  XmNdefaultButton,text,
	  NULL);

	XtManageChild(form);
	XtManageChild(scrollw);
	XtManageChild(bigform);
	XtRealizeWidget(toplevel);

	XtAppMainLoop(app);
}

--
------------------------------------------------------------------------------
 Jay Brack (brack@nm.picker.com)
 The opinions expressed herein are not understood by my employer.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1996-04-29  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-04-23  4:00 Help: Problems with Motif 1.2.4 Jay Brack
1996-04-26  4:00 ` Chuck Dillon
1996-04-29  4:00   ` Jason Mann
1996-04-29  4:00     ` Tom Schutter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox