Terry J. Reedy <tjre...@udel.edu> added the comment:

You are confusing the widget path component, an arbitrary string of chars other 
than the separator '.', with the English word 'frame', which is also a tk 
command.  In tk docs, 'a *frame*' is a widget (tk window) created with the 
'frame' command.

By default, tk gives each widget(window) a unique but meaningless string of 
digits as its path component.  A user can override this by giving an explicit 
name option on creation.  

A few years ago, tkinter started always overriding the tk default with a  
readable name.  Serhiy and I agreed on using a '!' prefix since it was unlikely 
though not impossible to be used by tkinter users.  We must have agreed on not 
specifically flagging ttk widgets in the path component, as opposed to the 
widget name (see below).  A numerical suffix is added to duplicates.  The 
system is not perfect, but overall we prefer it to the tk digit sequences, in 
spite of the following possible confusion.

>>> c = ttk.Combobox(r, name='!frame')
>>> c
<tkinter.ttk.Combobox object .!frame>
>>> c.widgetName
'ttk::combobox'
>>> c.master.wm_manage(c)
...
_tkinter.TclError: window ".!frame" is not manageable: must be a frame, 
labelframe or toplevel

For debugging in 'python -i' or IDLE 'run module' mode, one can followup by 
checking the passed-in widget's widgetName if it is not otherwise obvious.

If you want tk or its tk wm_manage doc at 
https://www.tcl.tk/man/tcl8.6/TkCmd/wm.htm#M53 changed, you have to ask the 
tcl.tk people.  Extremely unlikely I suspect.  I presume that there are 
technical reasons why a ttk Frame is not a drop-in replacement for a tk Frame 
in this context.  And since a *ttk::frame* is clearly different from a *frame*, 
the doc is clear enough.  For all other commands, the window can only be a 
*toplevel*, so the exception for wm manage is an extension to frame and 
labelframe, rather than a restriction.

Our 3-paragraph doc for the corresponding Wm class does not discuss the 
individual methods but implicitly defers to the tkinter.__init__ code and the 
tk doc.

Our ttk doc does not discuss the ttk widgets that are essentially copies of tk 
widgets except the mostly documented differences.  So there is not  a good 
place to say anything and I am dubious that we should.

So I think we should close as 'not a bug' unless Serhiy disagrees.

----------
nosy: +serhiy.storchaka, terry.reedy

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

Reply via email to