[lazarus] TCanvas

Curtis White osiriz at teleport.com
Tue Jul 20 21:18:27 EDT 1999


Shane,

You might take a look at the code in the gtk/examples directory for the program
called scribble-simple.pp. It has a bunch of drawing code in it. It might
provide some insight to what you are trying to do.


Thanks...Curtis

On 20-Jul-99 Shane Miller wrote:
> 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
> 
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>     archives at http://www.miraclec.com/list_archives/lazarus

----------------------------------
Curtis White
Curtis White <osiriz at teleport.com>
http://www.teleport.com/~osiriz/
----------------------------------






More information about the Lazarus mailing list