cry uncle :)
- From: "Billy N. Patton" <bpatton dal asp ti com>
- To: Gtk users <gtk-list gnome org>
- Subject: cry uncle :)
- Date: Sat, 23 Dec 2000 06:37:59 -0600 (CST)
I ask about drawing to a drawing area yesterday and got 2 responses that
stated to change the color of a gc and pass it into the draw_rectangle
function.
I give I'm unable to do this :( I spent 3 hours in the documentation
and the examples provided with tkg and cannot get anything to show up.
My target platform is a SUN, I'm developing on winders at home (its
avoids executing across my ISDN line)
Heres a snippett of my code :
#include "extern.h"
/* recursive because of my data structure */
/* after calling this function I emit signal expose_event */
void draw_cell(cell_p cell /* cell_p */
,int view /* view */
,int trans_x /* translate x */
,int trans_y /* translate y */
)
{
node_p np,detail,strct;
point_t pts[50000];
int npts;
GdkColor white = {0,0,0,0};
GdkColor black = {0,0xFFFF,0xFFFF,0xFFFF};
GdkGC *gc = NULL;
if (cell EQ NULL) return;
if (gc EQ NULL) gc = gdk_gc_new(pixmap);
fprintf(stderr,"Enter draw_cell\n");
detail = NodeFind(cell->head,lDETAIL);
strct = NodeFind(cell->head,lSTRUCT);
np = LaffNodeNext(detail,detail);
while (np)
{
switch (np->type)
{
case lRECT:
{
rect_p r = (rect_p) np->data;
pts[0].x = r->ll.x;
pts[0].y = r->ll.y;
pts[1].x = r->ur.x;
pts[1].y = r->ur.y;
/* converts database coords to grachic coords applying scale and
shiftx and shifty */
Wc2Gc(db,pts,cell,canvas_y,scale,shiftX,shiftY);
Wc2Gc(db,&pts[1],cell,canvas_y,scale,shiftX,shiftY);
gdk_gc_set_foreground(gc,&white);
gdk_draw_rectangle (pixmap
,gc
,FALSE
,pts[0].x
,pts[0].y
,ABS(pts[0].x - pts[1].x)
,ABS(pts[1].y - pts[1].y));
fprintf(stderr,"Enter draw_cell : lRECT\n");
break;
}
}
np = LaffNodeNext(np,detail);
}
fprintf(stderr,"Leave draw_cell\n");
}
Also how do I set the drawing mode for the DC
XOR, OR ...
=========+=========+=========+=========+=========+=========+=========+
___ _ ____ ___ __ __
/ _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
/ _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
/___/
Texas Instruments ASIC Circuit Design Methology Group
Dallas, Texas
214-480-4455
bpatton dal asp ti com
=========+=========+=========+=========+=========+=========+=========+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]