ff has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use Tk; my $window_title = 'window title'; my $overview_message = "A message that is fairly long for this window\n"; my $mw = MainWindow->new; $mw->title( $window_title ); my $fA = $mw->Frame->pack(-side => 'bottom', ); $fA->Button( -text => 'Exit', -command => sub { exit; }, )->pack( -fill => 'both', -side => 'left', -anchor => 'w', ); my $fB = $mw->Frame->pack(-side => 'top'); my $user_font_choice = 'arial 10 bold'; my @listbox_items = split /\n/, $overview_message; my $listbox = $fB->Scrolled( "Listbox", -scrollbars => 'onoe', # 'onoe': optional north, east -font => $user_font_choice, -selectmode => 'single', -height => scalar @listbox_items, -width => 0, )->pack( -side => 'top', -fill => 'both', -expand => 1 ); $listbox->insert( 'end', @listbox_items ); MainLoop();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Get a Tk Button to align left in a frame
by shmem (Chancellor) on May 06, 2007 at 22:00 UTC | |
|
Re: Get a Tk Button to align left in a frame
by ff (Hermit) on May 06, 2007 at 23:21 UTC | |
by shmem (Chancellor) on May 07, 2007 at 06:53 UTC |