HDTenEightyP/NetNews huggingface dataset:
From: ks@BAT.GSFC.NASA.GOV (ASTS Ken Sall)
Newsgroups: comp.windows.x.motif
Subject: Re:  Anyone got a Ruler Widget?
Date: 23 Dec 92 16:44:37 GMT
Distribution: inet
Organization: The Internet


 uunet!ucbvax.Berkeley.EDU!agate!spool.mu.edu!uwm.edu!zaphod.mps.ohio-state.edu!usc!news.cerf.net!benton.prepress.com!benton!mark  (Mark S. Bubien) writes:
 >> 
 >> I am looking for a way to put rulers into a Motif
 >> window.
 >> 
 >> For example, on the Mac, PageMaker and QuarkExpress both
 >> have vertical and horizontal rulers.  I want implement
 >> something very similar in Motif, but I don't know
 >> where to start.
 >> 

Two different suggestions (I've successfully tried the second):

1) Subclass off the XmDrawingArea widget and use XDrawLines and XDrawString or
   XDrawText to do implement the Expose method.

2) Use XmScale widget with numerous children XmLabel widgets, one set for
   the tick marks (label: "|") and one set for the numerics. 
   Set the XmNshowValue resource to False.
   To get the widget id of the scrollbar portion of the scale:
   Do XtGetValues of XmNnumChildren and XmNchildren, loop over widget list
   returned to test for XmIsScrollBar (see ScrollBar.h), unmap the scrollbar
   widget (leaving the label children).

------------------------------------------------------------------------
Ken Sall
ksall@cen.com                        ks@bat.gsfc.nasa.gov

Century Computing, Inc.              TAE Plus project
Laurel, MD 20707                     under contract to:
(301) 953-3330                       NASA/Goddard Space Flight Center
------------------------------------------------------------------------
Newsgroups: comp.windows.x.motif
From: koverber@cs.ulowell.edu (Kurt Overberg)
Subject: Re: How can I make Drawing Area invisible?
Originator: koverber@bigmax.ulowell.edu
Organization: University of Massachusetts at Lowell Computer Science
Distribution: comp
Date: Mon, 21 Dec 1992 15:24:38 GMT



1)  I can't really think of anyway to make a drawing area invisible.
    I have never seen it done, and am not sure it is possible.  If I were
    to guess HOW to do it, perhaps you could hack access to the server's
    backing store pixmap, and figure out which part of that should
    be visible in your window.  In any event, it would probably require
    a lot of very low level X hacking.  Ugh.

