HDTenEightyP/NetNews huggingface dataset:
From: reed@snake.tc.cornell.edu (Michael G. Reed)
Newsgroups: comp.windows.x.motif
Subject: Re: stderr and stdout to XmText widget
Keywords: stderr stdout XmText
Date: 12 Aug 92 19:25:00 GMT
Reply-To: reed@Theory.TC.Cornell.EDU
Distribution: comp.windows.x.motif
Organization: Cornell National Supercomputing Facility


Here's some code I used not to long ago.  It pipes stderr/stdout from it's
child processes to a text widget (assumes the text widget is already created
and called "console", a global), but it's easily modified to do it for the
current app (as a matter of fact, I think the changes I just did will snag
the current app).  Hope this helps.

-Michael



int             child_pipe[2];
FILE           *from_console;
FILE           *to_console;
Widget		top_level;  /* toplevel shell */
Widget          console;    /* your text widget */

{
	if (pipe (child_pipe))
	{
		fprintf (stderr, "%s: Could not open child pipe.\n", progname);
		exit (PIPE_ERROR);
	}
	to_console = fdopen (child_pipe[1], "w");
	from_console = fdopen (child_pipe[0], "r");
	XtAppAddInput (XtWidgetToApplicationContext (toplevel), child_pipe[0],
		       (XtPointer) XtInputReadMask, output_from_child, NULL);

/* These two lines can apply to your current app, or children...nice for getting
   stderr/stdout from child processes */

	if ((n1 = dup2 (child_pipe[1], 1)) == -1)
		fprintf (stderr, "%s: Failed to duplicate to stdout.\n", progname);
	if ((n2 = dup2 (child_pipe[1], 2)) == -1)
		fprintf (stderr, "%s: Failed to duplicate to stderr.\n", progname);
}


void
output_from_child ()

{

        int             fd,
	                dummy = 0,
                        oldstat;
	char            buf[8192];
	char           *temp;


	fd = fileno (from_console);
	oldstat = fcntl (fd, F_GETFL, dummy);
	fcntl (fd, F_SETFL, oldstat | O_NDELAY);
	temp = fgets (buf, 8192, from_console);
	while (temp != NULL)
	  {
	    XmTextInsert (console, XmTextGetLastPosition (console), buf);
	    XmTextShowPosition (console, XmTextGetLastPosition (console));
	    temp = fgets (buf, 8192, from_console);
	  }
	fcntl (fd, F_SETFL, oldstat);
}


In article <1992Aug12.172834.21325@Veritas.COM>, joe@Veritas.COM (Joe Fasano) writes:
|> Does anyone have a method for redirecting 
|> stdout and stderr to the XmText widget ? 
|> 
|>    Thanks, 
|> 
|>    joe@veritas.com
|> 
|> -- 
|> 	-------------------------------------------------------------
|> 	joe			ARPAnet:  veritas!joe@apple.com
|> 	joe@veritas.com		UUCPnet:  {apple,pyramid}!veritas!joe
-----------------------------------------------------------------------------
Michael G. Reed                                  (reed@Theory.TC.Cornell.edu)
Cornell National Supercomputing Facility                       (607)/254-8806
-----------------------------------------------------------------------------
        Why be normal, it's boring; and boring people should be shot.

Note:  These are not the views of my employer (and probably not mine either).
From: jan@PANDONIA.CANBERRA.EDU.AU (Jan Newmarch)
Newsgroups: comp.windows.x.motif
Subject: Size/frequency of FAQ posting
Date: 21 Aug 92 15:36:25 GMT
Distribution: inet
Organization: The Internet

I have been maintaining the Motif FAQ for nearly a year and a half now.
What started off small has grown: the Motif FAQ is now up around 180k.
The total posting to this group and to motif-talk is about 2.4M
per month.  That is, the FAQ is about 1/12 of the total volume of
posting to this group.  As someone has just pointed out, this works
against the idea that the FAQ is to *reduce* the volume.
It does, I think, succeed in reducing the amount of 'noise' in that
a lot of queries are answered without having to post.  I do get quite
a lot of comments that "I found the answer in the FAQ".

Some possibilities for reducing the volume include:

