HDTenEightyP/NetNews huggingface dataset:
From: meeks@osf.org (W. Scott Meeks)
Newsgroups: comp.windows.x.motif
Subject: Re: XmStrings seem to cause memory leak.....
Date: 22 Jul 92 20:46:46 GMT
Distribution: inet
Organization: The Internet

>Date: 21 Jul 92 15:03:02 GMT
>From: ftpbox!mothost!white!glas!waider@uunet.uu.net  (Ronan Waide)
>This is most likely to be a problem with my code, but here goes:

I think the problem is in your code.  I'll just repeat the code excerpts
that appear relevant:

[...]
>Here's the code:
>------------------
[...]
>acceptPress(widg)
>Widget widg;
>{
>    XmStringContext strcon;
>    XmStringDirection whither;
>    XmStringCharSet charset;
>    char *writing;
     ^^^^^^^^^^^^^
[...]
> if (XmStringGetNextSegment(strcon,&writing,&charset,&whither,&iffy)!=FALSE)
                                      ^^^^^^^^
XmStringGetNextSegment allocates space for the text argument.  So now
writing should be pointing to the allocated string "Close"

>  {
[...]
>   if (strstr(writing,"Accept"))
>	{
[...]
>	}
>   else if (strstr(writing,"Close"))
>	{
>	 sprintf(writing,"You are about to close Help Req. %d.\0",current_msg.id);
              ^^^^^^^
I think this is where the problem occurs.  The programmer is responsible
for ensuring that the destination string area is large enough to contain
the output generated by the formatting operation.  In this case, writing
only contains 5 characters while the output string will be at least 36
characters.  So more than likely, this sprintf call is stomping on memory
somewhere or causing writing to be an unterminated string so that the call
to XmStringCreateSimple is failing.

>     message=XmStringCreateSimple(writing);
                                   ^^^^^^^

Hope this helps.  Let me know if you have anymore questions.

W. Scott Meeks           | We must live with the fact, true throughout recorded
Open Software Foundation | history, that our artifacts are sometimes flawed and
meeks@osf.org            | cause us to die in novel and unexpected ways, and we
(617) 621-7229           | can only do our human best to minimize the problems.
Practice random kindness and senseless acts of beauty.
Newsgroups: comp.windows.x.motif
From: reward@eos.ncsu.edu (Robert E. Ward)
Subject: Re: Is widget C the decendant of widget A?
Followup-To: /dev/null
Originator: reward@c00483-224wi.eos.ncsu.edu
Keywords: blah
Reply-To: reward@eos.ncsu.edu (Robert E. Ward)
Organization: North Carolina State University, Project Eos
Date: Sat, 25 Jul 1992 03:33:50 GMT


In article <8988789.A021@netman.nms> rk@NMS.HLS.COM writes:
>
>If C is a child of B and B is a child of A why do you need to *determine*
>if C is a descendent of A ? Beats me.

Really!!  I thought we could leave it at:

if (XtParent (B) == C)

Also,  B being *a* descendent of A was a nice twist.  At least it had to
use a loop of some kind.  :)

Just my $.02

-Rob

---------------------------------------------------------------------------
Robert E. Ward                                          reward@eos.ncsu.edu
2701-C Confier                               __    ward-re@aza.csc.ncsu.edu
Raleigh, NC           0 .                   /  |
                       o O                 /   |
           |\   \\\\__ .o.                /o   /_/|
           | \_/    o \.                 <  ))  _ <
           >> _   (( <_                   \    \ \|
           | / \__+___/                    \   |
           |/     |/                        \__|
---------------------------------------------------------------------------
From: xcpslf@decsrv.NoSubdomain.NoDomain (stephen l favor)
Newsgroups: comp.windows.x.motif
Subject: Re: Is widget C the decendant of widget A?
Date: 24 Jul 92 14:06:51 GMT
Reply-To: xcpslf@decsrv.oryx.com
Organization: Oryx Energy Co., Dallas, Texas.

In article <1992Jul21.202155.23809@uhura.neoucom.edu>, fmc@uhura.neoucom.edu (Fu-Min Chen) writes:
|> From fmc Tue Jul 21 16:14 EDT 1992
|> Received: by uhura.neoucom.EDU
|> 	(15.11.1.3/15.6) id AA23260; Tue, 21 Jul 92 16:14:54 edt
|> Date: Tue, 21 Jul 92 16:14:54 edt
|> From: fmc (Fu-Min Chen)
|> To: fmc@uhura.neoucom.EDU
|> Status: R
|> 
|> To: fmc@uhura.neoucom.edu
|> Subject: Re: Is widget B the child of widget A?
|> Newsgroups: comp.windows.x.motif
|> In-Reply-To: <1992Jul21.122535.19734@uhura.neoucom.edu>
|> Organization: Northeastern Ohio Universities College of Medicine
|> Cc: 
|> 
|> Thanks for the Answers.
|> 
|> But the question really should be:
|>  
|>  If widget C is the child of widget B and widget B is the child of widget A,
|>  What can I do to determine is widget C the descendant of widget A?

Widget w;

for (w=XtParent(C);(w != NULL) && (w != A); w=XtParent(w));
if (w != NULL)
  its_a_descendant();
From: ashit@cadre.com (Ashit Patel)
Newsgroups: comp.windows.x.motif
Subject: keyboard navigation in a custom widget
Keywords: tab group, keyboard navigation
Date: 21 Jul 92 18:59:16 GMT
Article-I.D.: dbsoft.1992Jul21.185916.5401
Organization: Cadre Technologies, Inc.

Hi,
 I am trying to get correct keyboard navigation behaviour for my widget. My widget
  is placed within a ScrolledWindow widget with two scrollBars. When I hit <Tab> 
 my widget, horizontal scrollbar and vertical scrollbar are highlighted in cyclic
 fashion but when I hit <Shift><Tab> only the custom widget and vertical scrollbar are
 highlighted.  My widget is a direct subclass of PrimitiveWidgetClass.

 Following is part of my widget's translation table:

 static char defaultTranslations []  =
	"	........
		........
		<Key>Tab:	PrimitiveNextTabGroup()\n\
		Shift<Key>Tab:	PrimitivePrevTabGroup()\n\
		......
	";

 I also set XmNnavigationType resource to XmTAB_GROUP but that does not affect the
 behaviour when I hit <Shift><Tab>.
 
 Is there something  that I am missing or doing wrong?

 Thanks in advance,
 - Ashit

 email: ashit@cadre.com
Newsgroups: comp.windows.x.motif
From: dbl@osf.org (David B. Lewis)
Subject: Re: Default Color of Motif Window Frames
Keywords: FAQ question
Organization: Open Software Foundation
Date: Fri, 24 Jul 1992 12:43:59 GMT

|> Cadet Blue?

Yes, CadetBlue and LightGrey if those colornames can be parsed; otherwise
it uses some hex values which don't quite correspond.

-- 
David B. Lewis  	Temporarily at and certainly not speaking for OSF.
by day: dbl@osf.org			by night: david%craft@uunet.uu.net
Newsgroups: comp.windows.x.motif
From: gec@admiral.uucp (George E. Cabanas)
Subject: SCO ODT and startx problem
Reply-To: gec@admiral.uucp (George E. Cabanas)
Organization: The Grid/Waffle BBS, 203-661-2873, -1279, -0450, -2967
Date: Tue, 28 Jul 1992 01:41:07 GMT

Hello all,

I'm encountering a new problem when I start X under SCO-ODT 1.1.
It did work a while ago, but I haven't used it in some time.

To the best of my knowledge, I haven't changed any config files
and I haven't deleted anything.  This error occurs to any user,
including root.

This is the result of executing "startx."

==========
$ startx
Open event driver failed:: No such file or directory
                                                    giving up.
xinit:  Invalid argument (errno 22):  unable to connect to X server
Open event driver failed:: No such file or directory
                                                    Open event driver 
failed:: N
o such file or directory
                $

==========

Any help would be greatly appreciated.

Thanks.

George

--
gec%admiral.uucp@yale.edu (George E. Cabanas) <yale!admiral!gec>
The Admiral's Public UNIX - Greenwich, CT - System Administrator: Doug Fields
(HST/V32) (203)661-2873 -- (PEP/V32) -1279 -- (V32) -0450 -- (V29/MNP6) -2967
>FREE!< Unix shell accounts, Usenet access, and Internet-style mail available
Newsgroups: comp.windows.x.motif
From: xcpslf@decsrv.NoSubdomain.NoDomain (stephen l favor)
Subject: Re: Doing something 'til the button's released
Reply-To: xcpslf@decsrv.oryx.com
Organization: Oryx Energy Co., Dallas, Texas.
Distribution: usa
Date: Tue, 21 Jul 1992 13:32:23 GMT

In article <14fsa1INN88k@network.ucsd.edu>, warner@natasha.sdsc.edu (Ken Warner) writes:
|> Using: X11r4--Motif 1.1.4--SparcStation.
|> 
|> I have an XmArrowButton.  I press Btn1Down.  I get one XmArmCallback().
|> 
|> I want to either: keep getting the XmArmCallback() repeatedly called until
|> I let go Btn1.
|> 
|> OR:
|> 
|> Be able to detect Btn1Down in a loop in XmArmCallback() so's I can continuosly
|> increment/decrement a counter.

Have XmNarmCallback start an XtWorkProc that does the incrementing and then
remove the WorkProc on XmNdisarmCallback.
From: sukan@RS.COM (Sukan Makmuri)
Newsgroups: comp.windows.x.motif
Subject: Re: What is "Purify" ?
Date: 24 Jul 92 19:43:42 GMT
Distribution: inet
Organization: The Internet


> Could someone please provide information on "Purify" ? Is this an
> OSF product ? Is is like lint or dbx ?
> Thanks.
>  +----------------------------------------------------------+
>  Glyn Jones, Geophysics Division            jgmjo@chevron.com 	
>  Chevron Oil Field Research Co.           Tel: (310) 694-7137 	
>  La Habra, California 90633-0446          Fax: (310) 694-7063 	
> 
Try Eric LaBadie, Pure Software (415) 903-5096  labadie@pure.com.

Excellent software!

Sukan
********************************************************************************
Sukan Makmuri                                           Email:  sukan@rs.com
Renaissance Software, Inc.                              Phone:  (415) 949-9455
175 S. San Antonio Rd, Los Altos, CA 94022              FAX:    (415) 941-8943
********************************************************************************
From: klee@wsl.dec.com (Ken Lee)
Newsgroups: comp.windows.x.motif
Subject: Re: Serious Expose Event Problem!
Date: 24 Jul 92 18:05:13 GMT
Reply-To: klee@wsl.dec.com
Organization: DEC Western Software Laboratory

|> I have added an action <Expose> on a Drawing Area widget which is
|> resized automatically by a Form parent. When the parent Form
|> grows; an Expose callback is generated but when the parent
|> shrinks, although the Drawing Area widget shrinks as well (I
|> can tell from the borders) an expose event is *not* generated!
|> 
|> Whis is the reason for this non-symmetrical behavior? And how
|> can I get an Expose event on *any* widget configure, be it grow
|> or shrink? I thank in advance for any help!

An expose event means that more area is visible (and thus has to be painted
by the client).  If you're interested in configuration changes, then use
ConfigureNotify events.

-- 
Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@wsl.dec.com
uucp: uunet!decwrl!klee
Newsgroups: comp.windows.x.motif
From: ik@snoopy.ctt.bellcore.com (Ik Su Yoo)
Subject: remotely controlling Motif application
Reply-To: ik@ctt.bellcore.com (Ik Su Yoo)
Organization: Bell Communications Research
Date: Fri, 31 Jul 92 11:58:35 GMT


This is difficult to explain, but does anyone know of a package that
does the following?

  1. When the user manipulates a Motif object, instead of envoking the
     associated callback(s) send a message to another application.

  2. Allow an external application to manipulate the Motif application
     by sending messages to it.

  3. 1 and 2 can be done at some level higher than the dealing with X
     events.

  4. 1 and 2 can be done w/o modifying the Motif application.

So for example, if the user presses on an XmPushButton, the Motif
application will send message "(button-press foo)", where foo is the
name of the button. Conversely, if the Motif application receives
message "(button-press foo)", it will trigger the actual callbacks
associated with button foo.

What 4 mounts to is using clever cpp macro tricks to redefining
XtCreateWidget, XtAddCallback, etc.

I may have to prototype this feature fairly soon and would rather not
reinvent something that may already exist.

Ideas?

Ik S. Yoo
RRC-1H229, x5764
ik@ctt.bellcore.com
From: snail@lsl.co.uk
Newsgroups: comp.windows.x.motif
Subject: Re: XmOptionMenu items
Date: 27 Jul 92 11:49:34 GMT
Organization: Laser-Scan Ltd., Cambridge

In article <1992Jul23.142520.2956@rdg.dec.com>, kulla@casee.enet.dec.com (Marc Kulla) writes:
> Does anyone know how to insert a new item into an XmOptionMenu in a 
> particular location (namely 1st)?  I can add new items by creating more
> pushbuttons with the subMenuId as the parent.  That works fine.  The item
> appears at the end of the list!  Now I need to insert an item at the top of the 
> list and I have no idea how to do it.  Any suggestions?

No problem. 

XmOptionMenu is a XmRowColumn in disguise. XmRowColumn has resources from the
Composite class. The resource you want to set is XmNinsertPosition. Do this
as follows.

	Arg	arglist[1];

	XtSetArg(arglist[0], XmNinsertPosition, my_insertion_function);
	XtSetValues(optionmenu_widget, arglist, 1);

Now the function....

static Cardinal my_insertion_function(Widget my_widget)
{
	Arg		arglist[0];
	Cardinal	my_card;

	XtSetArg(arglist[0], XmNuserData, &my_card);
	XtGetValues(my_widget, arglist, 1);

	return my_card;
}

Note the function looks at the widgets XmNuserData resource to determine the
position to return. The position runs from 0 to n-1 for n children. returning
position n results in placing the widget after all widgets.

So when you go to add a button to an option menu, before you add the button
(create the button that is) do the following....

	Arg	arglist[1];

	XtSetArg(arglist[0], XmNuserData, my_position);
	XtSetValues(optionmenu_widget, arglist, 1);

NOTE: No global variables used. All are local!

OK? Any problems drop me a line....now for the SNAILy .sig!

Anyone want a contractor?
                                                              *      *
Stephen Kellett                                _______         \    /
Software Engineer                            --   ___ --        \  /  
Laser Scan Ltd                              (    _   __ )      ======
Science Park                               (    (  |   ) )    =      =
Milton Road                                (     (_)    ))   =  *  *  =
Cambridge CB4 4FS                           (           )  ==   .  .  =
England                                      --       --===      ..  =
snail@lsl.co.uk                              ==_______             ==
(+44) 223 420414 ex 275              ========                  ====   
                          ===========                      ====      [ ]BEER
                       ====================================          | |CIDER
-------------------------------------------------------------------------------
From: et@nsl.fr (Eric Touchard)
Newsgroups: comp.windows.x.motif
Subject: Re: placing a dialog exactly where I want it
Keywords: DialogShell
Date: 24 Jul 92 14:05:27 GMT
Organization: Non Standard Logics
Originator: et@sparc.nsl.fr

Hi

don't forget to set the XmNdefaultPosition to False

		[et]
From: dob@inel.gov (Dave Brooks)
Newsgroups: comp.windows.x.motif
Subject: Re: Float as Resources
Date: 23 Jul 92 13:33:48 GMT
Distribution: inet
Organization: The Internet

In article <1992Jul17.201016.29640@ncar.ucar.edu> ethan@earl.scd.ucar.edu (Ethan Alpert) writes:

   Either way you look at it float resources are BOGUS and should be avoided at 
   all costs.

I don't quite agree, since there are useful ways that floats can be used in
user interfaces.  on the whole you might be right.  but, i think that neither
wholesale avoidance or reliance on floats are wise positions.

   BTW, you were going to explain to me why float resources are not portable?

I first remember seeing this several years ago.  Seems that the interface
to one of the Athena widgets changed from float to address of float.  I
think that Bob Scheiffler offered the explanation that floats on different
architectures are not all the same size, and they are not all guaranteed to
fit inside a caddr_t.  It would be wonderful if they did, but apparently
this was not guaranteed.  So, if you do something like this:

    XtSetArg (args [argcnt], XtNfloat, my_float);

when the assignment

    args[argcnt].value = my_float;

was done, in some circumstances the float was pushed on the stack and its
address passed instead.  At least, this is how i remember it.  So, the spec
was changed to pass address of float variable, because addresses *DO* fit
in a caddr_t, and this was a more portable and reliable method (where my
definition of reliable is "it does what you think it does").

besides, &float is easier to type than the macro that appeared earlier in
this thread.

best regards,
dave
-------------------------------------------------------
David L. Brooks
Idaho National Engineering Lab.  INTERNET: dob@INEL.GOV
POB 1625 MS 2603                 Phone: (208) 526-0826
Idaho Falls, Id. 83415		 FAX:   (208) 526-9936
-------------------------------------------------------
From: sram@lccinc.UUCP (Siddharth Ram)
Newsgroups: comp.windows.x.motif
Subject: Re: Please help me with Pixmaps
Summary: the size of Pixmaps ..
Date: 29 Jul 92 22:25:43 GMT
Organization: LCC Inc., Arlington VA

In article <DRAND.92Jul17155721@spinner.osf.org>, drand@spinner.osf.org (Douglas Rand) writes:
> In article <9207161538.AA14408@ha24.eng.ua.edu> skarkada@HA24.ENG.UA.EDU (Sudarshan Karkada) writes:
> 
>    I have few questions about pixmaps.
> 
> 	   1) What will be the memory size of a pixmap? (say for 10x10).
> 	      I tried sizeof() but that didn't work.
> 
> Oh boy!!!  You don't care,  really.

