in reply to First column acting wierd! (MatchEntryMListbox) (Tk)

If all started up, you will see that first column is very small!

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

"$full_path" requires explicit package name......
When I set an inital value to $full_path, like "my $full_path=0", it starts up and the first column, is very small.

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

sub 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 ); } ...... .......
It seems to me that your -width arg is getting lost somewhere in the way you populate your custom widget. Try Tk::Derived

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: First column acting wierd! (MatchEntryMListbox) (Tk)
by Ace128 (Hermit) on Sep 18, 2005 at 14:39 UTC
    Hey,

    "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."

    Ok, gonna do that next time then. Thanks.


    "Having done that, when I run your test script, I get "$full_path" requires explicit package name...... "

    Ok, crap. I fixed that problem on the zip, but I guess you got it before I did that... Sorry about that. Those things bugs me, when you get some test example, and the example isnt even working! (well, atleast this kind of error is annoying).

    And about the problem. Well, Im not sure what I'm supposed to do with the Tk::Derived...
    Also, I dont understand how the width is in the mlistbox widget (according to Data::Dumper), but still seems to have no affect. And, since the other width's works fine (doing the  columnInsert('end', -width => $width, -text => $text);) I mean, since the others work, it doesnt seem to be lost... if not somehow _just the first_ is poped out or deleted somehow and size is set to 1 (or something like that). But it all seems like contradictions... gonna do some more testings here, when Im calm down... :)
      Tk::Derived is a module to help you correctly make custom widgets, which inherit problem-free from parent widgets.

      I may have been "guessing" at the root-source of the problem, and like pg suggested, I got your window to display properly by setting the scrollbar to 's' in the module. 'oe' didn't work for me.


      I'm not really a human, but I play one on earth. flash japh
        Oh, yea... Anything with 's' in made it work... Would be nice having some indepth explaination on why and why the others didn't work... Thanks! :)