-	Post the FAQ every two months instead (this may increase the
	noise though).
-	Post the full FAQ say every quarter,and diff-ed updates each month.
-	compress and uuencode the FAQ (this reduces its size by about one
	half, but makes it a little harder to read).
-	discard all old entries referring to Motif 1.0 (but there seem to
	be many 1.0 systems still out there).
-	Post just the questions each month, with a pointer to an ftp or
	mail site for the answers.
-	Carry on as is, and ignore the problem.

Does anyone have any comments? I don't really mind what is done.

				Jan
-- 
+----------------------+---+
  Jan Newmarch, Information Science and Engineering,
  University of Canberra, PO Box 1, Belconnen, Act 2616
  Australia. Tel: (Aust) 6-2012422. Fax: (Aust) 6-2015041

  AARnet: jan@ise.canberra.edu.au
  ARPA:   jan%ise.canberra.edu.au@uunet.uu.net
  UUCP:   {uunet,ukc}!munnari!ise.canberra.edu.au!jan
  JANET:  jan%au.edu.canberra.ise@EAN-RELAY

+--------------------------+
From: cs000hf@selway.umt.edu (Hong Fan)
Newsgroups: comp.windows.x.motif
Subject: How to auto-resize of XmDrawingAreaWidget and simulate resize event.
Date: 20 Aug 92 17:49:58 GMT
Distribution: usa
Organization: University of Montana

Hi everybody:

I have a problem dealing with XmDrawAreaingWidget. Is there a resource
to set the automatic growing of this wiget if it needs? I want to all the 
graph to be visible.   

Other questions is how to simulated the resize event of DrawAreaWidget so I
could resize the size of it, or How to attach it to a scrolled window and
get use of scrolledBar.

If you have any suggestion, please mail me at cs000hf@selway.umt.edu. I
appreicate your the time and help. 


Hong Fan
CS. Dept.
U of Monatana
From: deveau@oceanroutes.ns.ca ("Terry J. Deveau")
Newsgroups: comp.windows.x.motif
Subject: Re: Ctrl<Key>q to quit
Date: 14 Aug 92 18:53:09 GMT
Distribution: inet
Organization: Oceanroutes Canada Inc.

> From: hoswell@tramp.colorado.edu
>
> > From: deveau@oceanroutes.ns.ca
> >
> > > From: hoswell@tramp.colorado.edu
> > 
> > >I'm having a bit of a problem setting a simple default translation...
> > >
> > >All I want to do is have a Quit routine called when I hit Ctrl<Key>q.
> > >
> > >I've tried this:
> > >
> > >static XtActionsRec actionsTable[] = {
> > >    {"bye", Quit},
> > >};
> > >static char         defaultTranslations[] = "Ctrl<Key>q: bye()";
> > 
> > Have you considered using an XmAccelerator instead?
> > 
> 
> uh, no - simply because I don't know how!  I understand that, for instance,
> I can have a 'Quit' button and have an 'Accelerator' associated with it...
> Is it easy to set up?

Yes it is easy to set up.  See the XmNaccelerator and XmNacceleratorText
resources of the XmPushbuttonGadget widget (as inherited from
XmLabelGadget).  Note that it only works if the push button is in a
pulldown or popup menu pane (see FAQ-Motif, subject 59).  The code
below should give you the general idea:

    int n;
    Arg arg[10];
    XmString str, str2;
    Widget pushbutton, menuPane;

    n = 0;
    str = XmStringCreateLtoR ("Button Label", XmSTRING_DEFAULT_CHARSET);
    XtSetArg(arg[n], XmNlabelString, str); n++;
    XtSetArg(arg[n], XmNaccelerator, "Ctrl<Key>q: bye()"); n++;
    str2 = XmStringCreateLtoR (" (^Q)", XmSTRING_DEFAULT_CHARSET);
    XtSetArg(arg[n], XmNacceleratorText, str2); n++;

    pushbutton = XmCreatePushbuttonGadget(menuPane,"pushbutton", arg, n);
    XmStringFree (str);
    XmStringFree (str2);

