python / python/cpython

ttk.tkinter.Notebook does not refresh notebook page on Mac unless mouse moves out of tab area

Open
#136,095 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OS-mac stdlib topic-tkinter type-bug
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

Test Code:

from tkinter import *
from tkinter.ttk import Notebook

mw = Tk()
mw.title("Notebook Test")
mw.geometry(f"{800}x{800}")

main_page_frame = Frame(mw, borderwidth=1, relief='ridge')
main_page_frame.pack(side='top', expand=1, fill='both')

notebook = Notebook(main_page_frame)
notebook.pack(expand=1, fill='both')

for info in ("one", "two", "three"):
    frame = Frame(mw)
    Label(frame, text=info).pack()
    notebook.add(frame, text=info)

mw.mainloop()

Test Computer

MacOS Sequoia: Version 15.3.1

Problem

prepare

Click on the three tabs, one after another. The behaviour is what one would expect

execution

  • carefully click on a new tab... but don't move the mouse once you have clicked

problem

  • the notebook page does not refresh (i.e. you won't see the label within the notebook)
  • if you move the mouse carefully just within the tab name area, nothing happens
  • if you move the mouse outside of this area, the label will suddenly appear.

Note

Tried this on a windows machine, and the behaviour as it should be, so this problem seems to be a MAC problem (don't have a linux machine so can't try there).

According to the documentation, the MAC python 3.13 has its own version of Tcl/Tk, so maybe this is a Tcl/Tk problem, and not a python problem?

CPython versions tested on:

3.13

Operating systems tested on:

macOS

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied Notebook example on macOS Sequoia with Python 3.13 and compare tab-click behavior with Windows. Read the tkinter Notebook implementation and the macOS Tcl/Tk behavior mentioned in the report. Done means selecting a tab displays its page immediately without moving the mouse outside the tab area.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.