New submission from Dominic Mayers :
Currently, it's not possible to center or change the coordinates in anyway of
an askstring, askfloat or askinteger dialog in simpledialog.py. One can see
this by looking at the code:
if parent.winfo_viewable():
self.transient(p
Dominic Mayers added the comment:
Just to add that I realize now that tkinter is designed for applications with a
root window, the "application window". That's why little attention is given to
a possible missing root. In fact, it's interesting that we have this code
Change by Dominic Mayers :
--
versions: +Python 3.9 -Python 3.7
___
Python tracker
<https://bugs.python.org/issue39171>
___
___
Python-bugs-list mailin
Dominic Mayers added the comment:
Again, I just spent a few minutes looking at this, but in the ttk module, in a
similar situation, they do:
if master is None:
if tkinter._support_default_root:
master = tkinter._default_root or tkinter.Tk()
else
Dominic Mayers added the comment:
If it's normal, then the error message should perhaps be more informative and
user friendly than just a traceback:
Traceback (most recent call last):
File "./dialog.py", line 6, in
integer_value = simpledialog.askintege
New submission from Dominic Mayers :
My first "bug" report here. Not sure I am doing it right. It is just that if I
execute the code
import tkinter
from tkinter import simpledialog
tkinter.Tk().withdraw()
integer_value = simpledialog.askinteger('Dialog Title&
Changes by Dominic Mayers :
Removed file:
http://bugs.python.org/file46775/Issue29947_for_discussion_03.patch
___
Python tracker
<http://bugs.python.org/issue29
Dominic Mayers added the comment:
An improved version of the patch, I hope. I will remove the old patch, because
it's really does not help to see the old versions.
--
Added file: http://bugs.python.org/file46781/Issue29947_for_discussion_04.
Changes by Dominic Mayers :
Added file: http://bugs.python.org/file46775/Issue29947_for_discussion_03.patch
___
Python tracker
<http://bugs.python.org/issue29947>
___
___
Changes by Dominic Mayers :
Removed file:
http://bugs.python.org/file46774/Issue29947_for_discussion_02.patch
___
Python tracker
<http://bugs.python.org/issue29
Changes by Dominic Mayers :
Removed file: http://bugs.python.org/file46770/Issue29947_for_discussion.patch
___
Python tracker
<http://bugs.python.org/issue29947>
___
___
Dominic Mayers added the comment:
I simplified the patch. Using a class as a factory function is the simplest
case, so I took advantage of this. I also give one way to pass extra parameters
to the handler in the factory function, because it's the main reason why we
cannot always use a
Dominic Mayers added the comment:
The key point, IMHO, is that the BaseRequestHandler class is just provided as
an option and its API (setup, handle and finish) is ignored by the code that we
support.
Some applications may have used the API, but these are details in applications.
Simply, we
Dominic Mayers added the comment:
I started to look at the documentation to see what would need to be changed,
assuming that we agree for a change in the API. Just for the purpose of this
discussion, I created a patch that only change the comments in socketserver.py
Changes by Dominic Mayers :
--
keywords: +patch
Added file: http://bugs.python.org/file46770/Issue29947_for_discussion.patch
___
Python tracker
<http://bugs.python.org/issue29
Changes by Dominic Mayers :
Removed file: http://bugs.python.org/file46768/factorymixinclass
___
Python tracker
<http://bugs.python.org/issue29947>
___
___
Python-bug
Dominic Mayers added the comment:
I did not think very far when said that renaming the parameter could not
possibly break the code ! Oh well ! But, renaming the parameter was not
important in itself. It was to make the situation clearer and easier for those
who write the documentation
Dominic Mayers added the comment:
Oops, I did not realize that David was one of the developers. Well, may be this
needs the attention of more than one developer.
--
___
Python tracker
<http://bugs.python.org/issue29
Dominic Mayers added the comment:
The reason why I feel we should not make it immediately a documentation issue
is that I don't know how a person working on documentation could proceed ahead
without a clear go ahead signal from developers. In that sense, having a
documentation that says
Dominic Mayers added the comment:
To sum up, David clarified that we can in fact easily pass an arbitrary factory
method that creates and starts a request handler, instead of a request handler
class with setup, handle and finish in its API. This could indeed be a valid
reason to consider this
Dominic Mayers added the comment:
Perhaps I should raise a separate issue, but it is related, because the current
code "requires" that we define an handler class with `setup()`, `handle()` and
`finish()` in its API. If you look at the actual code, there is no such
requirement. We on
Dominic Mayers added the comment:
I am a bit ashamed that I missed that. Still, the intent in the current code,
the name of the parameter, the examples, etc. is that we pass the handler
class. This is more than its __init__ function and less than a generic factory
method. An important
Dominic Mayers added the comment:
On the other hand, it occurs to me that this seems way more flexible than
passing the object through the server, because you share the factory with the
server, not only the object. This means that you could even change the type of
the handler while the server
Changes by Dominic Mayers :
--
resolution: wont fix ->
status: closed -> open
___
Python tracker
<http://bugs.python.org/issue29947>
___
___
Python-bugs-
Dominic Mayers added the comment:
Finally, I looked around and people just use the server to pass any extra
parameter. I do find it awkward, but it works and it is simple, in fact simpler
than having to define a factory object. I don't close it, because I will be
happy to see another op
Dominic Mayers added the comment:
One way to make the factory optional is to offer a MixIn. I attached a file
with a FactoryMixIn. It's just that I find it awkward that the proposed
approach is to pass the extra parameters in a subclassed server. More modern
approaches should also be of
New submission from Dominic Mayers:
I am just curious to know if someone considered the idea of passing a factory
instance that returns RequestHandlerClass instances instead of directly passing
the class? It may affect existing handlers that read non local variables, but
there should be a way
27 matches
Mail list logo