Menu

#1903 Toplevel menus return incorrect active index

obsolete: 8.5a3
open
5
2005-04-29
2005-04-29
WildCard
No

Tk: v8.5a3 HEAD, v8.4.9 HEAD
OS: WinXPsp2, Debian Linux-woody-testing

When the attached script is run some unusual
behaviour is observable.

First on Windows with 8.5 & 8.4
Mouse over the menus without opening them - no output
Now open the 'help' menu, active index is correct (if
zero based like cascade menus) but returned label
says you are in the 'edit' menu.
Moving to the 'edit' menu will produce similar
results.
Moving to the 'file' menu will cause a crash.
Also noticable is that the binding is called twice.

Moving onto Linux and 8.5 and 8.4
Everything works as expected.
Mousing over menu without opening them triggers
binding.
Labels are returned correctly.
Indices are returned and are one based unlike cascade
menus which are zero based.
Binding is also called twice.

Discussion

  • WildCard

    WildCard - 2005-04-29

    Script to test menus

     
  • WildCard

    WildCard - 2005-05-01

    Logged In: YES
    user_id=596509

    Looks like tk expects a zero based response, but zero
    refers to the tearoff menu entry, whether its shown or not.
    The windows menubar doesn't have a hidden tearoff entry
    and therefore returns 0 instead of 1 for the file menu in
    the example.
    Patch bumps the index number up by one if it is a menubar.
    Patch for Tk8.4 also includes the fix in Tk8.5 for index
    being greater than number of entries, as I use the
    variable it creates.

     
  • WildCard

    WildCard - 2005-05-01

    Patch for Tk v8.4

     
  • WildCard

    WildCard - 2005-05-01

    Patch for Tk v8.5

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.