Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Tk Listbox item padx

by choroba (Archbishop)
on Apr 09, 2020 at 00:06 UTC ( #11115249=note: print w/replies, xml ) Need Help??

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11115249]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2020-06-02 08:39 GMT
Find Nodes?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?

    Results (15 votes). Check out past polls.