-
March 14th, 2022, 05:18 PM
#1
move python combobox down arrow to left
i have base code that works below. cannot figure out how to move down arrow from one right side to left. anyideas?
thanks in advance
import tkinter as tk
from tkinter import ttk
window = tk.Tk()
window.geometry('400x200')
comboExample = ttk.Combobox(
window,
values=[
"Jan",
"Feb",
"Mar",
"Apr"
]
)
comboExample.grid(column=0, row=0)
comboExample.current(0)
window.mainloop()
-
March 16th, 2022, 08:11 AM
#2
Re: move python combobox down arrow to left
the answer is below: however i feel compelled to comment that is far from intuitive. people should not be subjected to this for a simple task like this.
import tkinter as tk
from tkinter import ttk
window = tk.Tk()
window.geometry('400x200')
style = ttk.Style()
cb_style = style.layout("TCombobox")
cb_style[0][1]['children'][0][1]['side'] = 'left'
style.layout("CustomStyle.TCombobox", cb_style)
comboExample = ttk.Combobox(
window,
values=[
"Jan",
"Feb",
"Mar",
"Apr"
],
style='CustomStyle.TCombobox'
)
comboExample.grid(column=0, row=0)
comboExample.current(0)
window.mainloop()
-
March 18th, 2022, 11:27 AM
#3
Re: move python combobox down arrow to left
Thanks for posting your solution Jim - I'm going to ask some of our developers if they have an easier solution for this and get back to you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|