[Tkinter-discuss] configure command
Michael Lange
klappnase at web.de
Mon Mar 5 17:41:17 EST 2018
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"
More information about the Tkinter-discuss
mailing list