[9619] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: Line Drawing

daemon@ATHENA.MIT.EDU (Havoc Pennington)
Wed Oct 28 15:41:23 1998

Date: Wed, 28 Oct 1998 14:11:10 -0600 (CST)
From: Havoc Pennington <rhpennin@midway.uchicago.edu>
To: gtk-list@redhat.com
In-Reply-To: <Pine.LNX.3.93.981028132558.7851B-100000@chem4823.usask.ca>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com


On Wed, 28 Oct 1998, Keith Brown wrote:
> 
>    I'd like to develop an application for drawing simple molecular
> structures but I'm stuck at the starting gate. How does one draw a
> straight line, erase a drawn line, change the colour of the line and
> change the colour of the background? Admittedly, I haven't read the
> tutorial cover to cover but there doesn't seem to be anything about these
> questions there. Any help is much appreciated.
> 

GnomeCanvas is the easy way, but then you have to use Gnome.

Harder, but still easy, is to use the gtk--draw convenience interface that
comes with gtk--, but then you have to use C++.

The hard, but not all that hard, way: use a drawing area; look at the
scribble example in the tutorial; basically you use the gdk_draw
functions, plus you have to do color allocation, expose/configure event
handling, and gc stuff.  The best way to learn Gdk is to read about Xlib,
either the man pages or a book.  There is pretty much a one-to-one
correspondence between Xlib functions and Gdk equivalents.

Havoc


-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post