HDTenEightyP/NetNews huggingface dataset:
From: klute@tommy.informatik.uni-dortmund.de (Rainer Klute)
Newsgroups: comp.windows.x
Subject: Re: Color string to nearest match converter?
Date: 28 Sep 1992 16:42:10 GMT
Organization: CS Department, Dortmund University, Germany
Distribution: world
NNTP-Posting-Host: tommy

In article <ghawkins.717351964@unix1.tcd.ie>, ghawkins@unix1.tcd.ie (George
C. Hawkins) writes:
|> 
|> Before I write it could somebody help me out and send me the code
|> for a converter that takes a string (matching one of the entries
|> in rgb.txt) and returns the nearest matching color available in
|> the current colormap if it cannot get that exact color.  I imagine
|> it should be quite easy to do, just request the contents of the
|> entire colormap using XQueryColors and then scan it. If you've
|> already written this please could I have a copy?


The following code does this on Xlib level. If you are using Xt, you could
make use of the string to pixel converter (see below).


/* This function tries to lookup a named color and to allocate a color cell
   in a read-only colormap. A pixel value will be returned. If anything
   fails, the specified default pixel value will be returned. */

unsigned long AllocateNamedColor (display, colormap, colorName, defaultPixel)
Display *display;
Colormap colormap;
char *colorName;
unsigned long defaultPixel;
{
    XColor exact, bestMatch;
    if (XLookupColor (display, colormap, colorName, &exact, &bestMatch) != 0)
    {
        if (XAllocColor (display, colormap, &bestMatch) == 0)
        {
            fprintf (stderr,
                     "Could not allocate color cell for %s, using default\n",
                     colorName);
            return defaultPixel;
        }
    }
    else
    {
        fprintf (stderr, "Color name %s not found, using default\n",
                 colorName);
        return defaultPixel;
    }
    return bestMatch.pixel;
}


Here's a program fragment using Xt's string to pixel converter:

    XrmValue from, to;
    unsigned long pixel;

    from.size = strlen (colorName) + 1;
    from.addr = colorName;
    to.size = sizeof (unsigned long);
    to.addr = (XtPointer) &pixel;
    if (XtConvertAndStore (w, XtRString, &from, XtRPixel, &to) == False)
    {/* conversion failed */}

-- 
  Dipl.-Inform. Rainer Klute      klute@irb.informatik.uni-dortmund.de
  Univ. Dortmund, IRB
  Postfach 500500         |)|/    Tel.: +49 231 755-4663
D-W4600 Dortmund 50       |\|\    Fax : +49 231 755-2386
Newsgroups: comp.windows.x
From: yeo@inherit2.mbi.ucla.edu (Simon Yeo)
Subject: XDM and Console Windows
Organization: UCLA Cognitive Science Research Program
Date: Mon, 28 Sep 1992 18:11:45 GMT


-- 

I finally managed to get xdm to work with Xsun(X11R5) on my Sparcstation IPC,
and console cmdtool does not seem to work with xdm.  
Whenever xdm is running, the console messages appear on the monitor screen and
screws everything up. 
Is there a way to suppress console messages or display them in a window, so
the messages don't mess up the screen?

Thanks in advance.

----
	/____ |		Simon Yeo	University of California, LA
	|o o ||		--------------------------------------------	
	| <  |/		yeo@inherit2.mbi.ucla.edu	yeo@seas.ucla.edu
	| ^  |		
	 \__/		"To be a true poet is to become God."
Newsgroups: comp.windows.x,comp.windows.x.motif
From: stieber@kreutler.de (Juergen Stieber)
Subject: Three questions concerning Motif GUI builders
Organization: KREUTLER GmbH, 7500 Karlsruhe 1, Germany
Date: Tue, 29 Sep 1992 14:16:18 GMT

Hello Xperts,

I have three questions concerning interactive Motif GUI Builders.
The questions are rather independent of each other.