would i be justified in saying :

given width x height of 100x100, and a depth of 8,
that the memory requirement of the pixmap would be 
10^4 bytes + some management overhead ? 

if this is valid, if the depth is changed to 1,
will X "pack" in the pixmap as individual bits so that for the 
100x100 pixmap the requirement is not 10^4 , but 10^4/8 ?

just curious
siddharth
-- 
uunet!hallofjustice!sram
LCC Inc.
Newsgroups: comp.windows.x.motif
From: robert@triton.jpl.nasa.gov (Robert Angelino)
Subject: Settting file filter in a file selection box from C..
Reply-To: robert@triton.Jpl.Nasa.Gov
Organization: Jet Propulsion Laboratory, Pasadena CA
Date: Wed, 29 Jul 1992 17:30:09 GMT

X gurus,
	Does anyone know how to force a file filter mask???  What I want
to do from within the program is set the file filter in a file selection
box and have it only display the files with the file filter mask.

Any help is much appreciated.


-robert
Newsgroups: comp.windows.x.motif
From: matt@fics.uucp (Shithead II)
Subject: Re: Is widget C the decendant of widget A?
Organization: Kvam data as
Date: Thu, 23 Jul 1992 22:20:13 GMT

>Try this question: How can I tell if widget B is *a* descendant of widget A?
>
>	for (C = B; C; C = XtParent(C))
>	  if (C == B) return true;
>	return false;

