HDTenEightyP/NetNews huggingface dataset:
From: chien@iitmax.iit.edu (Greg Chien)
Subject: SUMMARY: focusCallback and activate() for TextField widget
Keywords: focus, activate, text, textField
Organization: Illinois Institute of Technology / Academic Computing Center
Date: Thu, 20 Aug 92 03:03:05 GMT

This is a summary of a previous question I posted.  Thanks to the following
people who provided the answers and suggestions:

  dob@inel.gov (Dave Brooks)
  langman@hsacsd.signaal.nl (Langman Daslre)
  prasad@nssdca.gsfc.nasa.gov (Prasad Erabelli)
  Alexandre Kardanev <kardanev@dxcern.cern.ch>
  ramakris@csgrad.cs.vt.edu (S.Ramakrishnan)
  rrybacki@ringer.cs.utsa.edu (Richard M. Rybacki)
  Carl Scholz <scholz@osf.org>
  ssloter%road_runner@Sun.COM (Scott Sloter)
  Gareth B Smith <gbs@comp.lancs.ac.uk>

The Question:
> When does a TextField (or Text) widget generate an activateCallback?
> I am trying to detect when a TextField is highlighted (or focused)
> but the Motif widget generates only losingFocus and other
> modification callbacks.  How does one get a callback on entering
> rather than on leaving the widget?

Scholz wrote:

The Text widget has a resource XmNfocusCallback which is what you are
looking for (its the opposite of losingFocusCallback - see the XmText
manpage).  Unfortunately, in all 1.1 versions of Motif, this
functionality is missing for the TextField.  It is there in 1.2.  The
workaround is to use a Text widget instead of a TextField widget.

Kardanev wrote:

As for activateCallback - it depends on what widget do you use.
For Text and TextField widgets this callback activate when
KActivate button pressed (default value - <CR>) but you can
change this translation.

Langman wrote:

The XmText widget has an activate() action which calls the
activateCallback functions. If you're not working with the
XmTextField widget & the editing mode of your widget is
multi_line_edit, you'll have to put it in the translations
of the widget yourself (which is probably what you want):

	*XmText.translations: #override \
		<Enter>: activate()

Ramakrishnan wrote:

You can Use translation table ato get this:
   *text.translations: "#augment\n\
        EnterWindow: my-function();"

Greg
----
===========================================================================
| Greg T.H. Chien                       It is engineered, not designed.   |
| 60 E. 32nd St. #401                      BITNET:   THSSCHIEN@IITVAX     |
| Chicago, IL 60616                        Internet: chien@iitmax.iit.edu |
===========================================================================
-- 
===========================================================================
| Greg T.H. Chien                       It is engineered, not designed.   |
| 60 E. 32nd St. #401                      BITNET:   THSSCHIEN@IITVAX     |
| Chicago, IL 60616                        Internet: chien@iitmax.iit.edu |
===========================================================================
From: lrg@cathedral.cerc.wvu.wvnet.edu (Laxma R. Garlapati)
Newsgroups: comp.windows.x.motif
Subject: Help on XmNmnemonic
Date: 21 Aug 92 18:31:14 GMT

Hi: 
     I am trying to set a mnemonic to a pushbutton using the fallowing 
statement.
	XtSetArg(args[n], XmNmnemonic, 'Q'); n++;

I can see the Underscore beneath the Q letter of the quit button that I have,
but when I press Meta-Q, nothing happens. Anyu help is appreciated.

If you can mail to my email address that would be great.

email: lrg@cerc.wvu.wvnet.edu


--

================================================================================
Laxma R.Garlapati
lrg@cerc.wvu.wvnet.edu
From: johns@trident.datasys.swri.edu (Stephen Johns)
Newsgroups: comp.windows.x.motif
Subject: Resize info from MWM to client
Keywords: resize protocol
Date: 13 Aug 92 22:32:34 GMT
Organization: Southwest Research Institute, San Antonio, Texas

What is the "proper" way to handle resize events under Motif?
I have a main window which contains a form which contains a drawing area
and some other stuff.  Conceptually like:

main window {
  form {
    drawing area
    scroll bar
    scroll bar
    label
    label
    etc.
  }
}

When the window is resized with the mouse I want to expand the drawing area
and rearrange the other widgets.  What is the proper way to detect the resize
and what is the proper way to resize the drawing area.