1) We are planning to develop an application in C++, and we also
   want to use one of the various interactive Motif GUI builders which
   generate C (Xm) or C/UIL output (e. g. UIM/X) for building the GUI of our
   application. The question is:

   Are there any drawbacks in mixing C++ and generated C or C/UIL?

   I guess it must be possible without any major problems, but
   maybe I'm wrong :-(
   In the FAQ list of comp.windows.x are a few hints, but I'm interested in
   personal opinions or experiences, because no one of us has practical
   experience in C++ programming or building interfaces with a GUI builder
   until now.

2) One of our main requirements is the ability of customizing the GUI of
   the above mentioned application for our customers AFTER compiling and
   linking. I know that this is possible e. g. by changing the resource
   values in application specific resource files.
   So far nothing exciting. My question now is:

   Is it possible to use an interactive Motif GUI builders which supports
   application specific resource files (e. g. UIM/X) as interactive
   resource file editors, especially after compiling and linking the
   application ???

   We think it's not reasonable for our support to edit resource files with
   a normal text editor. Any hints or suggestions are welcome, of course
   also other techniques/possibilities.

3) One of the main interface objects of our application will be forms in
   arbitrary shape and size, e. g. for use as RDBMS data entry interfaces.
   The question is:

   Is it possible/reasonable to build such forms with an interactive Motif
   GUI builder ???
   If the answer is yes, how about performance drawbacks ?
   Colleagues are doubtful on this and say that form generators
   such as Accell have to be used.

   I know that there are possibilities of creating templates and combining
   single GUI objects to create complex interface objects which can
   be treated as one object, etc. Any hints or practical experiences are
   appreciated.

Please answer by e-mail.

Thanks, Juergen

-- 
 Juergen Stieber                        Phone: +49 721 8508-86
 KREUTLER GmbH                          Fax:   +49 721 8508-90
 P.O.B. 3744
 D-7500 Karlsruhe 1,    Germany         Mail:  stieber@kreutler.de
Newsgroups: comp.windows.x
From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
Subject: Re: Color string to nearest match converter?
Organization: McGill Research Centre for Intelligent Machines
Date: Tue, 29 Sep 92 04:18:12 GMT

In article <920925083648.21c00207@TGV.COM>, mahan@TGV.COM (Patrick L. Mahan) writes:
[hm, did I delete this attribution line by mistake or did it get lost?]
>> Before I write it could somebody help me out and send me the code
>> for a converter that takes a string (matching one of the entries in
>> rgb.txt) and returns the nearest matching color available in the
>> current colormap if it cannot get that exact color.

> Have you ever tried: XAllocNamedColor()?

Patrick, you should know better than that.  That works only for the
static visual types.  For dynamic visuals that will round the color to
the nearest color the hardware supports, but if it then can't find that
rounded color in a read-only cell the colormap, it will fail rather
than returning the closest cell that does exist.

>> I imagine it should be quite easy to do, just request the contents
>> of the entire colormap using XQueryColors and then scan it.

Not quite that easy.  You don't want to use a read/write cell, because
it may be changed behind your back at any time.  Unfortunately there is
no way to query whether a cell is read/write or read-only.

Note also that the colors reteurned for unallocated colormap cells are
undefined; there is no promise that they bear any relationship to what
would appear on the screen if you drew with a corresponding pixel
value.

					der Mouse

			    mouse@larry.mcrcim.mcgill.edu
Newsgroups: comp.windows.x
From: troy@kurangocit.gu.edu.au (Troy Baalham)
Subject:  Re: mirroring an X display
Organization: Griffith University, Brisbane, Australia.
X-Newsreader: Tin 1.1 PL3
Date: Wed, 30 Sep 92 08:02:25 GMT

A package called xmx is available from the Computer Science Department
at Brown University.  Here is a bit of the blurb from the README

> XMX is an X protocol multiplexor.  It is a standalone utility for
> displaying an X Windows session on multiple displays.  XMX takes 
> advantage of the networked nature of the X Window System by tapping 
> the communication link between an X client and an X server.  In this 
> way, XMX works with any X clients and any X servers, without the need 
> to modify either.
> 
> It's tempting to call this "broadcast software," and that is certainly
> the effect.  In reality, though, XMX is "multicast" software.  It must know
> all the slave machines ahead of time and it connects to each one directly.
> XMX is more like mail than news.
> 
> XMX connects to N servers like an X client, then accepts connections
> from M clients like an X server.  One of those servers is designated the
> "master" from which input is directed to the clients.  The other servers are
> "slaves".Slave servers receive only those protocol requests that are necessary
> for them to maintain a visual look-alike of the master server's display.
> 
> This software was developed at Brown University for use in our electronic
> classroom.  Some version of it has been in use here since 1988.

