delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/06/22/10:02:13

Date: Wed, 22 Jun 1994 15:58:02 +0300 (EET DST)
From: Janne Kukonlehto <jtklehto AT stekt DOT oulu DOT fi>
Subject: Re: grxfont in C++
To: js1 AT chclu DOT chemie DOT uni-konstanz DOT de
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

On Fri, 17 Jun 1994 js1 AT chclu DOT chemie DOT uni-konstanz DOT de wrote:
> I have problems using grxfont in C++ programs. I wrote a C program using
> grxfont which was compiled without problems. When I compile the same program as
> an .cxx file, the compiler says:
> 	incompatible types in assignment
> at the lines where I set the colors of the text with:
> 	fntopt.txo_fgcolor = 6
> 	fntopt.txo_bgcolor = 0
> (fntopt is of type GrTextOption).
> Has anyone similar problems or knows how to solve them ?

Yes, I had this problem a while ago with grx. The way C++ handles unions is a
bit different from plain C. You should use following form (if I remember
it correctly): 

 	fntopt.txo_fgcolor.v = 6
 	fntopt.txo_bgcolor.v = 0

For more information read the grx.h include file.

-- 
Janne Kukonlehto
jtklehto AT phoenix DOT oulu DOT fi   http://phoenix.oulu.fi/~jtklehto/index.html
jtklehto AT stekt DOT oulu DOT fi       http://stekt.oulu.fi/~jtklehto/index.html


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019