Re: [gtk-list] Line Drawing
- From: Havoc Pennington <rhpennin midway uchicago edu>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Line Drawing
- Date: Wed, 28 Oct 1998 14:11:10 -0600 (CST)
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]