[Gtk-sharp-list] gereral question gtk# drawing rectangles

Dan Winship danw@novell.com
Mon, 29 Nov 2004 09:55:10 -0500


On Mon, 2004-11-29 at 12:53 +0100, muell_muell_@gmx.net wrote:
> hi,
> 
> i try do write a programm that runs under linux and windows. i'm 
> developing under windows with sharpdevelop and c#. therefore i installed 
> gtk# for windows. my program should draw a few rectangels and stuff like 
> that. therefore i'm "using Gtk;" and this offers me something called 
> "DrawingArea". i have this add to my window, but this drawingarea doen't 
> support any funktions like drawRectangle!? how can i draw some 
> rectangles with drawingarea?
> 
> my second solution (but i think its netter to use Gtk) is to use Gdk. if 
> i make an instant of Gdk.Window this instant has functions like 
> drawRectangle...

Most widgets have a Gdk.Window associated with them, via the GdkWindow
property. So create a Gtk.Window, put a Gtk.DrawingArea in it, and then
draw on the DrawingArea's GdkWindow.

-- Dan