[issue22026] 2.7.8 ttk Button text display problem

Les Bothwell report at bugs.python.org
Mon Jul 21 22:22:04 CEST 2014


New submission from Les Bothwell:

My system: Windows 7 64 bit.  Python 2.7.8 (32 bit)
There's a problem with ttk button label text truncation when using large fonts on 2.7.8.  2.7.6 works Ok.  With 2.7.6, increasing the font size in a ttk style makes the button large enough to display the text properly.  With 2.7.8 the button seems to be large enough but the text is truncated on the right.  See attached file for pics.
Since issue 21665 is not closed yet, is this a side effect of ttk build problems?

This displays the problem..
from Tkinter import *
import ttk

from oxogame import *

class MainWindow(Frame):
    def __init__(self, master=None):
        " Initialise main window with controls "
        Frame.__init__(self, master)
        master.title('Font problem')
        ttk.Style().configure('Square.TButton', font='Arial 24 bold', width=1, height=1, padding=(6,0))

        ttk.Button(self, state=NORMAL, text='X', style='Square.TButton').pack(side=LEFT)
        ttk.Button(self, state=NORMAL, text='O', style='Square.TButton').pack(side=LEFT)
        self.pack(side=LEFT, fill=None, expand=0)

if __name__ == "__main__":
    root = Tk()
    root.resizable(0, 0)
    root.attributes("-toolwindow", 1)
    MainWindow(root).mainloop()

----------
components: Tkinter
files: ttk_font.pdf
messages: 223607
nosy: les.bothwell
priority: normal
severity: normal
status: open
title: 2.7.8 ttk Button text display problem
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file36013/ttk_font.pdf

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22026>
_______________________________________


More information about the Python-bugs-list mailing list