Re: 3.99.2 bug

From: Andrew Dorrell <dorrell_at_ihf.uts.edu.au>
Date: Wed, 08 Jul 1998 13:44:31 +1000

> Andrew Dorrell <dorrell_at_ihf.uts.edu.au> writes:
>
> > (require "Tk-classes")
> > (pack (make <choice-box>))
> >
> > Press mouse button 1 in the entry box, hit tab then space to activate
> > the menu button then press either the left or right cursor key.
> >
> > Result: CPU goes 100% and the application stops responding.

OK.. have tracked the problem down to the file menu.stk, function
Tk:menu-next-menu. The problem arises in the following (L658-676):

    (when (and continue tk::posted-mb)
      ;; Can't traverse into or out of a cascaded menu. Go to the
next
      ;; or previous menubutton, if that makes sense.
      (let* ((buttons (winfo 'children [winfo 'parent tk::posted-mb]))
             (len (length buttons)))
        (let loop ((i (- count (length (member tk::posted-mb buttons)))))
          (while (< i 0) (set! i (+ i len)))

          (while (>= i len) (set! i (- i len)))

          (let ((mb (list-ref buttons i)))
            (unless (and (string=? [winfo 'class mb] "Menubutton")
                         (not (string=? [tk-get mb :state] "disabled"))
                         (tk-get mb :menu)
                         (not (equal? ((tk-get mb :menu) 'index 'last) "none")))
              (when (eq? mb tk::posted-mb)
                (set! continue #f))))
          (loop (+ i count))))



In particular, loop never exits. The reason is that:
        (and (string=? [winfo 'class mb] "Menubutton")
             (not (string=? [tk-get mb :state] "disabled"))
             (tk-get mb :menu)
             (not (equal? ((tk-get mb :menu) 'index 'last) "none")))
        ==> #t

when it should be #f in the flagged case. I susspect the problem is
that,
under stk-3.99.2, ((tk-get mb :menu) 'index 'last) ==> 0 but I don't
understand enough about what this means to fix the problem...

To make matters worse it is difficult to check on the stk-3.1.1
behaviour as pressing a menubutton does a form of grab --- so I
cant type at the interpreter while the menubutton is selected...

Can anyone else lecd some further insight?
-- 
Mr Andrew Dorrell                                *
Faculty of Engineering             /---\  Whoo?      *
University of Technology, Sydney   (o o) /     *
AUSTRALIA                          ( : )            .
                                    ^ ^
                                                    *
Received on Wed Jul 15 1998 - 06:36:50 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST