in reply to First column acting wierd! (MatchEntryMListbox) (Tk)
First, when you distribute custom modules for testing, you should keep them in the working directory for easy cleanup and prevention of garbage collecting in PERL5LIB. So you could have just created a directory in your script directory, called Tk, put your custom module in it, and put " use lib '.' " in your test script.
Having done that, when I run your test script, I get
When I set an inital value to $full_path, like "my $full_path=0", it starts up and the first column, is very small."$full_path" requires explicit package name......
Now that brings us to what is probably causing it. I'm just guessing here, but you are probably getting the default width for MListbox, not what you are passing in as the population hash. Why? Read "perldoc Tk::Derived" and pay close attention to the Populate sub
It seems to me that your -width arg is getting lost somewhere in the way you populate your custom widget. Try Tk::Derivedsub Populate { my( $self, $args ) = @_; my $flag = delete $args->{-flag}; if( defined $flag ) { # handle -flag => xxx which can only be done at create # time the delete above ensures that new() does not try # and do $self->configure( -flag => xxx ); } ...... .......
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: First column acting wierd! (MatchEntryMListbox) (Tk)
by Ace128 (Hermit) on Sep 18, 2005 at 14:39 UTC | |
by zentara (Cardinal) on Sep 19, 2005 at 10:20 UTC | |
by Ace128 (Hermit) on Sep 19, 2005 at 14:04 UTC |