Re: Catching Mouse Clicks



On Wed, Oct 09, 2002 at 02:10:36PM +0300, Koray Berk wrote:

I need a very simple jump start.
An application that draws a line between two points input by the user
via mouse clicks.  Or functions or widgets that will enable me to do
that.
I read the GTK FAQ, and started reading the tutorial and did some
skimming.  I couldnt really understand how to catch mouse clicks with
its coordinates.
However, for starters, can anybody help me with this code?

Go through the whole of the tutorial, you'll find a sample drawing pad
called scribble.
It uses, for instance, a callback like

static gint button_press_event( GtkWidget      *widget,
                                GdkEventButton *event )
{
  if (event->button == 1 && pixmap != NULL)
    draw_brush (widget, event->x, event->y);

  return TRUE;
}


 
Does anyone have a better advice for me than using GTK for developing
interactive graphical C applications on LINUX.
 

SDL is a library used for games, so it'll be interactive.  But not
necessarily better than GTK.

Drew

-- 
PGP public key available at http://people.debian.org/~dparsons/drewskey.txt
Fingerprint: A110 EAE1 D7D2 8076 5FE0  EC0A B6CE 7041 6412 4E4A

Attachment: pgpfB2jr2Qvd3.pgp
Description: PGP signature



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