originally I was woried that my solution would have maintainability problems as it wouldnt be able to be refactored into guibuilder objects. However I find a way to do it, basically it's creating a new frame class which inherits from frame%, and were calling the new class frame%. This could then be refactored into callback registration methods, and a new module "
mred-plus-right-mouse-clicks.ss" which would provide the mred language, with mred:frame% repaced with our new frame%.<br><br>(define (test)<br> (let* ((object-registry #f)<br> (frame%<br> (class frame%<br>
(override on-subwindow-event)<br> (define on-subwindow-event <br> (lambda (reciever event)<br> (if (equal? 'right-down (send event get-event-type))<br> (begin <br> (display #\newline)
<br> (display "you clicked the right button on ")<br> (display reciever)<br> (if (equal? (first (first object-registry)) reciever)<br> (display "AND IT'S BUTTON393!!!"))
<br> ;if we don't actually do anything, pass this on....<br> ;(super on-subwindow-event reciever event)<br> )<br> (super on-subwindow-event reciever event))))<br>
(super-new))))<br> <br><br>{{gui goes here}}<br><br> (set! object-registry (list (list button393 `do-something)))<br> (send top show #t)))<br clear="all"><br><br><br>Corey<br><br>-- <br>((lambda (y) (y y)) (lambda (y) (y y)))