$list->g_bind("", [sub { my($x,$y) = @_; my @sel_list = $list->curselection(); my $on_target = 0; my $current_index = $list->nearest($y); print "y = " . $y . "current_index = " . $current_index . "\n"; # test if (length($sel_list[0]) > 0) { my @sel_list_items = split(/ /,$sel_list[0]); if (scalar(@sel_list_items) > 1) { foreach my $sel_list_item (@sel_list_items) { print "sel_list_item = " . $sel_list_item . "\n"; # test if ($sel_list_item eq $current_index) { $on_target = 1; } } } } print "on_target = " . $on_target . "\n"; # test if ($on_target == 1) { $listmenu->g_tk___popup($x,$y) } }, Tkx::Ev("%X", "%Y")]);