[9620] 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 (Stephen Molitor)
Wed Oct 28 16:08:15 1998

From: smolitor@insight-tech.com (Stephen Molitor)
To: <gtk-list@redhat.com>
Date: Wed, 28 Oct 1998 14:56:47 -0600
In-reply-to: <Pine.GSO.3.95.981028140707.27365J-100000@harper.uchicago.edu>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

Check the chapter 25.3 of the tutorial, titled "The DrawingAreaWidget, and
Drawing."

-----Original Message-----
From: rhpennin@midway.uchicago.edu [mailto:rhpennin@midway.uchicago.edu]
Sent: Wednesday, October 28, 1998 2:11 PM
To: gtk-list@redhat.com
Subject: [gtk-list] Re: Line Drawing



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


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


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