... Terry
Newsgroups: comp.windows.x.motif
From: xsong@marcus.cs.umn.edu (Xiaohui Carol Song)
Subject: Help: how big  is Motif
Organization: University of Minnesota
Date: Tue, 18 Aug 1992 16:38:04 GMT

For those who have built Motif on your systems,
could you tell me how much disk space is needed for building Motif?

Thanks!

Carol Song
xsong@cs.umn.edu
Newsgroups: comp.windows.x.motif
From: ark@athena.mit.edu (Andrew Kirmse)
Subject: Main loop for multiple app contexts
Organization: Massachusetts Institute of Technology
Date: Fri, 14 Aug 1992 22:18:23 GMT

	I'm looking for an efficient main loop to use in a program that uses
several displays via multiple application contexts.  Currently I poll
continuously for events using something like:

  while (1)
    {
      for (i=0; i < num_apps; i++)
        {
          if (XEventsQueued(displays[i], QueuedAfterReading))
            {
              XtAppNextEvent(appcontexts[i], &event);
              XtDispatchEvent(&event);
            }
          else XFlush(displays[i]);
	  /* background processing here */
        }
    }

but this puts a large load on my machine.  Can I perform a select() call on the
display connection file descriptors?  Or are there other ways?
	Please respond via email.  Thanks!

---Andrew Kirmse
   ark@athena.mit.edu
From: tmoulto@tecsun1.etl.army.mil (Thomas A. Moulton)
Newsgroups: comp.windows.x.motif
Subject: Deleting text inside a Scrolled Text Widget
Summary: Deleting text inside a Scrolled Text Widget
Keywords: Scrolled Text Widget
Date: 21 Aug 92 20:14:16 GMT
Organization: U.S. Army Topographic Engineering Center, Ft. Belvoir, VA.


        I have written a text editor using the Scrolled Text Widget.

text = XmCreateScrolledText(form, "text", TextArgs, TextArgCnt);
                                                                   re
Whenever a line or groups of lines are deleted from text inside this     et
widget the Scrolled Text widget most often than not becomes premature   o
in displaying the end of the text buffer.  For instance, if I were to delete
a twenty line procedure from the text buffer and then scroll to the bottom
of the file, the true bottom of the file would not be showing.  In other
words the Scrolled Widget appears to get mixed up as to where the end of 
the text buffer is.  The result is that the user is unable to see the bottom
portion of the text buffer.

	I would appreciate anyones insight into this matter.  I do not 
believe that this is a glich in my code.  I have seen another program which
uses a Scrolled Text Widget and it also suffers from the same problem.

Thanks,


Tom Moulton
Newsgroups: comp.windows.x.motif
From: dpotlur@hubcap.clemson.edu (Potluri Dora)
Subject: To Mark, Visual Edge Software ( Mail Bounced )
Keywords: motif
Organization: Clemson University
Date: Sun, 16 Aug 1992 21:35:01 GMT


To: mark@vedge.UUCP
Orig-To: mark@vedge.UUCP (Mark Paterson)
Subject: Re: UIM/X Interpreter and prototypes
Newsgroups: comp.windows.x.motif

In comp.windows.x.motif you write:

>GUI Users,

>To begin with, I work for Visual Edge Software, the company which makes
>UIM/X, so I admit that I am rather biast when it comes to the subject
>of GUI builders. However, recently an article was posted inquiring about
>UIM/X's interpreter and Chris Hare responded to it and stated that UIM/X's
>interpreter was helpful but that it didn't support prototypes yet. This
>however isn't true.

>By default, the UIM/X interpreter starts up in K&R mode but it can also
>be used in ANSI mode. You simply have to edit the UIM/X resource file.
>Edit the settings for the Uimx2_0.CFLAGS resource as folows:

>	1) add -ansi to the list of flags.

>	2) remove -D_NO_PROTO if it is present since there is no
>	   use running the interpreter in ansi mode if you don't
>	   allow the prootype stuff in the header files through.

>The next time you start up UIM/X the interpreter will be in ansi mode.


>Mark Paterson
hi,
	we have uimx/2.0 running on dec platforms and I have a couple of
questions the way uimx works. 
	In the main interface file I incude my header files and everything