(ahem)...
   if (C == A) return (YOBABY);

matt_dawg
Newsgroups: comp.windows.x.motif
From: reha@cunixf.cc.columbia.edu (Reha Elci)
Subject: Help: how do I override XmDrawingArea's Realize?
Summary: what is the proper procedure?
Reply-To: reha@cunixf.cc.columbia.edu (Reha Elci)
Organization: Columbia University
Date: Tue, 28 Jul 1992 15:14:50 GMT

	Although I would specifically like to do this with the
XmDrawingArea widget at the moment, this is a general question.

I would like to override the widgets "Realize" function. The
reason I would like to do this is because Motif arbitrarily
chose Northwest window bitgravity which completely messes up my
application's expose handling. So I would like to override
their Realize function. How can I do this?

I tried the following (after I created the widget but before
I managed it):

  w=XmCreateDrawingArea(parent,NoName,alist,n);

  ((XmManagerClassRec *) XtSuperclass(w))->core_class.realize =
       (XtRealizeProc) myRealize;

  XtManageChild(w);

My function was never called. Am I doing this correctly?
Any help will be appreciated immensely!!

Reha Elci
Email: elci@bugs.gs.com
From: dsmith@mailhost.aa.cad.slb.com (J. Daniel Smith)
Newsgroups: comp.windows.x.motif
Subject: Which widget is faster?  Text or Label.
Date: 31 Jul 92 19:50:56 GMT
Organization: Schlumberger CAD/CAM at Ann Arbor, MI

