Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Tk and scrollbars

by SciDude (Friar)
on Jul 09, 2004 at 03:56 UTC ( #373033=note: print w/replies, xml ) Need Help??


in reply to Tk and scrollbars

Did you want the single quotes around '-wrap' and '-width' ?

Also, your "very long line" had line breaks in my downloaded version. Here are my modest hacks to activate the horizontal scroll bar:

#!/usr/bin/perl use strict; use Tk; my ($mainwindow, $menubar, $display, $text); my $counter = 0; $mainwindow = new MainWindow; $mainwindow->geometry("800x400"); $display = $mainwindow->Scrolled('Text', -relief=>'sunken', -borderwidth=>'2', -height=>'24', -scrollbars=>'se', '-width' => 40, -wrap=>'none'); $display->pack(-expand=>'1', -fill=>'both'); $text = $display->Subwidget('text', -scrollbars=>'se', -wrap=>'none') +; # need this because you can't tie to $display - main widg +et tie *STDOUT, ref $text, $text; create_gui_main(); $text->repeat( 1000, sub { goto \&mymain; }, ); MainLoop; sub mymain() { # This would normally be real text $counter++; print "this is a very long line we need a scrollbar on the x axis... +..... this is a very long line we need a scrollbar on the x axis..... +... this is a very long line we need a scrollbar on the x axis....... +. well the number is current = " . $counter . " \n"; } # ------------------------ # sub quitapp() { exit; } # ------------------------ # sub create_gui_main { my $menuitems = [ [Cascade => "~File", -menuitems => [ [Button => "~Quit", -command => \&quitapp], ] ], ]; if ($Tk::VERSION >= 800) { $menubar = $mainwindow->Menu(-menuitems => $menuitems); $mainwindow->configure(-menu => $menubar); } else { $mainwindow->Menubutton(-text => "Pseudo menubar", -menuitems => $menuitems)->pack; } } __END__

SciDude
The first dog barks... all other dogs bark at the first dog.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://373033]
help
Chatterbox?
[Corion]: I usually expect fixed header names, but am sometimes lenient in the order of columns. But changing the report titles often sounds to me as if you are not the sole consument of the export ;)
[shmem]: perldigious: as always - if it ain't broke, don't fix it. Ther must be a very compelling reason for changing column names in a database. Those are rare.
[Corion]: If you have whitespace in the column names in the database, whap the DBAs ;)
[shmem]: It's common for some vendors to have column names such as WRSTVG or some other such whizzbang, and another table where these names are mapped to something meaningful depending on how you look at the data
[shmem]: afair in SAP that occurs all the time

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2017-05-25 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?