Buttons with line breaks do not display properly on Mac OS X

This code works great on Windows. On Mac OS X, it shows only a few in the button, and everything that passes after the new line is destroyed. I am running Python 2.6.5 on Mac.

import Tkinter as tk
class App:
    def __init__(self, master):
        self.a_button = tk.Button(master, text="Multiple\nLines\nOf Text")
        self.a_button.pack()

ROOT = tk.Tk()
APP = App(ROOT)
ROOT.mainloop()
+3
source share
1 answer

The buttons pressed on the Mac do not allow you to do this; they have 3 predefined heights for different control sizes and what it is. Other button styles support custom sizes; one option is to use the Tile button:

    self.a_button = tk.Widget(master, 'ttk::button',
                              dict(text="Multiple\nLines\nOf Text"))
+4
source

Source: https://habr.com/ru/post/1776194/


All Articles