0

TOday I update from ActiveTcl 8.5.9 to ActiveTcl 8.5.17in order to fix this bug. I on a mac, os x 10.7. I have noticed to broke a couple things in my program. Some buttons flash a black outline when I click in unrelated areas (This didn't happen before the update). By biggest concern is that some of my checkbuttons didn't show! For example:

import tkinter as tk
t=tk.Tk()

c=tk.IntVar()
b=tk.Checkbutton(master=t,variable=c)
b.grid(column=0,row=1,sticky="nsew")

t.mainloop()

gives a empty window window however the code:

import tkinter as tk

t=tk.Tk()

c=tk.IntVar()
b=tk.Checkbutton(master=t,variable=c,text="bob")
b.grid(column=0,row=1,sticky="nsew")

t.mainloop()

EDIT: The Checkbutton is still there as it reacts to click but it just down't show

gives what is expected. Now comes the weird part, changing the text to "aaa" the code doesn't work yet again. Is this something to do with the length of the text? I've tried adding padding, changing the stickiness and nothing helped :( In other cases it acts even weirder. Did something change in 8.5.17 or is my version simply off?

Community
  • 1
  • 1
Michal
  • 1,300
  • 2
  • 14
  • 22
  • can you try the same with ttk widgets ?, they are more native. docs at https://docs.python.org/3.5/library/tkinter.ttk.html?highlight=ttk#module-tkinter.ttk – Walle Cyril Mar 09 '15 at 22:27
  • using ttk it works. I just don't see a reason why it shouldn't work in tk – Michal Mar 09 '15 at 22:33

1 Answers1

0

Use ttk widgets for more cross platform consistency.

import tkinter as tk
import tkinter.ttk  as ttk

tkk is a set of more modern widget than those presented in tk.

I guess tk calls olds OS API for GUI and then customize those widgets. And ttk calls the last, native default API for GUIs. This causes problems on OS X because Apple decided that backward compatibility was not a priority when shipping a new version of their OS

Walle Cyril
  • 3,087
  • 4
  • 23
  • 55