Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question for managing menu 1

Status
Not open for further replies.

smugindividual

Programmer
Apr 14, 2003
104
US
I have a menu with three items, we'll call them A, B, and C. Each of these has a cascading menu.(Note that the cascading menu is the same for A, B, and C. Built by the same routine)

Heres my problem: A, B, and C each have a little triangle indicator on the far right to show which menu item is active for the cascade. Each menu item is also greyed when the cursor enters it. I've found a scenario where the user can single click on menu item A(cascade shows up) and then move the cursor to B(cascade never changes). At this point, B is greyed to show it is active yet the triangle indicator shows that A should be the active menu. The result of selecting the item from the cascade reveals that B was the active menu item. So if the user is not careful enough while moving the mouse to the cascade menu, they might accidentally focus on the next menu item.

This is not a problem if the user clicks and holds while navigating through the menu. I have made attempts to use the postcascade command but havent had luck yet, i suspect i may be trying to invoke it at the wrong place.

Any help would be great. I hope i explained it clearly enough.
 
I'm not sure I understand your situation. You have a menu button in the menu bar that contains some cascades. Let's call those "operands". Each operand has a "triangle" (that I think of as an "arrow") indicating that it is a cascading menu. When your cursor dwells over one of the operands, the cascade appears to the side with a list of "operations". The same list of operations applies to each operand. So far have I got it?

If I understand your problem, the user has no indication of which operand he is about to operate on since the list of operations is the same. Is that it? Can you build the list of operations with a null operator at the top that just has the name of the operand?

Bob Rashkin
rrashkin@csc.com
 
"If I understand your problem, the user has no indication of which operand he is about to operate on since the list of operations is the same. Is that it? Can you build the list of operations with a null operator at the top that just has the name of the operand? "

this is part the problem. In my example the arrow indicator would be press for the first item in the main menu list, but when the user would move the cursor over to the newly displayed "list of operands", if the cursor crossed through any of the other main menu items that item would now be "selected". I wish i could post a screen shot here of what i'm talking about. You'd see the main menu with the arrow selected on the first item but the 2nd item would have an altered background color, as if it were the selected item.

The cascade menus for each are exactly the same, built by the same routine to cut down on unnesesary code. I did find that by making each cascade separate all worked fine. But it still doesnt solve my issue with the appearance that multiple menu items were selected and the out come of my operand was for the item that wasnt selected, yet appeared selected.

Also keep in mind, if the user is clicking and holding durring navigation, this is never a problem. Its only when the user clicks once to open the cascade and then moves around with the mouse.

 
I whipped up a scaled down version of the problem i see:

frame .f
pack .f
menubutton .f.m -menu .f.m.menu
.f.m configure -text file
menu .f.m.menu
.f.m.menu add cascade -label "bla" -menu .f.m.menu.bla
.f.m.menu add cascade -label "bla2" -menu .f.m.menu.bla
pack .f.m
menu .f.m.menu.bla

foreach itm [list abba dabba kazzam] {
.f.m.menu.bla add command -label $itm
}



The trouble i'm getting into is comming from the fact that i am sharing the cascade between two menu items. But you should see the instance where two menus are marked as active, just make sure that you use single click to open the cascade.
 
I think you have more serious problems if you want the different cascade commands to perform distinct actions. Why not try this:

frame .f
pack .f
menubutton .f.m -menu .f.m.menu
.f.m configure -text file
menu .f.m.menu
.f.m.menu add cascade -label "bla" -menu .f.m.menu.bla
.f.m.menu add cascade -label "bla2" -menu .f.m.menu.bla2
pack .f.m
foreach blax {bla bla2} {
menu .f.m.menu.$blax
foreach itm [list "this is $blax" abba dabba kazzam] {
.f.m.menu.$blax add command -label $itm
}
}

Then you can attach actions to abba, dabba, and kazzam, but not to "this is bla(2)"



Bob Rashkin
rrashkin@csc.com
 
hehe, this is the solution that we decided on as well. Thanks for the responses.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top