Znate nekdo Tk? Proc je Menubutton->cget('width') == 0 ? (long)

Jindra Vavruska jindra na vavruska.cz
Pátek Březen 19 19:00:56 MET 1999


Zdravicko, perlisti!

Zkousim psat nejake programky s Tk, ale neco nefunguje nebo jsem si spatne
precetl manual.

Nasledujici program vzdycky vypise

---> Menubar width ('width')  = 0
---> Menubar width ('-width') = 0              

---- (toto je jen zkraceny priklad) ---

use Tk;
    
    $TOP = MainWindow-> new( -title => 'Celestyna' );
    
    $menubar = $TOP->Frame;
    $menubar-> pack( qw/-side top -fill x/ );


    $help_menu = $menubar->Menubutton( @TEXT_FONT,
        qw/-text Nápověda -underline 0 -menuitems/
        => [
            [ 'Button' => 'Rejstřík', -command  => \&action , @MENU_FONT ],
            [ 'Separator' => '' ],
            [ 'Button' => 'Informace o Celestýně', -command => \&action , @MENU_FONT  ]
        ]
    )->form ( -right => [ '%100' , 0 ] );
    
sub action {

    print STDERR "---> Menubar width ('width')  = ".$menubar->cget("width")."\n";
    print STDERR "---> Menubar width ('-width') = ".$menubar->cget("-width")."\n";

}

$TOP->MainLoop ;
   
__END__

Totez se stane pri pokusu zjistit 'width' pro nektery z objektu Menubutton.
Nula.

--
Jindra Vavruska (OK1FOU)
Linux is good for me


Další informace o konferenci Perl