works fine. When I try to add some code or call the functions whose prototypes
are in .h files it will simply blow up and gives whole bunch of errors while I
try to save it.
	It will save it if I declare the function I am calling as extern function 
name. According to normal c standards I do not have to do that. That is the reason
we have the functions in the header file and we include the header file in the 
main application.
	Another major problem I face in day to use is. I have one header file and
it has to be included in all the six interfaces I designed. But It accepts in the
main application shell and after that if I try to include it in the second
interface it give some errors near typedefs in the header file. 
	So these are some of the problems in using uimx and I was looking for
some one to discuss these problems and the way to work around it.
	I typically declare the functions that are in header file and when I 
use them in the callbacks I redeclare them as externs. This is not the 
right way to do it.
	After uimx2.0 generates the .c files we edit the files and add the 
include header files and compile it on the command prompt.
	Are these uimx2.0 problems or I am doing something wrong.
I would appreciate if you can mail me the solution to the above problem.   


-- 
Potluri Dora
Dept Of Computer Science
Clemson University
Clemson, sc 29631
From: avinash@felix.contex.com (Avinash Chopde)
Newsgroups: comp.windows.x.motif
Subject: Wcl - does it have any usage or re-distribution restrictions ?
Date: 20 Aug 92 18:30:39 GMT
Distribution: usa

I just picked up Wcl 2.2 from the MIT FTP site, and am trying to
ascertain whether commercial software developers can make use of the Wcl
library --- I could not locate any usage or re-distribution licenses. 

I am not looking for legal advice here, just net-opinions...
Thanks for any help...
-- 
---------------------------
Avinash Chopde         office : 617 246 1776x5582
avinash@contex.com     (...!uunet!contex!avinash)
From: snail@lsl.co.uk
Newsgroups: comp.windows.x.motif
Subject: Re: HELP: Error: Couldn't find per display information
Date: 12 Aug 92 12:13:13 GMT
Organization: Laser-Scan Ltd., Cambridge

Whenever I've seen a crash in XtAppCreateShell() then it's because the
DISPLAY environment variable isn't set. If you are displaying on the machine
you running from do

setenv DISPLAY :0.0

This may cure your problem.
If displaying on another machine

setenv DISPLAY <machine name>:0.0

We have the strange thing here that if you are the guy who logins in to the
workstation at the screen (the first guy) you don't need to do the setenv, but
if you then come along and do an

su - myusername

you must do the setenv otherwise you'll get segment faults etc..


Regards
Stephen Kellett
snail@lsl.co.uk
Newsgroups: comp.windows.x.motif
From: chow@sdc1.ssc.gov (Ivan Chow,,6212)
Subject: List Widget problems
Reply-To: chow@sdc1.ssc.gov
Organization: Sun Microsystems, Inc.
Date: Mon, 17 Aug 1992 22:40:01 GMT

Dear world,
     Can anyone tell me how go get rid of the dashline box for the List
widget?  Thanks

Ivan
Newsgroups: comp.windows.x.motif
From: jrwilcox@athena.mit.edu (Jason R Wilcox)
Subject: XmVaCreateSimpleRadioBox help!
Organization: Massachusetts Institute of Technology
Date: Wed, 12 Aug 1992 18:52:46 GMT



	When I use XmVaCreateSimpleRadioBox, nothing happens.  The application
compiles fine and runs, but the RadioBox and its associated toggle buttons
do not appear.  I can't figure out what I'm missing.  When I use
XmCreateSimpleRadioBox and create the toggle buttons separately everthing works
fine.

I type the following:

	.
	.
	//  above created a form.
	.
XmString btn1 = XmStringCreateSimple("AND operator");
XmString btn2 = XmStringCreateSimple("OR operator");
XmString btn3 = XmStringCreateSimple("NOT operator");
radio_box = XmVaCreateSimpleRadioBox(form, "radio box", 0,
                                     &RequestBoolean::toggleCallback,
                                     XmVaRADIOBUTTON, btn1, 0, NULL, NULL,
                                     XmVaRADIOBUTTON, btn2, 0, NULL, NULL,
                                     XmVaRADIOBUTTON, btn3, 0, NULL, NULL,
                                     NULL);
XtManageChild(radio_box);
XtManageChild(form);
	.
	.