All I have is a copy of the README file, so for more info, I'd email
	John Bazik at Brown University
	Email: jsb@cs.brown.edu
Newsgroups: comp.windows.x
From: prado@enuxhb.eas.asu.edu (Louis A. Prado)
Subject: FTP Sites for PD Unix/X-Windows Software
Organization: Arizona State University
Date: Sun, 4 Oct 1992 20:29:46 GMT

Greetings.  I am very new to X-Windows/Unix and was wondering if there are
FTP sites for PD or shareware software.  In particular I am looking for a
TeX compiler and fonts, or animation demos for X-Windows.  Any suggestions
would be greatly appreciated.  Thanx.

r
--
Lou Prado	EE  Undergrad   Arizona State Univ   prado@enuxhb.eas.asu.edu
					       	     auLOU@acvax.inre.asu.edu
Newsgroups: comp.windows.x
From: bvh@cse.unl.edu (Ben Hollingsworth)
Subject: Re: Internationalization and Kanjai support in Xlib
Organization: University of Nebraska - Lincoln
Date: Tue, 6 Oct 1992 00:39:51 GMT

izeek@techunix.technion.ac.il (Ilan Aisic) writes:

>We have to "internationalize" a large GUI that is based on Xlib.
>I would appreciate any comments, hints about doing that.
>Our application runs on the Sun with X11R4.
>In particular, we need to add support to 16 bit character sets (Kanji font).
>Of course, supporting European languages is a must and supporting Arabic and
>Hebrew (which have a small character set but are typed from right to left)
>may also be needed.
>In addition to the code changes that we will have to make (like calling 
>"XDrawString16" instead of "XDrawString" for Kanjai), I wonder what 
>software tools are out there to help when dealing with two-byte fonts
>(Is there an "xfd16" which will be the equivalent of "xfd") ? 
>Is there anything in X11 to support locale?

My company (or rather, the one I work for) is also i18ning a large
GUI app written in Motif.  One of our big questions is:  Is there
any way to make a 16-bit resource file?  If not, it seems a serious
deficiency given the support that X/Motif gives in other areas.

				-- Obi-Wan
					Software Engineer,
					MicroImages, Inc.

--
 |\_/|  AACK! ||  My motto:             ||  "Obi-Wan" (Ben Hollingsworth)
\'o.0'/       ||    Eat right,          ||  MicroImages, Inc.  Lincoln, Nebraska
=(___)=       ||    exercise regularly, ||  University of Nebraska - Lincoln
   U   PTHAT! ||    and die anyway.     ||  email:  bvh@cse.unl.edu
Newsgroups: comp.windows.x,comp.windows.x.apps
From: gerald@atlastele.com (Gerald Aden)
Subject: Anyone using AnswerGarden?
Organization: Atlas Telecom Inc.
Date: Wed, 30 Sep 1992 17:41:53 GMT

Is anyone out there using AnswerGarden?  I tried running it under both
X11R5 and OpenWindows3.  I tried clicking on all the buttons but nothing
happens execpt it does quit when I click on the quit button.  Am I missing
something here?  Also, is there a later version of AnswerGarden than what
is on the original X11R5 contrib tape?

Thanks in advance,
Gerald Aden
-- 
Gerald Aden                         EMAIL: gerald@atlastele.com
Atlas Telecom                       VOICE: [USA] 1+503.228.1400 x659
4640 SW Macadam Ave.                FAX1:  [USA] 1+503.225.5518
Portland, OR 97201                  FAX2:  [USA] 1+503.228.0368
Newsgroups: comp.windows.x
From: ziggy@grafted.UUCP (anthony lewis)
Subject: 3D Twm mode?
Organization: GRAFTED, Central Indiana's Usenet BBS 317-881-4369
Date: Wed, 30 Sep 92 22:30:59 CST