2)  All you need is the widget ID of the push button in the menu structure.
    You could either declare it as a global (not a good idea), or use
    XtNameToWidget.  Example: your pushbutton in your menu structure is called
    "RulerOption".  Note: NOT the variable name.  This is the WIDGET name.  It is
    the first parameter in XtVaCreateManagedWidget.  You need to know the Widget ID
    this button's parent.  Example:

    {
	Widget localWidgetVariable;

	localWidgetVariable = XtVaCreateManagedWidget("RulerHiddenOrShown", 
						       parent_form,    /* parent */
	...
	...
    }

*now we are in an entirely different part of program where 'localWidgetVariable'
is not visible, but parent_form IS visible*

    {
	Widget tmp;
	XmString str;

	tmp = XtNameToWidget(parent_form, "RulerHiddenOrShown");

	/* now, tmp contains the widget ID of your menu item */

	str = XmStringCreateLtoR("Hide Ruler", XmSTRING_DEFAULT_CHARSET);

	XtVaSetValues(tmp, 
			XmNlabelString, str, 
			NULL);
	/* This will change the string of our menu item */
     }
	
-- 
Kurt Overberg            | Opinions expressed here are MINE!           
U of Mass, Lowell        | "Poke a double-decker on a Llama taboot,       
koverber@cs.ulowell.edu  |  Llama taboot, taboot!"      -Phish

Newsgroups: comp.windows.x.motif
From: janzen@lichen.mpr.ca (Martin Janzen)
Subject: Re: two processes with one window?
Reply-To: janzen@mprgate.mpr.ca
Organization: MPR Teltech Ltd.
Date: Tue, 22 Dec 92 21:14:02 GMT

In article <3944@creatures.cs.vt.edu>, ramakris@csgrad.cs.vt.edu (S.Ramakrishnan) writes:
>In article <1992Dec18.144058.20973@walter.bellcore.com> john@bivalve.bellcore.com (John Snow) 
>writes:
>  >I have a situation where I want a background program to have control of
>  >a portion of a window, specifically a drawing area.  It would be nice if
>  >I could fork off another process and pass it the widget id of the drawing
>  >area, but I know things couldn't possibly be that easy.  Is it possible
>  >to do something like this, and if so, could someone give me some hints
>  >as to how to do it?
>
>[good advice deleted]
>
>Prior to forking, you may store the window id of 
>the drawing area and the (x,y,width,height) of the section that the child needs to 
>manage in a rootwindow property and have the child access it after it comes up.

This is a good way for unrelated processes to share information, but it's
not really necessary in this case.  The parent simply needs to store the
above information in some variables; the fork() call will make a copy
of the parent's data area for the new child process.

>Unless the drawing/repainting of the drawing area is unusually complex, the gain in
>execution efficiency does not warrant the yucky implementation that
>is bound to result with the use of forking.

Agreed!  Though if John _must_ have truly asynchronous updates to the
drawing area even when the parent process is busy and can't process
events, there may not be any alternative.

-- 
Martin Janzen                     janzen@mprgate.mpr.ca (134.87.131.13)
MPR Teltech Ltd.                  Phone: (604) 293-5309
8999 Nelson Way                   Fax: (604) 293-6100
Burnaby, BC, CANADA  V5A 4B5
From: avinash@felix.contex.com (Avinash Chopde)
Newsgroups: comp.windows.x.motif
Subject: Re: Is it possible to get at FileSelectionBox PushButtons?
Summary: no, using Gadget is not the answer, the answer is ...
Date: 31 Dec 92 15:27:42 GMT

In article <3238@contex.contex.com>, avinash@sam.contex.com (Avinash Chopde) writes:
> For some strange reason (:-)), I need to make the pushbuttons
> on the FileSelectionBox widget respond to Button 2.
> Assuming I only have a FSB in some application, I thought this would
> work:
> *XmPushButton.translations: #override\
> 	<Btn2Down>,<Btn2Up>:	Activate() Disarm() \n\
> 	<Btn2Down>:	Arm()

Well, I received many replies to use XmPushButtonGadget instead of
XmPushButton, but of course, that will not work, since Gadgets do not
have translations associated with them. But, that led me to the right
solution: install translations for the Manager widgets, which will
activate the Gadgets:

*XmFileSelectionBox.translations: #override \n\
	<Btn2Down>,<Btn2Up>:	ManagerGadgetActivate() \n\
	<Btn2Down>:	ManagerGadgetArm() \n\
	<Btn2Up>:	ManagerGadgetActivate()

The above works correctly.
Similarly, for the MessageBoxes, one may use:

*XmMessageBox.translations: #override \n\
	<Btn2Down>,<Btn2Up>:	ManagerGadgetActivate() \n\
	<Btn2Down>:	ManagerGadgetArm() \n\
	<Btn2Up>:	ManagerGadgetActivate()

Thanks to everyone for the pointers that led me to the solution...
-- 
---------------------------
Avinash Chopde         office : 617 246 1776x5582
avinash@contex.com     (...!uunet!contex!avinash)
Xref: sparky comp.windows.x.motif:8245 comp.windows.x:20607
From: straw@cam.nist.gov (Mike_Strawbridge_x3852)
Newsgroups: comp.windows.x.motif,comp.windows.x
Subject: selecting in Motif ScrolledList causes core dump
Date: 29 Dec 92 19:50:46 GMT
Followup-To: comp.windows.x.motif
Organization: National Institute of Standards & Technology, Gaithersburg, MD

I got some more information on my problem since I tried it on a system
with the Motif source code.

I am running this on a Sun 4, SunOS 4.1.3, MIT X11R4 and Motif 1.1.4.

In my application I have a ScrolledList. The list has selectionPolicy set 
to BROWSE_SELECT. Sometimes, but not always, the following action will 
cause the application to dump core ...

- Press the select mouse button and drag the cursor off the bottom of the
  list. The list scrolls to the bottom of the list and the last item is
  highlighted. ( i.e. the cursor is now outside of the scrolledList widget
  and the last item in the list is highlighted).

