[lazarus] TCanvas

Shane Miller SMiller1 at stvgb.org
Tue Jul 20 10:42:40 EDT 1999


Looking at it I thought this would work:

Create a pixmap and draw on it.  The pixmap I then store using 

gtk_object_set_data(pgktobject(widget),'Pixmap',pixmap);

Here's the basic code.

widget : pgtkwidget;
pixmap : pgdkPixMap;
TheStyle : pgtkstyle;
begin

widget := pgtkwidget(gtkwindow);
pixmap := gtk_object_Get_data(pgktobject(widget),'Pixmap');
gdk_window_clear(widget^.window);
TheStyle := pgtkwidget(widget)^.thestyle;
gdk_draw_rectangle(pixmap,TheStyle^.white_gc,1,1,1,30,30);

gdk_window_set_back_pixmap(widget^.window,pixmap,1);
gtk_object_set_data(pgktobject(widget),'Pixmap',pixmap);
end;

Anyone know why it doesn't seem to do anything?

Shane


>>> "Shane Miller" <SMiller1 at stvgb.org> 07/20 8:17 AM >>>
Anyone have any detail on how I would go about writing to the canvas or drawing area of a gtkwidget without using the drawingarea widget?

I know I can get a gdkwindow from doing 
fWindow := PgdkWindow(pgtkwidget(widget)^.window);
but what do I do with that window?  I can get it's gdkgc but I don't have ANY idea what to do.

Thanks
Shane


_________________________________________________________________
     To unsubscribe: mail lazarus-request at miraclec.com with
                "unsubscribe" as the Subject
    archives at http://www.miraclec.com/list_archives/lazarus






More information about the Lazarus mailing list