http://qs321.pair.com?node_id=11115249


in reply to Tk Listbox item padx

If you don't want to prepend a space to each element in the list, use a more advanced type of a list. For example, a Tk::HList:
#! /usr/bin/perl use warnings; use strict; use Tk; use Tk::HList; my $mw = 'MainWindow'->new(-title => 'Listbox test'); my $hl = $mw->HList(-drawbranch => 0, -pady => 0, -padx => 10 # <- This is what you need! )->pack; for ('A' .. 'H') { $hl->addchild("", -text => $_); } MainLoop();
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Tk Listbox item padx
by Anonymous Monk on Apr 09, 2020 at 09:03 UTC

    Thanks, choroba, for pointing me to the HList widget. The behaviour was exactly what I was loking for.

    2020-04-10 Athanasius s/Corion/choroba/.