- Now release the select key.

The application dumps core with the following status from dbx:

  program terminated by signal SEGV (no mapping at the fault address)
  ClickElement() at 0x65e64
  BrowseScroll() at 0x66214
  DoOtherSources() at 0xf778174c
  XtAppNextEvent() at 0xf7781938
  XtAppMainLoop() at 0xf77799cc

Note that it does not crash every time you do this. Most of the time
it calls the XmBrowseSelectionCallback as expected.

The bad variable in ClickElement() is lw->list.InternalList. It is
referenced and has a value of NULL!

Does anyone know what my problem is? Is this a bug in Motif 1.1.4 or have 
I forgotten to configure something in the List/ScrolledWindow combination?

Thanks.

Mike

-----------------------------------------------------------------------
NAME:   Michael Strawbridge                     TELE: (301) 975-3852
USMAIL: National Institute of Standards         ARPA: straw@cam.nist.gov
                and Technology                  UUCP: uunet!cme-durer!straw
        Rm. B-146, Bldg. 225
        Gaithersburg, MD  20899
Newsgroups: comp.windows.x.motif
From: daniel@juliet.osf.org (Daniel Dardailler)
Subject: Re: Error: Shell Widget 3 has zero width ...
Keywords: 
 
Organization: Open Software Foundation, Motif Team
Date: Mon, 21 Dec 1992 15:15:05 GMT

|> The enclosed codes compiled OK and run with this error
|> - Error: Shell widget 3 has zero width and/or height 
 
|>   toplevel = XtInitialize(argv[0],"3",NULL,0,&argc,argv);
|>   n = 0;
|>   XtSetArg(args[n], XmNdefaultPosition, FALSE); n++;
|>   XtSetArg(args[n], XmNresizePolicy,2); n++;
                                       ^
Very bad practice (but nothing to do with your problem).

|>   XtSetArg(args[n], XmNx, 115); n++;
|>   XtSetArg(args[n], XmNy, 287); n++;
|>   XtSetArg(args[n], XmNwidth, 200); n++;
|>   XtSetArg(args[n], XmNheight, 200); n++;
|>   BULLETINBD_0 = XmCreateBulletinBoardDialog(toplevel,"BULLETINBD_0",args,n);
|>   XtManageChild(BULLETINBD_0);
|>   XtRealizeWidget(toplevel);
|>   XtMainLoop();
 
Your toplevelshell "3" has no child to layout, just a popup.
Therefore it has no size.
Look at the Xt doc for hints on how to play with hidden shell.

Newsgroups: comp.windows.x.motif
From: JKA@jylk.jyu.fi (JUKKA K{RN{, OPIS)
Subject: XCreatePixmap/XCopyArea problem
Organization: University of Jyvaskyla
Date: Mon, 21 Dec 1992 13:56:28 GMT
X-News-Reader: VMS NEWS 1.20
From: poepping@warhol.uni-paderborn.de (Manfred Poepping)
Newsgroups: comp.windows.x.motif
Subject: Centering a PushButton in a Form :-)
Date: 28 Dec 1992 11:57:29 +0100
Organization: Universitaet Paderborn, Germany
Distribution: world
NNTP-Posting-Host: warhol.uni-paderborn.de


    Hello,

    I'm surprised how many people have problems centering a
    PushButton in a Form. To give the discussion a new
    direction - how about that (only Motif 1.2):

    XmForm
     |
     +--> XmFrame : XmNshadowThicknes - 0
           |        XmNleftAttachment - XmATTACH_FORM
           |        XmNrightAttachment - XmATTACH_FORM
           |        XmNbottomAttachment - XmATTACH_FORM
           |
           +--> XmPushButton : XmNchildType - XmFRAME_TITLE_CHILD
                               XmNchildHorizontalAlignment - XmALIGNMENT_CENTER




    Any comments?  :-)

    Btw: I wish all of you out there a happy new year.

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

    Dipl.-Inf. Manfred Poepping
    Universitaet Paderborn
    Fachbereich 17 - Informatik
    Postfach 1621
    D-4790 Paderborn
    Tel.: 05251-60-2076
    poepping@uni-paderborn.de
