1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] python tkinter scrollbar windows 11 weird behavior

Discussão em 'Python' iniciado por Stack, Setembro 17, 2025.

  1. Stack

    Stack Membro Participativo

    I just upgraded to Windows 11 and opened my app that previously looked and worked fine in Windows 10. I am using python 3.11.15 with tkinter.Scrollbar objects for the scrollbars (not ttk).

    Some of my scrollbars are initializing with normal visuals, with arrows visible (number 1 in photo). Some of my scrollbars are initializing with no arrows visible (number 2 in photo). For number 2, the arrows and slider remain invisible if scrolled with mousewheel but become visible if the scrollbar is selected (number 3 in photo).

    [​IMG]

    When I use the top level window menu to select a different app or even the same app, I have it so all tkinter.Widget objects except the base container tkinter.Widget objects are deleted, all tkinter.Variable objects deleted from python and C backend, and then all new widgets and variables are created, including new scrollbars.

    Sometimes the new scrollbars appear with arrows, sometimes without.

    I am unsure how to replicate either behavior.

    Can anyone explain what I need to do to make all my scrollbars initialize with the arrows visible in Windows 11?

    Do I need to cycle a .focus() call through all my widgets after creating and gridding/packing them? Or do I need to use the tkinter.Scrollbar.activate(index=idk) where idk is one or all of the available options ("arrow1","slider","arrow2" or "")? OR is this just Windows 11 oddness and I should ignore it?

    I don't believe there is anything wrong with how I've coded the scrollbar objects themselves, as this same behavior is shown in a tutorial I found here: https://pythonassets.com/posts/scrollbar-in-tk-tkinter/

    Continue reading...

Compartilhe esta Página