[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

No Subject

I'm working on a little programming exercise with my kids - tic tac toe -
to learn more about MacPerl.  We've worked out the logic pretty well and
are now moving on to developing a graphical interface of sorts.

We want to put up a window with a tic tac toe grid and then let the human
player click on the spot where he/she wants to move.  We've figured out how
to draw the window and grid, by looking at the MacPerl Power and Ease Book
and Inside Macintosh (very briefly).  We're stuck now because we can't
figure out how to make the program respond to the human player's mouse
click on the appropriate spot.

We think that what we need is a subroutine that is hooked onto the window
and called when a mouse event is detected.  The subroutine would put an "x"
or "o" in the spot where the mouse was clicked.  We think it would look
something like this:

	$win->sethook('mouseUp' => \&handlemouseroutine);

Unfortunately, this didn't work.  Anyone have any ideas?  More generally,
anyone know of a source of examples on using the Mac GUI interface in


Darryl Tang


Yoshi's Franchise Corporation
of America, Inc.


===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org