Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu.add_checkbutton has no checkmark on OS X #73152

Closed
VictorSergienko mannequin opened this issue Dec 14, 2016 · 2 comments
Closed

Menu.add_checkbutton has no checkmark on OS X #73152

VictorSergienko mannequin opened this issue Dec 14, 2016 · 2 comments
Labels
topic-tkinter type-feature A feature request or enhancement

Comments

@VictorSergienko
Copy link
Mannequin

VictorSergienko mannequin commented Dec 14, 2016

BPO 28966
Nosy @ned-deily

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2016-12-14.02:04:47.595>
created_at = <Date 2016-12-14.01:45:53.719>
labels = ['type-feature', 'expert-tkinter']
title = 'Menu.add_checkbutton has no checkmark on OS X'
updated_at = <Date 2016-12-14.02:04:47.577>
user = 'https://bugs.python.org/VictorSergienko'

bugs.python.org fields:

activity = <Date 2016-12-14.02:04:47.577>
actor = 'ned.deily'
assignee = 'none'
closed = True
closed_date = <Date 2016-12-14.02:04:47.595>
closer = 'ned.deily'
components = ['Tkinter']
creation = <Date 2016-12-14.01:45:53.719>
creator = 'Victor Sergienko'
dependencies = []
files = []
hgrepos = []
issue_num = 28966
keywords = []
message_count = 2.0
messages = ['283153', '283156']
nosy_count = 2.0
nosy_names = ['ned.deily', 'Victor Sergienko']
pr_nums = []
priority = 'normal'
resolution = 'third party'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue28966'
versions = ['Python 3.6']

@VictorSergienko
Copy link
Mannequin Author

VictorSergienko mannequin commented Dec 14, 2016

On Linux, this code toggles the checkmark on a checkbutton in right-click menu. On OS X 10.12 it doesn't.

OS X 10.12, python 3.6.0b4.

#!/usr/bin/env python3
import tkinter as tk


class NodePopup(tk.Menu):
    def __init__(self, master):
        super().__init__(master, tearoff=0)

        self.send_disabled = tk.BooleanVar()

        self.add_checkbutton(label="Disable sending",
                             variable=self.send_disabled, command=self.toggle_send)

    def popup(self, event):
        print('send_disabled before:', self.send_disabled.get())
        self.post(event.x_root, event.y_root)

    def toggle_send(self):
        print('send_disabled after:', self.send_disabled.get())


def change():
    state = not menu.send_disabled.get()
    menu.send_disabled.set(state)

root = tk.Tk()
root.pack_propagate(0)

menu = NodePopup(root)
root.bind('<Button-2>', menu.popup)

root.mainloop()

@VictorSergienko VictorSergienko mannequin added topic-tkinter type-feature A feature request or enhancement labels Dec 14, 2016
@ned-deily
Copy link
Member

I'm not totally sure what behavior you expect but it *seems* to work OK for me using the current Python 3.5.2 or the pre-release 3.6.0rc1 from python.org OS X installers and with current ActiveTcl 8.5.18 installed as suggested (https://www.python.org/download/mac/tcltk/). If you default to using the very out-of-date and buggy Apple-supplied system Tcl/Tk 8.5.9, the checkmark does not appear.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-tkinter type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant