Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Tk Listbox item padx

by choroba (Cardinal)
on Apr 09, 2020 at 00:06 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2024-04-19 08:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found