python / python/cpython

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

Aperta
#136,095 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

OS-mac stdlib topic-tkinter type-bug
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia eseguendo l'esempio di Notebook fornito su macOS Sequoia con Python 3.13 e confronta il comportamento al clic sulle schede con Windows. Leggi l'implementazione di tkinter Notebook e il comportamento di macOS Tcl/Tk menzionato nel report. Il lavoro è completato quando la selezione di una scheda visualizza immediatamente la relativa pagina senza spostare il mouse fuori dall'area delle schede.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
desktop
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.