0

I am making a GUI program using Raspberry Pi.

This GUI is made with Tkinter and works only on the touch screen, no mouse and keyboard.

However, the arrow buttons on the COMBOBOX are too small to touch with your fingers.

I used "tkinter.font" to increase the font size, but the font size only increases and the arrow buttons do not increase in size.

How can I increase the size of this arrow button?

How to apply a style doesn't work. My code is below. please help me

enter image description here

import tkinter.ttk
import tkinter.font

class Application:
    def __init__(self, parent):
        self.parent = parent
        self.data = [1,2,3]

        self.bigfont = tkinter.font.Font(family="Helvetica",size=30)
        root.option_add("*TCombobox*Listbox*Font", self.bigfont)

        self.combo()

    def combo(self):
        self.style = tkinter.ttk.Style()
        self.style.configure('W.TCombobox', arrowsize = 1000)
        self.cBox = tkinter.ttk.Combobox(self.parent, values = self.data, style = 'W.TCombobox', font=self.bigfont)

        self.cBox.current(0)
        self.cBox.pack()

if __name__ == '__main__':
    root = tkinter.Tk()
    root.title("COMBOBOX TEST")
    root.geometry("640x400+100+100")
    app = Application(root)
    root.mainloop()
  • Does this help https://stackoverflow.com/questions/28938758/combobox-fontsize-in-tkinter? – toyota Supra Oct 02 '22 at 15:53
  • @toyotaSupra Yes, that question didn't help me much. First, to change the font, the size of the text increases, but the size of the arrow does not change. As the letters get bigger, the vertical size of the COMBOBOX increases, and the arrow size also increases vertically, but the horizontal size does not. Therefore, the shape of the arrow button becomes a vertically elongated shape. The second way to apply a style doesn't work. My code is below. – Hyunwoo Choi Oct 03 '22 at 12:25
  • So far it seems some styles use images for the buttons, and other use fonts. For example, if I do ```tkinter.ttk.Style().theme_use('default')``` I can see the change in the button (on Windows - which starts with another theme, using an image for the arrow, and it's small). – bitRAKE Oct 05 '22 at 06:10
  • @bitRAKE thank you You are right. When the theme is set to 'default', the arrow size changes. The picture I attached is a combo box made temporarily in the Windows environment, and first of all, I confirmed that the arrow size changes in the Windows environment. After work, I will go home and test it on Raspberry pi. – Hyunwoo Choi Oct 05 '22 at 06:46

0 Answers0