CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 1999
    Location
    ks
    Posts
    523

    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()

  2. #2
    Join Date
    Oct 1999
    Location
    ks
    Posts
    523

    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()

  3. #3
    Join Date
    Feb 2022
    Posts
    26

    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
  •  





Click Here to Expand Forum to Full Width

Featured