I have a small portion of my application that is updated as the user
moves the mouse.  Currently, three labels widget are used; with new
values being set for basically every MotionNotify event.  For
reference, the display looks like
   X:   1.23456
   Y:   2.34567
   Z:   0.00000
each line being its own label widget.

Doing things this way creates annoying flashing as the user moves the
mouse.  To get rid of the flashing, I was thinking of changing things
over to use single text widget instead (we already flush the event
buffer of all MotionNotify events every time an update is done).  (Of
course another improvement is use six label widgets and only change
the numeric values each time.  This would prevent the "X:", "Y:", and
"Z:" strings from flashing.)

However, before I go off and try this, I was wondering if anybody
could say whether or not this will reduce the flashing.  I'm using DEC
Motif 1.1.1 (hopefully switching to DEC Motif 1.1.3 soon).

Any other suggestions for removing this flashing effect?

Thanks,
   Dan
-- 
============================================================================
J. Daniel Smith                     Internet: dsmith@mailhost.aa.cad.slb.com
Schlumberger CAD/CAM                          dsmith@aaaca1.sinet.slb.com
Ann Arbor, Michigan (USA)               UUCP: uunet!sharkey!applga!dsmith
From: mguay@hyperdesk.com (Maryanne Guay)
Newsgroups: comp.windows.x.motif
Subject: Motif app and file descriptors
Keywords: Motif, File Descriptors
Date: 30 Jul 92 17:40:47 GMT
Reply-To: mguay@hyperdesk.com (Maryanne Guay)
Organization: HyperDesk Corporation

