in reply to Re^3: Perl::Tk and cursor in Menubutton
in thread Perl::Tk and cursor in Menubutton

You can speak in Russian?
<OffTopic>
Я знаю русский тоже...
Можешь попробовать поговорить и на русском...)))
</OffTopic>
I thinking about one method...
In code I have for example $mw=TK::MainWindow->new; or $help=$menubar->Menubutton(...
may be I can find objects method getting address of menubutton pointer variable and change -cursor parameter directly?
I probe use Data::Dumper to find some information about variables but I can't get positive result.
  • Comment on Re^4: Perl::Tk and cursor in Menubutton

Replies are listed 'Best First'.
Re^5: Perl::Tk and cursor in Menubutton
by kcott (Archbishop) on Oct 21, 2010 at 15:10 UTC
    You can speak in Russian?

    No, none at all. You'll need to translate the part in Cyrillic for me.

    And, just in case there was any confusion, my "Your English is a lot better than my Russian. :-)" was intended as a good-humoured comment (hence the smiley). I hope it wasn't taken the wrong way.

    I thinking about one method...

    I also wanted to do something like that for other options. Here's my code (which appears immediately after the $mb->configure(-cursor => q{}); line):

    my $file_menu = $mb->Cascade( -label => q{~File}, -tearoff => 0, -menuitems => [ [Separator => q{}], [Button => q{Exit}, -command => sub { exit }] ], ); $file_menu->cget(q{-menu})->configure( -borderwidth => 1, -activeborderwidth => 1, );

    Working out how to do that took me a fair amount of investigation too. The method I used is still commented out in my script, so I'll post it here. It may provide some insights.

    #say qq{\$file_menu: $file_menu}; #my @file_opts = $file_menu->configure(); #foreach my $opt (@file_opts) { # map { $_ //= q{undef} } @$opt; # say join qq{\t}, @$opt; #} #say qq{@{[$file_menu->cget(q{-menu})]}}; #my %file_menu_menu = %{$file_menu->cget(q{-menu})}; #foreach my $key (keys %file_menu_menu) { # say join q{ : }, $key, $file_menu_menu{$key}; #}

    Finally, there's a newer (and, by all accounts, preferred) method of creating menu bars using the -menuitems option. I find it easier than the old method and have used it above. Examples of both methods are shown in the widget demo: under the Menus heading, compare item 1 (old method) with item 2 (new method).

    -- Ken

      In Russian I say next:
      I can speak in Russian too.
      If You can may speak with me in Rusian too...
      )))

      I probe you remarked code. But can't change cursor in new menu.
      I can change border, relief, but cursor - not...(((
      But this method is more better...

        Thanks for the translation. :-)

        I only used $file_menu->cget(q{-menu})->configure(...) for the borderwidth options shown: it didn't help with the cursor issue.

        -- Ken