Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #106094
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Terry Reedy <tjreedy@udel.edu> |
| Newsgroups | comp.lang.python |
| Subject | Re: Adding borders to ttk radiobuttons |
| Date | Wed, 30 Mar 2016 12:38:27 -0400 |
| Lines | 54 |
| Message-ID | <mailman.217.1459356008.28225.python-list@python.org> (permalink) |
| References | <mailman.204.1459343690.28225.python-list@python.org> <56fbe699$0$4548$426a74cc@news.free.fr> <56fbe905$0$4540$426a74cc@news.free.fr> <ndgqg8$fbr$1@ger.gmane.org> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | quoted-printable |
| X-Trace | news.uni-berlin.de vRV50MF8MM8fX3dyw+mJBgK+4Xa+k+mRmpNcdhvXb1Zg== |
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'skip:[ 20': 0.03; 'root': 0.04; "'',": 0.07; 'ast': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.10; 'jan': 0.11; '"mark': 0.16; "'left',": 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'sadly': 0.16; 'skip:n 50': 0.16; 'subject:Adding': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; '>>>': 0.20; 'windows': 0.20; 'lawrence': 0.22; 'tkinter': 0.22; 'am,': 0.23; 'seems': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'least': 0.27; "skip:' 10": 0.28; 'skip:( 20': 0.28; 'skip:s 30': 0.31; 'problem': 0.33; 'machine.': 0.33; 'info': 0.34; 'something': 0.35; 'asking': 0.35; 'should': 0.36; 'needed': 0.36; 'there': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'display': 0.37; 'received:org': 0.37; 'button': 0.38; 'to:addr:python.org': 0.40; 'mark': 0.40; 'some': 0.40; 'your': 0.60; 'received:96': 0.63; 'more': 0.63; 'believe': 0.66; 'response.': 0.66; 'python- list': 0.66; 'dans': 0.72; 'skip:n 40': 0.72; '3.5.1': 0.84; 'ttk': 0.84; 'received:fios.verizon.net': 0.91; 'url:tutorial': 0.91 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| X-Gmane-NNTP-Posting-Host | pool-96-227-207-81.phlapa.fios.verizon.net |
| User-Agent | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 |
| In-Reply-To | <ndgqg8$fbr$1@ger.gmane.org> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.21 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Xref | csiph.com comp.lang.python:106094 |
Show key headers only | View raw
On 3/30/2016 11:14 AM, Mark Lawrence via Python-list wrote:
> On 30/03/2016 15:55, ast wrote:
>>
>> "ast" <nomail@com.invalid> a écrit dans le message de
>> news:56fbe699$0$4548$426a74cc@news.free.fr...
>>>
>>> "Mark Lawrence" <breamoreboy@yahoo.co.uk> a écrit dans le message de
>>> news:mailman.204.1459343690.28225.python-list@python.org...
>>>> I believe something like this should suffice to display borders
>>>> around the radiobuttons.
>>>>
>>>> import tkinter as tk
>>>> import tkinter.ttk as ttk
>>>> root = tk.Tk()
>>>> style = ttk.Style()
>>>> style.configure('BW.TRadiobutton', borderwidth=5)
>>>> buttonVar = tk.IntVar()
>>>> rb1 = ttk.Radiobutton(text='Hello mum', variable=buttonVar, value=1)
>>>> rb1.configure(style='BW.TRadiobutton')
>>>> rb1.grid(row=0, column=0)
>>>> rb2 = ttk.Radiobutton(text='Hello dad', variable=buttonVar, value=2)
>>>> rb2.configure(style='BW.TRadiobutton')
>>>> rb2.grid(row=1, column=0)
>>>> root.mainloop()
>>>>
>>>> Sadly no borders :( What have I missed? Python 3.5.1 on Windows 10.
>>>>
>>>
>>> it seems there is no border on the radio button
>>>
>>>> style.layout('BW.TRadiobutton')
>>>
>>> [('Radiobutton.padding', {'children': [('Radiobutton.indicator',
>>> {'side': 'left', 'sticky': ''}), ('Radiobutton.focus', {'side':
>>> 'left', 'sticky': '', 'children': [('Radiobutton.label', {'sticky':
>>> 'nswe'})]})], 'sticky': 'nswe'})]
>>
>> for more help:
>> http://www.tkdocs.com/tutorial/styles.html
>
> For this particular problem not of much use, or I wouldn't be asking :(
This page has some of the info needed to get a radiobutton with a
border, at least my machine. See my answer to your other response.
--
Terry Jan Reedy
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Adding borders to ttk radiobuttons Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-30 14:14 +0100
Re: Adding borders to ttk radiobuttons "ast" <nomail@com.invalid> - 2016-03-30 16:45 +0200
Re: Adding borders to ttk radiobuttons "ast" <nomail@com.invalid> - 2016-03-30 16:55 +0200
Re: Adding borders to ttk radiobuttons Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-30 16:14 +0100
Re: Adding borders to ttk radiobuttons Terry Reedy <tjreedy@udel.edu> - 2016-03-30 12:38 -0400
Re: Adding borders to ttk radiobuttons Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-30 16:01 +0100
Re: Adding borders to ttk radiobuttons Terry Reedy <tjreedy@udel.edu> - 2016-03-30 12:35 -0400
Re: Adding borders to ttk radiobuttons Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-31 00:41 +0100
csiph-web