Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

menubutton menu not reacting to mouse?

22 views
Skip to first unread message

Juge

unread,
Jul 2, 2015, 4:22:53 AM7/2/15
to
I am using a menubutton and a popup menu. It works fine on Windows, but in Linux my menu do not focus somehow. I can select the item with cursor keys and it works but mouse do not highlight or react in any ways? What can I do?

Andreas Leitgeb

unread,
Jul 2, 2015, 7:11:50 AM7/2/15
to
I'd suggest showing a small sample script that shows the symptoms on
your machine, and also tell us the desktop you're using on Linux (like
Gnome, KDE, Unity(Ubuntu),...)

Harald Oehlmann

unread,
Jul 2, 2015, 7:40:00 AM7/2/15
to
Just an idea:

When I remember right, the bindings are different.
On Unix, it might be necessary that you press and hold the button and you release it over the item you want to select.

-Harald

Juge

unread,
Jul 3, 2015, 1:39:45 AM7/3/15
to
Well ... no - never mind what I do, keep the button pressed and go to item or press once - invoke the menu and then select with second button no go.

Here is a code snippet.

set w ""
wm resizable . 0 0
wm focusmodel . passive

set navi .navi
frame $navi

menubutton $navi.fav -text "Test" -menu $navi.favourites -height 1 -width 10 -relief raised
menu $navi.favourites -tearoff 0 -takefocus 0
$navi.favourites add command -label "Test" \
-underline 1 -command {puts "Test"}
$navi.favourites add command -label "Test_2" \
-underline 1 -command {puts "Test_2"}
$navi.favourites add command -label "Test_3" \
-underline 1 -command {puts "Test_3"}

pack $navi.fav -side left -padx 5 -pady 5
pack $navi

Works fine when I open the menu with button, but for selection I need cursors and enter - mouse is not getting any reaction.

I use RH 5

Schelte Bron

unread,
Jul 3, 2015, 7:35:04 AM7/3/15
to
Juge wrote:
> menubutton $navi.fav -text "Test" -menu $navi.favourites \
> -height 1 -width 10 -relief raised
> menu $navi.favourites -tearoff 0

Check the menubutton manual page. It specifies: "The menu must be a
child of the menubutton." You violated that requirement.


Schelte.

Juge

unread,
Jul 3, 2015, 8:15:50 AM7/3/15
to
Indeed that was the culprit. Thanks for pointing it out - lucky I copied it almost one on one from my program. Apparently Windows is more relaxed about them semantics ...
0 new messages