[Tkinter-discuss] configure command

adil gourinda rikudou__sennin at live.com
Tue Mar 6 11:31:23 EST 2018


In your example, is "width" a positional argument or a positional-keyword argument (and if it is what is the parameter's name) ?

Thanks
________________________________
From: Tkinter-discuss <tkinter-discuss-bounces+rikudou__sennin=live.com at python.org> on behalf of Michael Lange <klappnase at web.de>
Sent: Monday, March 5, 2018 10:41 PM
To: tkinter-discuss at python.org
Subject: Re: [Tkinter-discuss] configure command

Hi,

On Sun, 4 Mar 2018 23:26:56 +0000
adil gourinda <rikudou__sennin at outlook.com> wrote:

> [cid:132f79be-dacf-4e7a-b0b1-94f5411d267b]
> By this picture I tried to explain the translation of "configure"
> command from Tcl to Python configure() method.
>
> For the (1) and (3) cases the python's syntax is clear.
>
> But for the (2) case where in Tcl I need to write only the option's
> name without value, what is its equivalent in Python (when the
> parameter's name is an argument)?; I tried the syntax in the picture
> and it works but what make things more difficult is when there is
> another parameter before "option" (ex :PanedWindow.paneconfigure).
>
> Thanks for your attention

actually that is quite straightforward, as a little toying around reveals:

First a simple example in Tcl:

$ wish
% panedwindow .pw
.pw
% pack .pw
% text .pw.t
.pw.t
% .pw add .pw.t
% .pw paneconfigure .pw.t -width
-width {} {} {} {}
%

Now the same in Python:

$ python
Python 2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from Tkinter import *
>>> root = Tk()
>>> pw = PanedWindow(root)
>>> pw.pack()
>>> t = Text(pw)
>>> pw.add(t)
>>> pw.paneconfigure(t, 'width')
('width', '', '', '', '')
>>>

So you see, the paneconfigure command works exactly the same in Python as
it does in Tcl.

Regards

Michael

.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Dismissed.  That's a Star Fleet expression for, "Get out."
                -- Capt. Kathryn Janeway, Star Trek: Voyager, "The Cloud"
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss at python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20180306/c71e6a12/attachment-0001.html>


More information about the Tkinter-discuss mailing list