[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Mar 29 08:14:12 2000 
Subject:Re: Mouse Button Handling in Pop11 
From:davidy 
Volume-ID:1000329.02 

On Wed, 29 Mar 2000, Nick Arkell wrote:

> ... I cannot handle the mouse_button events:
> 
> Unfortunatly, when I try to display the mouse buttton state I get
> <external ptr> printed instead and in the terminal window I get:
> ;;; WARNING - ITEMS LEFT ON THE STACK AFTER CALLBACK BEING IGNORED
> ;;; INVOLVING 0 <procedure do_button_actions>

The first problem is probably because you need to convert the button
information from an external pointer to a Pop-11 integer with

      exacc ^int button -> button

inside the callback procedure. I've never really understood why this
part of the interface to X is so incredibly unhelpful, but it is.
Everyone I know who has tried to program X things in Poplog has spent a
lot of time in frustrated poring over the REF files.

The second problem is because somehow your callback procedure
on_mouseclick is leaving a 0 and a procedure on the stack when it exits.
I can't say why without seeing the code, but it looks a bit as if
do_button_actions is not being called when it ought to be - check the
syntax of the call to do_button_actions. For example if you had

	0,do_button_actions
	
instead of

	0.do_button_actions

that would produce the warning, but there are many other possibilities.

David Young