I hope this not too basic of a question, or a "FAQ", ( I am new here.. I 
just got X11 running on my linux system a couple of weeks ago ! ), 
but I was wondering how to get "TWM" to run with the "3D" windowed effect.
I know it can, being there is a test user supplied with my binaries, but
I have no idea what the difference is!.. Thanks for any help, and I hope
to be here for a long time, now that I can run "X" too....


                                        Ziggy.

--
anthony lewis
The Grafted Branch BBS
317-881-4369
internet: ziggy@grafted.UUCP
uucp: ..!uunet!grafted.UUCP!ziggy
 = = Grafted Branch BBS (317) 889-6997 2 Gig on-line = =
From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
Newsgroups: comp.windows.x
Subject: Re: GC Errors
Date: 29 Sep 92 04:23:12 GMT
Organization: McGill Research Centre for Intelligent Machines

In article <1992Sep25.184853.17960@nuscc.nus.sg>, iscooibc@nuscc.nus.sg (Beng Chin) writes:

> [] I got the following error[s].

> X Error of failed request:  BadValue (integer parameter out of range for operation)
> Major opcode of failed request:  55 (X_CreateGC)
> value in failed request:  0x28000d4

[edited severely -dM]
> void WidgetAction::select( Widget w, XEvent *event ) {
> 	XGCValues values;
> 	values.line_style - LineOnOffDash;
> 	values.function = GXxor;
> 	gc = XtGetGC(w, GCForeground | GCBackground |
> 	GCFunction | GCLineStyle, &values);

(XtGetGC I don't know, but I can guess.)  You haven't set the
foreground, background, or line_style elements of the values structure.
(It looks as though you tried to set the line_style, but mistyped.)
Since the foreground and background values are (supposed to be)
truncated to the appropriate number of bits rather than producing
errors, I assume it's the line-style that's causing problems.

Why 0x28000d4, which looks like a window or pixmap or something ID?
Probably just because that's what happened to be lying around in that
piece of memory on the stack.

					der Mouse

			    mouse@larry.mcrcim.mcgill.edu
Newsgroups: comp.windows.x,comp.sys.sun.admin,comp.unix.questions
From: kelly@nmt.edu (kelly)
Subject: Re: MIT X11R5 problem with SUID & SGID
Organization: New Mexico Tech
Date: Tue, 6 Oct 1992 20:08:39 GMT

In article <35607@cbmvax.commodore.com> veiss@cbmvax.commodore.com
(Jeff Veiss - Staff) writes:

>Please reply via E-mail and I'll post the results.

I've decided to post since this seems to be a problem that many users
are experiencing---and it's something wrong in the install script.
I've also trimmed the crossposting.

> [Problems running xterm and other setuid/setgid X programs]

First, read the manpage for ld.so.  Hidden deep in ENVIRONMENT section
it says that `when running a set-user- or set-group-ID program, ld.so
will only search for libraries in directories it "trusts", which are
/usr/lib, /usr/5lib, /usr/local/lib, and any directories specified
within the executable as a result of -L options given when the
executable was constructed.'

So any permutation of your LD_LIBRARY_PATH won't help.  You've got to
make sure the X libraries are installed in the `trusted' directories
or make sure each X client is linked that the -L options that will
actually contain the libraries once you've done the make install.

My next beef has to do with the `install' target and SUN-DES-1
authorization.  The mit `install' target installs xterm as set-uid
root, so it can update the /etc/utmp file.

However, a program that runs set-uid root uses root's key on the local
machine rather your key, rendering SUN-DES-1 authorization only useful
for useless clients like xclock, xman, ... .  You can't run xterms.

The fix: install xterm as set-gid tty, not set-uid root, and make sure
/etc/utmp is group-writable by group tty.  Then, an xterm runs with
your user ID, so it uses your key for SUN-DES-1, and you've got the
protection you were after.

Apparently, the X Consortium didn't test this before X11R5 was
released.  It needs to be fixed.

--k
Newsgroups: comp.windows.x
From: song@open.dal.ca (Kim Song)
Subject: Obtaining RGB values from a Colormap
Organization: OPEN, Dalhousie University, Halifax, NS, Canada
Distribution: dal
Date: Mon, 5 Oct 1992 15:20:03 GMT

   I have already created a colormap for a canvas, and I am trying to find
   the RGB values for that colormap given a pixel value.  The colormap is 
   defined as a part of the cms_data structure below:

   cms_data.red[MAXCOLORS];
   cms_data.green[MAXCOLORS];
   cms_data.blue[MAXCOLORS];

   I have been trying to call the function:
	XQueryColor(display, cmap, colorcell_def) where
		display is connection to an Xserver
		cmap is ID of the colormap from which RGB values are retrieved
		colorcell_def is pixel value         
   As:
	XQueryColor(display, xv_find(canvas,CMS,CMS_NAME,"Palette",NULL), pixel_value);
	"Palette" is the name I gave the colormap.

   But I keep getting the error:

   XView warning: invalid object (not a pointer), xv_get
   signal SEGV (no mapping at the fault address) in cms_set_static_colors at 0xf762ba28
   cms_set_static_colors+0x18:     ld      [%l5 + 24], %l5

   Could someone PLEASE tell me what the cms_set_static_colors error exactly means and what parameter I should be passing in as cmap or any other suggestions 
   you might have?

				Kimberley.


		
   

Newsgroups: comp.windows.x
From: cflatter@nrao.edu (Chris Flatters)
Subject: Re: PHIGS/PEX -HELP
Reply-To: cflatter@nrao.edu
Organization: NRAO
Date: Fri, 2 Oct 1992 17:03:59 GMT

In article 12797@privet.rl.ac.uk, ls@inf.rl.ac.uk (Lakshmi Sastry) writes:
>Why doesn't PHIGS in X environment work for a monochrome machine?
>The prog. works fine with a colour machine.
>Is there a way to make PHIGS recognise it shouldn't try to get non-existent
>colourmaps?

Consider a program that makes a drawing in two colours.  Colour index zero
is white and colour index 2 is black.  This could be displayed on a monochrome
screen.  Even if the colours were not black and white they could be mapped
onto black and white so the drawing could still be displayed on a monochrome
screen.

The catch is that this program could call SET COLOUR REPRESENTATION
(pset_colr_rep()) to set colour index 2 to white.  This changes the contents
of the workstation colour table and the effects should be visible on the
currently displayed PHIGS image.  If you are using PEX and displaying to
a screen with a writable colourmap the obvious implementation is to change the
colormap entry corresponding to PHIGS colour index 2.  If the display has
a read-only colormap (as is the case with most, if not all, monochrome
X displays) this is not possible.  The only way the colour representation change
could be effected is to regenerate the image on the screen with all of the
black pixels changed to white.  This is not particularly efficient and in order
to cope with the general case where arbitrary colours may be given to SET
COLOUR REPRESENTATION would require some rather complicated code in the PEX server.

In summary: PHIGS is defined in such a way that it is impractical to implement
a PHIGS workstation on most monochrome X displays.

	Chris Flatters
	cflatter@nrao.edu
From: jxv3790@hertz.njit.edu (Jake Vogelaar)
Newsgroups: comp.windows.x
Subject: X11R4 with Trident cards ??
Date: 5 Oct 92 20:47:49 GMT
Followup-To: jxv3790@hertz.njit.edu
Distribution: usa
Organization: New Jersey Institute of Technology, Newark, N.J.


	I have looked in the faq and the X386 modes database for any 
information on installing X11 revision 4 with a Trident 8900C card.
I just have the binaries for SCO Xenix 2.3.3 (from unix.secs.oakland.edu)
and installed them.  Is there any support built in support for the Trident 
card?  Otherwise is there any way to build in support (I don't have to buy
another SVGA card do I?)
I've been trying to get X runing for a while now so I would really appreciate
if someone could point out how to configure/build X for my hardware.


Thanks 

Jake Vogelaar
jxv3790@hertz.njit.edu
From: pullin@mail.physics.utah.edu (Jorge Pullin)
Newsgroups: comp.windows.x
Subject: Trackertool for X?
Date: 2 Oct 92 15:18:33 GMT
Article-I.D.: fcom.1992Oct2.151833.28519
Reply-To: pullin@mail.physics.utah.edu
Organization: University of Utah, Department of Physics

Hello

I want to know if there is available any small code that would make a 
graphical sketch in an X window of x,y points while they are being 
generated. There is a routine called trackertool that does this, but
only seems to work on Sunview.

Please  reply by email, I can summarize if there is interest.

Regards.
Jorge
-----------------------------------------------------------------------------
|Jorge Pullin, Department of Physics |  pullin@mail.physics.utah.edu        |
|201 JFB,  University of Utah        |  pullin@utahcca.bitnet               |
|Salt Lake City, UT 84112 USA        |  Tel:(801)581-5395 Fax:(801)581-4801 |
-----------------------------------------------------------------------------
Newsgroups: comp.windows.x
From: mahan@TGV.COM (Patrick L. Mahan)
Subject: RE: Problems compileing Xt programs on DECstation 3100!
Organization: The Internet
Date: Wed, 30 Sep 1992 16:03:17 GMT

#
#I am practicing Xt with Athena widgets with the examples from 
#mit/examples/Xaw of X11R4. They worked fine on SUN SPARCstation, but not on 
#the DECstation 3100 running Ultrix 4.2.
#
#When compiling the xhw.c file on the DECstation, the following warning came out:
#
#	ccom: Warning: xhw.c, line 61: illegal combination of pointer and 
#	integer, op = fallback_resources, 0, ((Cardinal)0));
#
#which was related to the XtappInitialize.
#

What is the actual code?

#
#When Compiling the popup.c file, the following errors came out:
#
#
#	ccom: Error: popup.c, line 106: syntax error
#      	XtPointer client_data, call_data;
#     	 --------^
#	ccom: Error: popup.c, line 145: XtPointer undefined
#          XawDialogAddButton(dialog, "ok", ColorTheButton, (XtPointer) dialog);
#      	 ------------------------------------------------------------^
#	ccom: Error: popup.c, line 145: syntax error
#          XawDialogAddButton(dialog, "ok", ColorTheButton, (XtPointer) dialog);
#      ----------------------------------------------------------------------^
#
#	.
#	.
#	.
#
#which are related to XtPointer.
#
#Also the cpp was redefining a lot of Xt stuff during the compilation. 
#
#I learn that Digital distributes a different Xt (Maybe also Xlib) from MIT X's.
#How can I resolve this problem? I do like to write some code based on the
#examples from mit/examples/Xaw, unless some clear document is available for the 
#changes in Digital's Xt.
#
#
#Any suggestions and comments from experienced Xt and DECstation users is 
#appreciated!
#

I believe the current version of X that resides with 4.2 doesn't contain
the typedef for XtPointer.  Check the file /usr/include/Intrinsic.h for
the following line:

	#define	XtSpecificationRelease 4

If that is missing (and I suspect it is) you are using X11R3 base software
which doesn't have it defined.
From: meo@austin.ibm.com (Miles O'Neal)
Newsgroups: comp.windows.x
Subject: Re: Can't get XROOMS to compile
Date: 1 Oct 92 21:49:37 GMT
Reply-To: meo@austin.ibm.com (Miles O'Neal)
Organization: IBM AWD

mdm@hadrosaur.cis.ohio-state.edu (Michael Moore) writes:
| drp40@cd.amdahl.com writes:
| >I get the following in the final make-stage of xrooms:
| >
| >ld: Undefined symbol 
| >   __XPrintDefaultError 
| >   _alloca
| >*** Error code 2
| >make: Fatal error: Command failed for target `xrooms'
| 
| 	I had the same problem.  I had to go into the source and remove
| the XPrintDefaultError call and change alloca to malloc, then recompile.
| I have now been using it for about 2 weeks, and have had no discernable 
| problems.

_XPrintDefaultError I think is a DecWindows function - I've had
to #ifdef it out on all 3 systems (non-DEC) on which I've built
xrooms.

-- 
Miles O'Neal                      Internet: meo@austin.ibm.com