in reply to [Tkx] Scrolled frame problem

$loglbl->configure(-scrollcommand => [$s, 'set']);
Do you want to scroll the label ($loglbl) or the frame ($logfrm)?

(Hint: -scrollcommand is not a valid option for labels; it is for frames.)

BTW, nice first post - you obviously took the time to learn some Monastery HTML coding for a readable post. You also stated the problem fairly succinctly with example code and the error received. ++

Replies are listed 'Best First'.
Re^2: [Tkx] Scrolled frame problem
by sebapabst (Acolyte) on Feb 16, 2010 at 21:03 UTC

    I'm not sure. It's the first time I create a GUI. Anyway, my frame ($logfrm) has a fixed dimension and a border. The content of the label ($loglbl) increases when the program runs. The label grows too much, but I want to keep the frame's initial dimensions. So I would like to be able to "navigate" the content of the $loglbl.

    I suppose I should scroll the label($loglbl)?

    P.S.: Thanks for your comment. It's true; I took a look to the "Monastry HTML". And I apologize for my english level...I sudied it only a couple of years, but I find it much harder then the Perl language! :D

      Think of it like this:
      • the frame has fixed dimension
      • the label content is more than can been seen in the fixed frame
      • therefore the label is bigger than the frame
      • therefore the frame needs to scroll to show all the label

        I changed it this way :

        my $pageValidation = $fenetre3->new_ttk__frame(-padding => "20 30 5 5" +); $pageValidation->g_grid(-column => 0, -row => 0, -sticky => "news"); $pageValidation->configure(-height => 300, -width => 300); my $logcontent; my $logfrm = $pageValidation->new_ttk__frame(-padding => "5 5 5 5"); $logfrm->g_grid(-column => 1, -row => 1, -sticky => "news"); $logfrm->configure(-borderwidth => 2, -relief => "sunken", -height => +300, -width => 605); $logfrm->g_grid_propagate(0); my $loglbl = $logfrm->new_ttk__label(-textvariable => \$logcontent, -w +raplength=>590); $loglbl->g_grid( -column => 0, -row => 0, -sticky => "new",-padx=>0, - +pady=>0, ); $loglbl->configure(-width=>98,); my $s = $pageValidation->new_ttk__scrollbar(-orient => 'vertical', -co +mmand => [$logfrm, 'yview']); $logfrm->configure(-yscrollcommand => [$s, 'set']); my $boutConfirmation = $pageValidation->new_ttk__button( -text => "La +ncer Conversion", -command => sub {lancerApplication(\$logcontent,\%g +eneraloptions)}); $boutConfirmation->g_grid( -column => 1, -row => 3, -sticky => "sw", - +pady => 7); sub lancerApplication{ my %generaloptions = %{$_[1]}; my $optionsfile='generalOptions.txt'; my $paramsfile='parametersForTEICorpus.txt'; my $refgeneraloptions= \%generaloptions; if ($generaloptions{'externaloptions'}){ $optionsfile=$generaloptions{'filename'}; } else{ ecrireoptgen ($_[1]); } &ma_fonction::main($optionsfile,$paramsfile,\$_[0]); }

        I have got no more the precedent error. The program opens correctly, but I still can't see the scrollbar.

        Any suggestion? BTW, thanks for your answers!