I tried using and event handler, and that worked ok, but when I would use
XtSetValues to resize the drawing area, that would generate another resize
event... ad nauseum.

Now I am trying the following, but it is not detecting any resize at all, should
this work?


	Atom
		WM_RESIZE_WINDOW_ATOM;	/*	A protocol atom for the window manager
								 *	resize.
								 */
/*
 *	Add the callback to handle the resize information from the window manager.
 */

	WM_RESIZE_WINDOW_ATOM = XmInternAtom ( XtDisplay ( Map_table[a].shell ),
										   "MW_RESIZE_WINDOW", FALSE );
	XmAddWMProtocolCallback ( Map_table[a].shell, WM_RESIZE_WINDOW_ATOM,
							  resize_map_cb, NULL );

Any help greatly appreciated.
-- 
Stephen Johns, Research Analyst
Southwest Research Institute, SA, TX 78228 (512) 522-5751
From: boonshim@swl.spec.ptg.sony.co.jp (Lee Boon Shim [dBS] 065-776-5858)
Newsgroups: comp.windows.x.motif
Subject: XmDialogShell resize when it parent(XmForm) is resized
Date: 20 Aug 92 10:40:40 GMT
Distribution: inet
Organization: The Internet

Hi !!

I have an application with the following simplified construct

    XtApplicationShell top {
        XmForm board {
	    XmBulletinBoard1 tool1 {
		...
	    }
	    XmBulletinBoard2 tool2 {
		....
	    }
	    .
	    .
	    .
	    XmDialogShell load {
		XmBulletinBoard box {
		    ...
		}
	    }
	}
    }

The problem is ...

When "load" is popup to receive user input, it will be resized auto-
matically to roughly the size of application when it parent "board" is
being resized. Since then, it will follow the size of parent whenever
"board" is resizing.

I suspect XmForm sends resize request to all its children, am I
correct ? If so, how to stop such request, else please advise me how
to keep the size of "load" fixed to it original size. I have tried the
following resouce setting in resource file but failed.

*load*resizable:		False		// failed
*load*resizePolicy:		XmRESIZE_NONE	// failed
*load*noResize:			True		// failed
*load*allowShellResize:		False		// failed

Thanks in advanced for any hint and/or advice.
 _____   __    __  _____