I've got a Motif application which opens 17 uid files.  My application
forks and execs another application (not motif) which brings up an
xterm.  If my application opens just one additional file, either
another uid file or a temp file, the xterm exhibits odd behavior...
standard in and out in the xterm don't seems to work properly.  
However, widgets from all my uid files are fetched properly.  

Is there some motif or X limit on the number of files I can have
open?  My system limit of number of open files is 64.  Is there a limit
to the number of .uid files my motif app can use?  

Thanks in advance,
Maryanne


Newsgroups: comp.windows.x.motif
From: hess@swt2.informatik.uni-hamburg.de (Hauke Hess)
Subject: DrawingArea problems, please help!!!
Summary: bug or feature?
Keywords: Black goes white goes mad
Organization: University of Hamburg, FRG
Distribution: comp
Date: 24 Jul 92 13:03:14 GMT

Hi,

I`m writing an editor for graphs with Motif, and I`m using a DrawingArea
Widget to do the output. A popup window is used to select the different drawing
tools. This popup-window is located upon the DrawingArea as a child. Now if
I move a graphic under the popup, the background color for XDrawText seems
to change from the actual background color to black on color displays.

For my direct manipulation I redraw each shape with background color, move the
shape a bit and draw it again in foreground color. This works fine on monochrome
displays, but on a color or true graytone display the described switch of 
background colors occures, resulting in remaining black text on the drawing
area. Is this a known bug or a known feature?

It only appeals to drawn Text, all the lines, ellipses etc. work fine.

Thanks for your help,

Hauke