[comp.windows.open-look] Problem with FRAME_FOREGROUND_COLOR Attribute

leue@galen.crd.ge.com (Bill Leue) (05/21/91)

Does anone understand why the following technique doesn't work?  I'm 
trying to get an independent second window opened by my program 
to inherit the foreground and background colors from the main window 
under OW 2.0.  Here's a skeleton of the technique:

When I create the second window, I do the following:

#include <xview/xview.h>
#include <xview/panel.h>
#include <xview/openmenu.h>
#include <xview/notice.h>
#include <xview/cms.h>

extern Frame frame;		/* is the main window frame handle */

static Frame tdframe;		/* is the 2nd window frame handle */
Xv_singlecolor *dbg_fgnd, *dbg_bkgnd;


/* get the fgnd & bkgnd colors from the main window */
dbg_fgnd = (Xv_singlecolor *)xv_get(frame, FRAME_FOREGROUND_COLOR);
dbg_bkgnd = (Xv_singlecolor *)xv_get(frame, FRAME_BACKGROUND_COLOR);

/* create the 2nd window frame */
/* force its fgnd & bkgnd colors to match the main */
tdframe = xv_create(NULL, FRAME,
		    XV_WIDTH,TDWINWID,
		    XV_HEIGHT,TDWINHGT,
		    FRAME_FOREGROUND_COLOR, dbg_fgnd,
		    FRAME_BACKGROUND_COLOR, dbg_bkgnd,
		    0);

If I omit the two attributes FRAME_FOREGROUND_COLOR and FRAME_BACKGROUND_COLOR,
the 2nd window opens up ok, albeit not with the colors I want.  If I
include these attributes as shown, the xv_create() call hangs up and
never returns.

Any clues?

Thanks!
-Bill Leue
leue@crd.ge.com