(  _  \ (  \  /  )(  ___) Lee Boon Shim (dBS),
| (_)  ) \  \/  / | |__   Software R&D Laboratory
|  _  <   \    /  |  __)  Sony Precision Engineering Center (Singapore) Pte Ltd
| (_)  )   |  |   | |___  (@ 65-776-6868, Fax: 65-779-5657.
(_____/    (__)   (_____)

------- End of Forwarded Message
 _____   __    __  _____
(  _  \ (  \  /  )(  ___) Lee Boon Shim (dBS),
| (_)  ) \  \/  / | |__   Software R&D Laboratory
|  _  <   \    /  |  __)  Sony Precision Engineering Center (Singapore) Pte Ltd
| (_)  )   |  |   | |___  (@ 65-776-6868, Fax: 65-779-5657.
(_____/    (__)   (_____)

Newsgroups: comp.windows.x.motif
From: prem@prem.lbl.gov (Shirdi R. Prem)
Subject: Re: Passing more than one widget to a callback
Keywords: n
Reply-To: prem@prem.lbl.gov (Shirdi R. Prem)
Organization: Lawrence Berkeley Laboratory
Date: Wed, 19 Aug 1992 17:28:32 GMT

In article <1992Aug19.161141.24141@sj.nec.com> achan@idaho.tdd.sj.nec.com (Amy Chan  x2941) writes:
>In article <19843@leadsv.UUCP> mcfar@leadse5.UUCP (Lincoln McFarland) writes:
>>I was wondering if it is possible to pass more than one widget to a call
>>back using a user defined data structure like:
>>
>>/* structure to pass mulitple widgets to call back */
>>typedef struct {
>>  Widget flnm;   /* filename */
>>  Widget sr;     /* sample rate */
>>} data_bus;
>>
>>/* create input selector function */
>>Widget create_sass_selector( filename_display, sr_display )
>>Widget filename_display; /* widget to display selected filename */
>>Widget sr_display;       /* widget to display sample rate */
>>{
>>  extern Widget toplevel; /* defined in ir.h */
>>
>>  Widget select_dialog;
>>
>>  data_bus input_display;
>>
>>  Arg al[10];
>>  int ac;
>>
>>  input_display.flnm = filename_display;
>>  input_display.sr   = sr_display;
>>
>>  /* create the file selection box dialog widget */
>>  ac = 0;
>>
>>  select_dialog = XmCreateFileSelectionDialog( toplevel,
>>                                              "select_input", al, ac);
>>
>>  XtAddCallback( select_dialog, XmNokCallback, sass_ok_CB, data_bus);
>>  XtAddCallback( select_dialog, XmNcancelCallback, sass_cancel_CB, 0);
>>
>>  return select_dialog;
>>
>>} /* end create_sass_selector() */
>
>
>You have to pass a pointer to your data structure data_bus instead of
>the structure itself. Try doing:
>
>XtAddCallback(select_dialog, XmNokCallback, sass_ok_CB, (XtPointer)&data_bus);

	Shouldn't you be passing &input_display instead of &databus ??
	I thought databus was the name you gave to your struct-type, and
	input_display was an instance of that type........... or did I
	miss something here...

	Prem!

Newsgroups: comp.windows.x.motif
From: schnepp@nodecg.ncc.telecomwa.oz.au (Tom Schnepple)
Subject: Wait cursor, Accelerator keys and MWM menu
Organization: Network Computer Centre
Date: Sun, 23 Aug 1992 02:08:51 GMT

Wait cursor, accelerator key and MWM menu

PROBLEM 1 - Wait Cursor:
I have written a script file to start up a series of applications when 
executed. The time taken to execute this script is lengthy (2 minutes). 
I need someway of indicating to the user that they need to wait. I thought
of turning the cursor to a hour glass. Does any know how to do this within 
a script file without having to write a program for it??

PROBLEM 2 - accelerator key
I need to have two accelerator keys to a single menu option. ie: F10 and 
shift F10. Why do I need it, you may ask?? - I have defined an accelerator
for each of my menu option, however, whenever the CAPS LOCK is ON, the
accelerator key does NOT work because the system inteprets the Key Pressed 
as Shift Key_Pressed. This is annoying for the user having to remember to
turn ON/OFF the CAPS LOCK key. 
I do NOT want to bind the two accelerator keys because our computer is 
used to run other applications as well!

PROBLEM 3 - MWM menu
I want to disable the MWM menu for my application only. Does any one know
how I could achieve this without having to disable the MWM menu for all
applications?


     _--_|\    Tom Schnepple  (schnepp@telecomwa.oz.au) 
    /      \   Perth, Western Australia
--> *_.--._/ 
          v
From: nazgul@alfalfa.com (Kee Hinckley)
Newsgroups: comp.windows.x.motif
Subject: Re: WordWrap possible?
Date: 21 Aug 92 23:53:55 GMT
Distribution: inet
Organization: The Internet

> Hi,
> 
> I would like to use the Scrollable TextEditor Widget as a simple text editor
> with word wrap. Unfortunately there seems to be no way to accomplish this
> by resource since "XmNscrollHorizontal, False" results in a rude linebreaking
> at any point, not only at blanks or dashes.
> 
> Is there a ShareWare Source anywhere that implements this feature?

I have source that will make XmText do wordwrap wherever and whenever you
want - with real line breaks.

nazgul@alfalfa.com
617/646-7703 voice/fax

If Unix is the answer, then we've clearly forgotten the question.
Newsgroups: comp.windows.x.motif
From: shmdgljd@rchland.vnet.ibm.com (Jay Schmidgall)
Subject: Re: Parent resource name of Conveniently created dialogs?
Date: Wed, 12 Aug 1992 11:58:50 GMT
Reply-To: jay@vnet.ibm.com
Disclaimer: This posting represents the poster's views, not necessarily those of IBM
Organization: IBM Rochester, MN

Um, XtParent() ?

Note, though, that "setting XmNheight, XmNwidth or XmNborderWidth for
either a XmDialogShell or its child sets that resource to the same value
in both the parent and the child.  An application should always specify
these resources for the child, not the parent." (OSF/Motif Prog. Ref,
Revision 1.1.3, I think)
-- 
: jay          jay@vnet.ibm.com    My opinions and ideas, not my employer's.
: shmdgljd@rchland.vnet.ibm.com    (c) Copyright 1992.  All rights reserved.
Newsgroups: comp.windows.x.motif
From: eckstein@bean.ISD.Uni-Stuttgart.DE (knut eckstein )
Subject: Trouble dumping a Motif Application for Docs
Organization: Dept. for Statics & Dynamics of Aerospace Structures (ISD)
Date: Fri, 21 Aug 1992 15:10:00 GMT

Hi networld,

now that my program works fine I would like to include some pictures of it
in my report. For some reason I would like to show a picture with a pulldown
menu posted so that it's items can be seen. The catch is that as soon
as I post the menu by clicking or using accelerators the focus
gets "grabbed" by my program, i.e. there is no way typing a command
like xwd -out blabla.xbm into a terminal window. As soon as I click
anywhere on the screen the menu gets unposted :(

Well, I tried to be *real* clever and started my program on another
machine with the DISPLAY variable being set to the original machine,
posted the menu and then typed C-Z on the other machine to stop the
program and dump the window. But guess what happened: The focus
remains grabbed and I can't do anything with my mouse on the original
machine until I revive my program on the other machine :((

Now there *must* be a way to do it. I've seen so many pictures like
the ones I need in computer magazines!

Any pointers are greatly appreciated!

Knut

PS: I use Motif 1.0 (including all the *original* bugs) on a DN 3500 running
    X11 R3 (sigh)

-- 
Knut Eckstein  
WORK:  ISD,  Pfaffenwaldring 27, W-7000 Stuttgart 80, 0711/685-20 53, FRG
HOME:  Pfaffenwaldring 68 A 2.4, W-7000 Stuttgart 80, 0711/687 58 63, FRG
EMail: eckstein@bean.isd.uni-stuttgart.de
From: dennis@metw3.met.fu-berlin.de (Dennis Schulze)
Newsgroups: comp.windows.x.motif
Subject: Help needed (Creating new window)
Date: 21 Aug 92 14:06:06 GMT
Organization: Free University of Berlin

Hi,

I have a problem and I hope that somebody may help me. If this should be
a FAQ then please forgive me!

I'm using X11R4 and Motif 1.1 on a HP 9000/835. I created a DrawingArea
and some PushButtons inside a Form widget. Now, I want to create a new
window with also a DrawingArea inside when one of the PushButtons is 
activated. How can I do this???

Any help would be greatly appreciated,

  Dennis
---
Dennis Schulze                               Free University of Berlin
Johannisthaler Ch. 361                       Department of Meteorology
W - 1000 Berlin 47                       dennis@metw3.met.fu-berlin.de
Germany                               dennis@marie.physik.tu-berlin.de
From: smith@beech.NoSubdomain.NoDomain (Robert Smith)
Newsgroups: comp.windows.x.motif
Subject: How can I change fg and bg in label's pixmap
Date: 19 Aug 92 20:31:03 GMT
Article-I.D.: gvl.1992Aug19.203103.3481
Organization: Paramax Systems

I am trying to exchange foreground and background colors in a label widget
with type set to pixmap.  I can do it if the label widget is of type string
by using XtSetValues to change background and foreground and forcing an
expose event.  This will not work when I use a pixmap.  I've tried getting
the pixmap and doing a XCopyArea with a gc with reversed foreground and
background and setting the label widget's pixmap to this new pixmap.

This was easy to do with Athena widgets. 

Does Motif permit this?

Thanks.

  Bob Smith
  M/S CAIT GVL #1              smith@prc.unisys.com
  Paramax Systems Corp.        (A Unisys Company)
  70 E Swedesford Rd.          Phone: +1 215 648-2402
  Paoli, PA. 19301             FAX:   +1 215 648-2288
Newsgroups: comp.windows.x.motif
From: devin@gandalf.colorado.edu (Sonja Orlavski)
Subject: XmStringDraw causes BadFont error
Followup-To: comp.windows.x.motif
Keywords: XmStrings, AAAAAGH!
Organization: Colorado Center for Astrodynamics Research
Date: Mon, 17 Aug 1992 22:07:08 GMT

Basic info:  OSF Motif 1.1.2, DECstation/Ultrix 4.2a.

I'm attempting to use XmStringDraw.  I've defined a fontList
which looks like this:

TSho*Image.fontList: \
-*-courier-*-r-*-*-10-*-*-*-*-*-*-*=ImageCS-0, \
-*-courier-*-r-*-*-12-*-*-*-*-*-*-*=ImageCS-1, \
-*-courier-*-r-*-*-14-*-*-*-*-*-*-*=ImageCS-2, \
-*-courier-*-r-*-*-18-*-*-*-*-*-*-*=ImageCS-3, \
-*-courier-*-r-*-*-24-*-*-*-*-*-*-*=ImageCS-4, \
-*-symbol-*-r-*-*-10-*-*-*-*-*-*-*=ImageCS-5, \
-*-symbol-*-r-*-*-12-*-*-*-*-*-*-*=ImageCS-6, \
-*-symbol-*-r-*-*-14-*-*-*-*-*-*-*=ImageCS-7, \
-*-symbol-*-r-*-*-18-*-*-*-*-*-*-*=ImageCS-8, \
-*-symbol-*-r-*-*-24-*-*-*-*-*-*-*=ImageCS-9

and I've got an XmString that's using a charset of "ImageCS-0".

Right before I call XmStringDraw I call dump_fontlist, which
prints something like this:

fontlist[  0]
        font = 269447040
        charset = <ImageCS-0>
fontlist[  1]
        font = 269770752
        charset = <ImageCS-1>
fontlist[  2]
        font = 269770880
        charset = <ImageCS-2>
fontlist[  3]
        font = 269771008
        charset = <ImageCS-3>
fontlist[  4]
        font = 269771136
        charset = <ImageCS-4>
fontlist[  5]
        font = 269771264
        charset = <ImageCS-5>
fontlist[  6]
        font = 269771392
        charset = <ImageCS-6>
fontlist[  7]
        font = 269771648
        charset = <ImageCS-7>
fontlist[  8]
        font = 269771520
        charset = <ImageCS-8>
fontlist[  9]
        font = 269771776
        charset = <ImageCS-9>

So it looks like I'm getting a proper fontlist.  However,
when I get into XmStringDraw, I get an XError like this:

X Error of failed request:  BadFont (invalid Font parameter)
  Major opcode of failed request:  56 (X_ChangeGC)
  Resource id in failed request:  0xffffffff
  Serial number of failed request:  2731
  Current serial number in output stream:  2731


My call to XmStringDraw looks like this:

  XmStringDraw(XtDisplay((Widget)iw), XtWindow((Widget)iw), fontList,
	       tb->text, iw->image.textGC, tb->x, tb->y,
	       XmStringWidth(fontList, tb->text),
	       XmALIGNMENT_BEGINNING, XmSTRING_DIRECTION_L_TO_R, NULL);

Where iw is a custom Widget, fontList is an XmFontList, and tb->text
is an XmString.

If anyone has any suggestions, I'd be grateful.

			-Devin

-- 
Devin Hooker (RP90)  (SotM 7/91)  DoD #0034  devin@boulder.colorado.edu  ------
"It's being both that's a bitch."                                      --\--- /
"I wanted to take my brain to hell and back and see what I had left."  \  \ //
"This howling in the distance, it's a captivating sound.                \  \/
        Can't tell if it's ecstasy or pain..."  -DW                      \/
Newsgroups: comp.windows.x.motif
From: eckstein@bean.ISD.Uni-Stuttgart.DE (knut eckstein )
Subject: Re: XmMessageBox - only one Button needed
Organization: Dept. for Statics & Dynamics of Aerospace Structures (ISD)
Date: Fri, 14 Aug 1992 11:24:44 GMT

Works fine, thanks to all (about 15 people) who responded to me
via E-Mail.

Knut
-- 
Knut Eckstein  
WORK:  ISD,  Pfaffenwaldring 27, W-7000 Stuttgart 80, 0711/685-20 53, FRG
HOME:  Pfaffenwaldring 68 A 2.4, W-7000 Stuttgart 80, 0711/687 58 63, FRG
EMail: eckstein@bean.isd.uni-stuttgart.de
From: adarsh@sybase.com (Adarsh Pannu)
Newsgroups: comp.windows.x.motif
Subject: Re: ^ Cursor Removal in Text Widget
Keywords: caret text-widget
Date: 13 Aug 92 22:49:40 GMT
Followup-To: poster
Distribution: usa
Organization: Sybase

> From: sean@mitchell.eos.scg.hac.com (Sean Cohan)
> Hello.

> I'm using several text widgets within a form.  I've set the keyboardFocusPolicy
> to "pointer" so that when I move the pointer into a text widget it has 
> automatic focus.  If after I edit one of these text widgets and then leave that
> widget, the up arrow cursor ^ is left behind.  If I move into a new text 
> widget I have the flashing text cursor displayed in the new widget and the ^ 
> cursor in the old text widget I just modified.  This looks confusing to the 
> user.  How can I erase the ^ cursor from the old text widget.  

Most users find the presence of the "caret" (^) rather confusing,
and often preceive it as extraneous "data" left behind in the widget.

The Text[Field] widget code has a Pixmap associated with this
caret, and this is obtained in one of the following two ways -

1. Use XmGetPixmap() to load a Pixmap of the name "_XmText_Caret", or
2. If the above fails, use the hard-coded Pixmap array.

So, if you want the caret to go away, merely use one of the
bitmap-editors (bitmap, etc), and define a blank bitmap of
size 9x5. Call this "_XmText_Caret", and place it at one of the
locations where XmGetPixmap() looks (for eg $HOME/bitmaps). This
way, the "caret" will be invisible.

This might be a bit kludgy, but it works well for me.

Adarsh
Newsgroups: comp.windows.x.motif
From: geotex@engin.umich.edu (Alexander Joaquin Ramos)
Subject: HELP me with some window control?
Date: Thu, 20 Aug 92 10:03:29 EDT
Organization: University of Michigan Engineering, Ann Arbor



I am writing a Motif application which has 3 main windows.  Right now,
the windows pop up and must be placed by the user.  I am looking for the
way to get the windows to be placed at a specific location when they pop
up without requiring the user to move them. Can someone help me out here? 
Also I am having trouble getting the size of a window after a resize.
Is there a good way to do this.  I am trying to rescale a graph each time 
after the resize.  Any help on these topics would be appreciated.

Thanks!
Alex
Newsgroups: comp.windows.x.motif
From: morreale@laplata.scd.ucar.edu (Peter Morreale)
Subject: Re: Width of SelectionBoxDialog....
Keywords: controlling the list width....
Organization: NCAR/UCAR
Date: Sat, 15 Aug 1992 16:49:12 GMT

In article <1992Aug15.160502.28082@ncar.ucar.edu>, morreale@laplata.scd.ucar.edu (Peter Morreale) writes:
> 
> I can't seem to find a way to control the size of the child list in a
> SelectionBoxDialog.  The selection box always seems to set the 
> width of the list to the length of the longest list item.  
> 

 Never mind!  I should have looked a little further before posting...  I
 found the mapCallback in the BulletinBoard resources and found that I
 would reset the width of the dialog's list via that callback.  

 All I did was to use XtSetValues to reset the size of the list just
 prior to the SelectionBoxDialog's mapping.  This causes the list to get
 set to the size I'd like, without having the dialog window flash on the
 display....

 -PWM
------------------------------------------------------------------
Peter W. Morreale                  email:  morreale@ncar.ucar.edu
Nat'l Center for Atmos Research    voice:  (303) 497-1293
Scientific Computing Division     
Consulting Office
------------------------------------------------------------------
From: mxa11@po.CWRU.Edu (Madhavi Ahuja)
Newsgroups: comp.windows.x.motif
Subject: XtSetkeybaordFocus and XtGrabKeyboard
Date: 12 Aug 92 19:42:48 GMT
Organization: Case Western Reserve University, Cleveland, Ohio, (USA)


Hi guys
I have created a number of widgets including pushbutton,
label, text and drawingareas. My problem is that I want all
my keyboard input to be directed to the drawing area no
matter where I am on the screen. I do this by using the fucntion
XtSetKeyboardFocus. This seems to work fine except that I 
believe this interferes with motif's own event handling of 
key events. Is there any other way to sove my problem ?. I
have tried using XtGrabKeyboard but that does not seem to 
work. Can someone please help
Thanks
madhavi
ma@acqdev.eeg.ccf.org
Newsgroups: comp.windows.x.motif