From: al@osf.org
Newsgroups: comp.windows.x.motif
Subject: Re: How to simulate a ToggleButton with a PushButton
Date: 20 Dec 92 21:39:30 GMT
Distribution: inet
Organization: The Internet


> Use a ToggleButton, and set the following resources:
>      XmNindicatorOn, False
>      XmNshadowThickness, 1,

This is a good way to achieve the toggle button visual and...

> The only other thing left to do, since a ToggleButton doesn't have a
> XmNarmColor resource like a PushButton, is to change the ToggleButton's
> background resource in the ToggleButton's XmNarmCallback when it gets  pressed.

..in Motif 1.2 or later, set the resource XmNfillOnSelect to true, and the background
of a 'set' toggle button will be filled with XmNselectColor.

For an example see the Motif Periodic demo, in demos/periodic/*

Alastair Gourlay.
From: richm@netcom.com (Richard Mauri)
Newsgroups: comp.windows.x.motif
Subject: Re:  Anyone got a Ruler Widget?
Date: 28 Dec 92 15:53:47 GMT
Distribution: inet
Organization: Netcom Online Communications Services (408-241-9760 login: guest)

In article <9212231644.AA19754@bat.gsfc.nasa.gov> ks@BAT.GSFC.NASA.GOV (ASTS Ken Sall) writes:
>
> uunet!ucbvax.Berkeley.EDU!agate!spool.mu.edu!uwm.edu!zaphod.mps.ohio-state.edu!usc!news.cerf.net!benton.prepress.com!benton!mark  (Mark S. Bubien) writes:
> >> 
> >> I am looking for a way to put rulers into a Motif
> >> window.
> >> 
> >> For example, on the Mac, PageMaker and QuarkExpress both
> >> have vertical and horizontal rulers.  I want implement
> >> something very similar in Motif, but I don't know
> >> where to start.
> >> 
>
>Two different suggestions (I've successfully tried the second):
>
>1) Subclass off the XmDrawingArea widget and use XDrawLines and XDrawString or
>   XDrawText to do implement the Expose method.
>
>2) Use XmScale widget with numerous children XmLabel widgets, one set for
>   the tick marks (label: "|") and one set for the numerics. 
>   Set the XmNshowValue resource to False.
>   To get the widget id of the scrollbar portion of the scale:
>   Do XtGetValues of XmNnumChildren and XmNchildren, loop over widget list
>   returned to test for XmIsScrollBar (see ScrollBar.h), unmap the scrollbar
>   widget (leaving the label children).
>
>------------------------------------------------------------------------
>Ken Sall
>ksall@cen.com                        ks@bat.gsfc.nasa.gov
>
>Century Computing, Inc.              TAE Plus project
>Laurel, MD 20707                     under contract to:
>(301) 953-3330                       NASA/Goddard Space Flight Center
>------------------------------------------------------------------------

I believe it would be lots easier to subclass XmPrimitive than XmDrawingArea.
Draw the scale, tick marks and anotations using Xlib primitives. I'm sure
you'll have more control that way rather than wrestling with XmLabel 
widgets, etc. You know, when I think of it I'd really like a ruler widget
too. I'd like one that looked like the ruler in the legends on maps.
Maybe I'll work on it myself. If anyone can tell me their requirements
I will consider them in my design. If someome has done the work already
let me know soon.
Thanks, Rich Mauri
-- 
Richard Mauri               // Not ready to face the winter.
SW Eng / X hack             // Pray for wind.
Trimble Navigation Ltd.     // Pay the bills.
richm@netcom.com	    // Hope nothing breaks
Newsgroups: comp.windows.x.motif,comp.windows.x
From: raja@roma.berkeley.edu (Raja R. Kadiyala)
Subject: Catching window manager's kill
Organization: U.C. Berkeley -- Robotics Lab
Date: Tue, 29 Dec 1992 22:49:40 GMT

I am using Xt & Motif and I have been looking for an answer to this simple
question:

	How do I catch/stop the window mngr. from quiting my application (i.e.
if I am running olwm the user may go up to the the title bar click to
get the 'window' menu and select 'quit' and my app is outa there.  Likewise
with mwm except it is 'close').

	I want to prompt the user if he/she REALLY wants to quit.


Please respond by email and I will post the winning solution(s).

thanks
raja

--
Raja R. Kadiyala			UC Berkeley Robotics Lab
Mail is forwarded to:			raja@robotics.berkeley.edu
Office  333-5D Cory Hall		Phone: (510) 643-5798
Lab     330    Cory Hall		Phone: (510) 642-3248 or 2-7824
Newsgroups: comp.windows.x.motif
From: john@pluto.Jpl.Nasa.Gov (John R Veregge)
Subject: Xt and CPU usage
Reply-To: john@pluto.Jpl.Nasa.Gov
Organization: Jet Propulsion Laboratory, Pasadena CA
Date: Tue, 29 Dec 1992 04:53:10 GMT

We have developed several large Motif applications that are complete CPU
hogs and I don't know why.

Each application has 300 to 500 XtCreateWidget() and 8 XtAppCreateShell()
calls. These calls are all made before XtAppMainLoop() is called. Widgets
are not destroyed until the application exits.

Each application is driven by both the GUI and serialized data using
XtInputCallbackProc's.

We run 2 to 4 application on a workstation.

2 applications will put CPU usage of a Sparc 2 at 97%, even when
completely idle with no serialized data input and no X events (GUI input),
using X11R4, on Sun Sparc 2's with 32+ megs of memory and 20+ megs of swap.

Can anyone tell me (1) Why? and (2) How can I fix (optimize) this?
______________________________

John R Veregge
Jet Propulsion Laboratory
Calif Institute of Technology
john@pluto.triton.jpl.nasa.gov
Newsgroups: comp.windows.x.motif
From: elr@idm.com (Eric L Reiner)
Subject: Problem with Label Widget
Date: Mon, 28 Dec 1992 20:10:50 GMT
Organization: Information Data Management

I have a question/problem regarding a label widget.  I am doing a
very time consuming task and while I task is in progress, I want
to change a string to represent a status message.  However, the
message will not be updated until the program gets back to the
main loop (or I process events).  I am stuck here - when I change
the text, the label will blank but not update - why not.  Was the
author trying to save a call  and wait for a refresh event?  I 
would like to hear about any experiences you might have/or ideas
on this subject.  Please E-Mail your responses.

Thanks in advance.
Eric Reiner
From: mbell@csc.liv.ac.uk (Mike Bell)
Newsgroups: comp.windows.x.motif
Subject: XmVaCreateSimpleOptionMenu on HP-UX
Date: 20 Dec 92 23:35:43 GMT
Organization: Computer Science, Liverpool University

OS: HP-UX 8.07
X: R4
Motif:1.1

I just tried using the convenience function XmVaCreateSimpleOptionMenu however
although  it compiles fine it dosn't work! At first I thought it was my code so
I compiled Dan Heller's simple_option.c program and got the same result....
it puts up:

		   ____________________________
Draw Mode: |option_menu_cascadeBtn =  |
		   ----------------------------

Pulling the option btn results in a square being put up 5mm square in the top
corner above option...

Any ideas

Mike
Newsgroups: comp.windows.x.motif
From: shmuel@mapsut.einstein.com (Shmuel Einstein)
Subject: Motif on internet?
Date: Thu, 31 Dec 1992 22:51:45 GMT
Organization: Shmuel Einstein & Associates, Inc.

Is the source to motif available from an internet site for Sun Sparc, os 4.1.3?

Please reply by email. Thanks in advance.



-- 
Shmuel Einstein, shmuel@einstein.com
Shmuel Einstein & Associates, Inc.
9100 Wilshire Blvd, Suite 235 E
Beverly Hills, CA  90212
310/273-8971 FAX 310/273-8872
-- 
Shmuel Einstein, shmuel@einstein.com
Shmuel Einstein & Associates, Inc.
9100 Wilshire Blvd, Suite 235 E
Beverly Hills, CA  90212
Newsgroups: comp.windows.x.motif
From: koverber@cs.ulowell.edu (Kurt Overberg)
Subject: Re: How to break "Return" laws in a Text widget...
Originator: koverber@bigmax.ulowell.edu
Organization: University of Massachusetts at Lowell Computer Science
Date: Wed, 23 Dec 1992 15:21:31 GMT


Unfortunately, Motif has no way to break the translations. You 
have to drop down to the Xt level.  Using translations you can
remap keys to specific action routines.  It would look 
something like this (this could go in your .Xdefaults file:

myApp*textfield.translations: #override \n\
		<Key>Return: process-tab()

You just want to tell  your application that when Return gets
pressed in this field, you want to do a tab instead of 
process-return() (which normally gets called).  If your text
widget is in a Bulletin Board, you MIGHT have to set
XmNautoUnmanage to False, but Im not sure, because I always
set it to False.

As for your other problem, I too have had great difficulty 
making sure that the keybindings in Motif always did what
they were supposed to do.  I have had my keybindings stop 
working in the middle of running the program!  They just
all stopped working!  Wierd stuff.  I have had the most 
luck just setting all the translations explicitly by hand.
I would advise getting the Motif Programmer's Reference
book, because it gives all the default action routines 
that get called for all the keys (del, backspace, pgup, etc).
Just setting them explicitly has worked better than relying
on Motif to set them for me.  (although this only works 1/2 of
the time!)  Welcome to the wonderful world of Motif KeyBindings!
Good luck!

Happy Holidays!

					peace out.


					    kurt

-- 
Kurt Overberg            | Opinions expressed here are MINE!           
U of Mass, Lowell        | "Poke a double-decker on a Llama taboot,       
koverber@cs.ulowell.edu  |  Llama taboot, taboot!"      -Phish

Newsgroups: comp.windows.x.motif
From: root@shawn.uucp (Mark Jeghers -- UNIX/X/Motif Contractor)
Subject: Re: Problem with C++ keywords in motif include files
Organization: Mark Jeghers -- UNIX/X/Motif Contractor
Distribution: inet
Date: Fri, 25 Dec 92 09:20:57 GMT

ewang@cory.Berkeley.EDU (Edward S.T. Wang) writes:


>I'm trying to compile a C++ program using Motif 1.1.3 on SunOS 4.1.1, and
>I'm running into compilation errors due to the use of C++ keywords such
>as "class" and "new" in the include files.
>	In file X11/ShellP.h, the struct ApplicationShellPart contains a

This is a private header file, not meant to be included in your program.
By including it, you break the encapsulation of the Xt architecture.
Of all places, a C++ program is not a place where we relish the violation
of encapsulated data...:-)

>In file Xm/Traversal.h,
>the struct _XmFocusMovedCallbackStruct contains a Widget called "new".

Hmmm...you got me here.  I don't know if any public headers include 
this or not, probably easy enough to check.  In the event that it is
only included by private header files, then removing X11/ShellP.h
might do the trick - there's one way to find out...

Mark Jeghers
UNIX/X/Motif Contractor
408-281-4823 [voicemail]
From: ramakris@csgrad.cs.vt.edu (S.Ramakrishnan)
Newsgroups: comp.windows.x.motif
Subject: Re: Text Label Widget Flicker
Date: 4 Jan 93 04:34:35 GMT
Organization: VPI&SU Computer Science Department, Blacksburg, VA

In article <66040007@misty.boeing.com> pirson@misty.boeing.com (Chris Pirson) writes:
  
  >The problem is an annoying flicker [whenever the label string is
  > updated]. All the text in the widget flickers even if only a single 
  >character has changed.  
   ...
  >Am I going about this monitor application all wrong, is there a simple fix,
  >or am I SOL?

I think you're Sol. XtSetValue on a (label) widget causes the expose
method to be invoked which causes the whole window (of the widget) to
be repainted. Hence the flicker.

However, if I am wrong in so interpreting, would someone please correct
me ? I have seen this problem in another context: 

When enabling/disabling a pushbutton. When one attempts to enable 
(XmNsensitive = True) or disable (XmNsensitive = False) a Pushbutton, 
there is a visible flicker. Hence the enabling/disabling of pushbuttons 
is not as "neat" as it is in Macintosh UI. 

  >I'm using monospaced fonts.

Fonts have nothing to do with this.

  >Chris Pirson                 |B\______o=o=o.        Flight Test Engineering

---
S Ramakrishnan, CS Dept, McBryde Hall, VaTech
From: sllkz@cc.usu.edu
Newsgroups: comp.windows.x.motif
Subject: Please Subscribe me
Date: 30 Dec 92 21:22:18 MDT
Organization: Utah State University

Please subscribe me. Thanks
Newsgroups: comp.windows.x.motif