in reply to Tk::ListBox questions

Regarding the first question: you can first insert the items, then disable the list box. That way the items will be displayed:
use strict; use warnings; use Tk; my $w = MainWindow->new(); my $l = $w->Listbox()->pack(); for (qw(foo bar baz)){ $l->insert('end', $_); } # disable it afterwards $l->configure(-state => 'disabled'); MainLoop;

I don't see why $l->configure(-state => 'normal'); or $l->configure(-state => 'disabled'); shouldn't work for enabling/disabling the box. Try to insert a few prinit statements to verify that you're actually executing the code you think you are executing.

Replies are listed 'Best First'.
Re^2: Tk::ListBox questions
by g_speran (Scribe) on Mar 17, 2008 at 14:35 UTC
    Hello moritz,
    That was it. I overlooked, "If the listbox is disabled then items may not be inserted or deleted". I implemented suggestion to make it normal, add the list and then disable it.
    Thanks again