So whats going on?  Do I need to somehow manage the toggle buttons?
I'm using R11R4 and motif 1.1.4.

Thanks in advance
jason
From: 6500mack@ucsbuxa.ucsb.edu (Michael P. Mack)
Newsgroups: comp.windows.x.motif
Subject: DrawingArea and Colormaps Problem
Keywords: colormap
Date: 17 Aug 92 08:36:52 GMT

I am writing an application that draws images in a DrawingArea
Widget with the option of changing the colormap.  I want the
new colormap to be active only when the pointer is in the
DrawingArea.  However I can't seem to get it to work right.

I set the window colormap for the DrawingArea using this callback
routine (there are buttons to select a colormap):

  void changeColormap(w,client_data,call_data)
    Widget w;
    caddr_t client_data;
    XmAnyCallbackStruct *call_data;
    {
    Window win;

    win = XtWindow(Draw);
    switch ((int)client_data)  {
      case BW  : XSetWindowColormap(disp,win,BWcmap); break;
      case RGB : XSetWindowColormap(disp,win,RGBcmap); break;
      default  : XSetWindowColormap(disp,win,cmap); break;
      }
    }

As it is written, absolutely no change occurs when the pointer is
in the DrawingArea.  If I change to 'win = XtWindow(topwidget);'
then the colormap is installed whenever the pointer is in the main
window, but when this happens I can't see any of the buttons.

I have tried XtSetSensitive() on the DrawingArea with no luck.
I even set up the WM_COLORMAP_WINDOWS property using the code
shown here (this is the first time I've used this function so
please tell me if it is incorrect):

  Window win=XtWindow(Draw);
  XSetWMColormapWindows(disp,win,&win,1);
                             ^^^
                             I even tried XtWindow(topwidget)

I am going crazy trying to figure out how to do this since I
know it is possible!

Any help will be GREATLY appreciated.


Mike Mack
6500mack@ucsbuxa.ucsb.edu
Newsgroups: comp.windows.x.motif
Subject: looking for wml under HP300/HP700
From: ofer@chen.bgu.ac.il (Ofer Reshef)
Date: Mon, 17 Aug 1992 19:44:54 GMT
Organization: Ben Gurion University, Beer Sheva, Israel

Hi All,
  I am looking for wml (widget meta language) for HP300 and/or HP700.
  (wml is used to add support for user defined widgets in uil files).
  Does anyone know about it ?
  I'd appreciate any help.

      Thanks in advance,
         Ofer Reshef (ofer@chen.bgu.ac.il)
From: squire@eclus.dnet
Newsgroups: comp.windows.x.motif
Subject: FAQ too big too often
Date: 21 Aug 92 06:07:22 GMT
Distribution: inet
Organization: The Internet

I vote for a readable FAQ once every two months.
The size may be large but it is only 5 out of 800 messages.
Jon         squire@tron.bwi.wec.com
Newsgroups: comp.windows.x.motif
From: scott@asd.com (Scott Barman)
Subject: UIM/X question
Organization: American Software Development Corp., West Babylon, NY
Date: Tue, 11 Aug 1992 20:50:51 GMT

If someone using UIM/X or the HP equivalent can answer this it would
be appreciated:

Is there anyway to tell UIM/X to add more than one function to a
callback?  For example, I want to have a second callback called on the
modifyVerifyCallback in a textField widget, how can I tell UIM/X this?

aTdHvAaNnKcSe!
-- 
scott barman			| <This space intentionally left blank>
scott@asd.com			|
 (I can barely speak for myself, you expect me to speak for my employer??)
From: ccarpent@dw3f.ess.harris.com (Craig Carpenter)
Newsgroups: comp.windows.x.motif
Subject: Selection Dialog Box Dialog Types
Date: 20 Aug 92 12:40:09 GMT
Reply-To: ccarpent@dw3f.ess.harris.com (Craig Carpenter)
Organization: Harris GISD

--
I am using a GUI builder to build my UIL and have seen some wierdness
with the Selection
Box and I do not understand why.

The Dialog Types for the Canned Selection Dialog are selectable and are
set in the UIL, for 
example

