RE: [gtk-list] Re: Line Drawing



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




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]