E. Paine <paineeli...@gmail.com> added the comment:

+1 I also think that the fontchooser should be wrapped. I briefly tested your 
wrapper, Lance, and found it worked fine on Windows but did not on my Linux 
setup (because it is non-modal).

I went about implementing my own wrapper based loosely around your's (see 
attached) and the way I overcame this problem was to use vwait (this still 
works on Windows where the call is modal). vwait is good because it returns 
once the condition is fulfilled without the need for polling or similar.

While I use the commondialog module in the wrapper, this is simply for its 
handling (in __init__) of the master (I don't think it would make sense to 
enhance the Dialog class for this wrapper).

> the awful kludge in the show method (creating a Frame widget just so that 
> some low-level operations can be performed) is repugnant to me

You're going to moan at me then for using something similar in the attached! 
The reason I use it is to avoid the logic found on line 77 of your wrapper and 
*hopefully* make the code more readable (whether I achieve this is somewhat 
debatable).

> I have access only to Windows OS

Is this still the case or can you now test on a different system which is 
non-modal?


Do you wish to go ahead with authoring a patch for this or would you prefer me 
to do it? (I would appreciate you reviewing it either way and you would still 
get credit in the news as I took sections from your wrapper) If everything goes 
well, we can hopefully get this into Python 3.10 (as this is a new feature, it 
won't be back-ported to 3.9 and before).

----------
nosy: +epaine
versions: +Python 3.10 -Python 3.7
Added file: https://bugs.python.org/file49459/fontchooser.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue28694>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to