object box_Filter_Selection : XmSelectionDialog widget {
    arguments {
        XmNautoUnmanage = true;
        XmNdialogStyle = XmDIALOG_APPLICATION_MODAL;
        XmNdialogTitle = 'FILTER SELECTION';
        XmNselectionLabelString = 'SELECTION';
        XmNlistLabelString = 'FILTERS';
        XmNdialogType = XmDIALOG_WORK_AREA;
        XmNx = 490;         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^=======Set here
        XmNy = 40;
        XmNwidth = 214;
        XmNheight = 295;
    };
    controls {
    };
    callbacks {
        XmNokCallback =  procedure cb_Filter_Open_Ok(0);
    };
};

Once this object is realize on the display via Mrm it ignores the Dialog
type and uses the  
default selection box widget. It does not matter which of the type I use
I get the same results
and I can't change it in the code. X gives me a warning about unable to
change dialog type.

Anyone have any clues as to why this is happening. Is this a Motif bug,
or a GUI builder 
problem. Since the UIL Looks good I can't believe that the Builder is
causing the problem.

Thanks

============================================================================= 
                                                 
Craig Carpenter                                   HARRIS CORPORATION
E-Mail: ccarpent@dw3f.ess.harris.com 	  IIIIIIIII    SSSSSSSS   DDDDDDD
Phone : (407)984-6444                         I        S          D      D
Fax   : (407)984-6327                         I        SSSSSSSS   D      D
                                              I               S   D      D
"Me, Myself, and I have                   IIIIIIIII    SSSSSSSS   DDDDDDD
these opinions, not the company"
============================================================================
From: erabelli@spso.gsfc.nasa.gov
Newsgroups: comp.windows.x.motif
Subject: Re: Callback on entering TextField widgets
Keywords: TextField, Text, Callback, Activate, Focus
Date: 19 Aug 92 13:13:00 GMT
Distribution: usa
Organization: NASA - Goddard Space Flight Center
News-Software: VAX/VMS VNEWS 1.41

In article <1992Aug19.012424.22513@iitmax.iit.edu>, chien@iitmax.iit.edu (Greg Chien) writes...
>How does one get a callback on entering rather than on leaving the widget 
(Text Widget).

Try gainFocusCallback.

- Erabelli
From: connolly@convex.com (Dan Connolly)
Newsgroups: comp.windows.x.motif
Subject: Re: Formatted Text
Keywords: rich text richtext rtf formatted text
Date: 19 Aug 92 00:20:03 GMT
Organization: Engineering, CONVEX Computer Corp., Richardson, Tx., USA
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

In article <4757@balrog.ctron.com> smith@ctron.com writes:
>
>If it doesn't have to be a widget, check out Apollo's Text Management Library.
>It's available for ftp as TMLib from gatekeeper.dec.com, among other places.
>The extended version, which may be available by now, includes extensive
>hypertext capabilities, and both versions provide every concievable kind of
>formatting and character-management facilities including rendering left/right,
>right/left, up/down, down/up and bustrophedon, and both kits are fully
>extensible for anything you feel was left out.

I used it to develop a tutorial. I could not, for the life of me, figure
out how to do reverse indents or tabs. The thing is written in C++,
but there is at least one part of the code that has two sets of methods:
both sets are public, but one is marked with a comment: "don't use
these -- they're for internal use only." I suspect there was at least
one developer who was very new to C++. And there was a lot of copy-and-
paste programming: the algorithm for finding the amount of whitespace
at the beginning of a line is duplicated in at least three places.

I liked the model/format/view architecture, and the documentation
is excellent, but the implementation leaves a lot to be desired.
I didn't find it very extensible at all. They didn't use the information
hiding and encapsulation features of C++ very well, so subclassing
was a major bear.


>  It's designed to work under
>X and render into an X-window - a DrawArea will do.  You can attach your own
>translations with minimal trouble.  Full documentation in PostScript format
>including a Programmer's Reference and Guide are included (and are the bulk
>of the distribution, last I looked.)  It's quality stuff.
>
Well, yes, it's quality stuff as long as you don't look under the hood
and as long as you don't need to extend it. It does work, and it doesn't
coredump. It's reasonably speedy.

Dan