[issue4343] New function in Tkinter.py: setup_master

2014-10-05 Thread R. David Murray

R. David Murray added the comment:

Changing status back to 'needs patch' per Terry's comment that the patch needs 
to be updated (now for 3.5).

--
assignee: gpolo - 
nosy: +r.david.murray
stage: commit review - needs patch
versions: +Python 3.5 -Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4343
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4343] New function in Tkinter.py: setup_master

2013-06-04 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I am still confused about the master/parent business and why required args are 
documented as optional. (Besides #18131, I also discovered that messageboxes 
usually, but not always, require parent=something passed, to be collected into 
**options. I need to read more before I can really review and think about 
applying this.

Why isn't _default_root initialized to something useful instead of None. If it 
were, _support_default_root would not be needed.

The new function is slightly different from the code it replaces. The main 
difference I see with Misc.setup is that your code does *not* stash Tk() in 
_default_root. Since every Tk() call creates a new screen window, I do not see 
how this is correct.

On the plus side, I believe your patch would fix part of the problem I reported 
in #18131.

--
nosy: +terry.reedy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4343
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4343] New function in Tkinter.py: setup_master

2013-06-04 Thread Terry J. Reedy

Terry J. Reedy added the comment:

After searching through tkinter.py for '_default_root', the patch looks better. 
The point I missed before is that Tk().__init__(self,...) normally calls 
_loadtk(self) which installs self as _default_tk if it was None before. So the 
new function will return the same Tk object each call after the first (unless 
_default_tk is somehow reset to None.) This also means that the assignment in 
BaseWidget.setup, _default_root = Tk(), which the patch deletes, is redundant 
and misleading, and should go.

I think 'getmaster' or 'get_master' would be a better name than 'setup_master' 
as setting up a new master is the 2nd backup choice and will happen only once 
in a session. Most call will get an existing master -- either the one passed in 
or the once stored as _default_root 

The patch needs to be updated for 3.4 and run with current tests.

--
versions: +Python 3.4 -Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4343
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4343] New function in Tkinter.py: setup_master

2010-11-27 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
assignee:  - gpolo
keywords: +needs review
stage:  - commit review
type:  - feature request
versions: +Python 3.2 -Python 2.7, Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4343
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4343] New function in Tkinter.py: setup_master

2009-02-02 Thread Guilherme Polo

Guilherme Polo ggp...@gmail.com added the comment:

Any chance I can get this in ? I'm using something very similar to test
the ttk wrapper and will also be using in other tests, extensions would
also benefit from it, and old code doesn't get affected to it.

--
versions: +Python 3.1 -Python 3.0

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4343
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4343] New function in Tkinter.py: setup_master

2008-11-18 Thread Guilherme Polo

New submission from Guilherme Polo [EMAIL PROTECTED]:

Hi,

I've added a new function called setup_master. 

This function is responsible for returning an usable master to the
caller, or fail and say so. The function is useful for any wrapper
basically, since all them has to set up a master sometime (or maybe
always require a master, but that is not very nice) and will usually do
it half wrong. The half wrong is about relying on _default_root being
available in Tkinter, which is not the case if support for default root
has been disabled.

There are two patches, the first adds the function, the second applies
it self where necessary in Tkinter. The later also adds some new
behaviour in Tkinter, previously Variable class and subclasses wouldn't
work properly without prior creation of a master (there are similar
problems in other parts too).

--
components: Tkinter
files: setup_master.diff
keywords: patch
messages: 76005
nosy: gpolo
severity: normal
status: open
title: New function in Tkinter.py: setup_master
versions: Python 2.7, Python 3.0
Added file: http://bugs.python.org/file12040/setup_master.diff

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4343
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4343] New function in Tkinter.py: setup_master

2008-11-18 Thread Guilherme Polo

Changes by Guilherme Polo [EMAIL PROTECTED]:


Added file: http://bugs.python.org/file12041/applying_setup_master.diff

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4343
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4343] New function in Tkinter.py: setup_master

2008-11-18 Thread Guilherme Polo

Changes by Guilherme Polo [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file12040/setup_master.diff

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4343
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4343] New function in Tkinter.py: setup_master

2008-11-18 Thread Guilherme Polo

Changes by Guilherme Polo [EMAIL PROTECTED]:


Added file: http://bugs.python.org/file12042/setup_master.diff

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4343
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com