Re: Control placement of a button within a text widget
- From: "slebetman@xxxxxxxxx" <slebetman@xxxxxxxxx>
- Date: 29 Nov 2005 18:07:24 -0800
Bryan Oakley wrote:
> slebetman@xxxxxxxxx wrote:
> > # Note how I surround the button with space bars to maintain
> > # correct center.
> >
>
> Why do you add spaces "to maintain the correct center"? You can just add
> the ctr tag to the created window after the fact with '.t tag add'.
Ah, didn't realise I could tag a window. I tried:
..t window create end ..... tag
and it didn't work. Then when I read (quickly scanned) the docs I
couln't find a way to tag a window. Thanks. Then the solution is
simply:
pack [text .t -width 12] -fill x
..t tag configure ctr -justify center
set s "This is line 1.
This is line 2.
This is line 3.
"
..t insert end $s
..t window create end -align center -create \
[list button .t.btn -text Ok \
-command {puts "Click"}]
..t tag add ctr {end - 1 lines} end
.
- References:
- Control placement of a button within a text widget
- From: Helmut Giese
- Re: Control placement of a button within a text widget
- From: slebetman@xxxxxxxxx
- Re: Control placement of a button within a text widget
- From: Bryan Oakley
- Control placement of a button within a text widget
- Prev by Date: Re: Control placement of a button within a text widget
- Next by Date: Re: Understanding of simpletest utility
- Previous by thread: Re: Control placement of a button within a text widget
- Next by thread: Add images recursively to tablelist cells?
- Index(es):