Re: [Tkinter-discuss] configure command

2018-03-07 Thread Michael Lange
Hi,

On Wed, 7 Mar 2018 13:46:40 +
adil gourinda  wrote:

> For the last time, what is the parameter's name that accepts option's
> name as a string:
> 
> instance.configure(?!?!="option")
> 
> I hope I was clear this time.

ok, I got it now :)
As Brian pointed out, there is no literal parameter name here in Python,
however (to make things a bit more confusing :) technically speaking you
can use "cnf" as keyword-parameter here (although "cnf" is usually
supposed to be a {"option":"value"} dict), so e.g.:

  >>> widget.configure('bd')
  ('borderwidth', 'borderWidth', 'BorderWidth', , 0)

is equal to

  >>> widget.configure(cnf='bd')
  ('borderwidth', 'borderWidth', 'BorderWidth', , 0)


Regards

Michael


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

You can't evaluate a man by logic alone.
-- McCoy, "I, Mudd", stardate 4513.3
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


Re: [Tkinter-discuss] configure command

2018-03-07 Thread Bryan Oakley
>
> For the last time, what is the parameter's name that accepts option's name
> as a string:


The tk documentation calls this "option". In python it doesn't have a
literal name. If you need to refer to it in documentation you could use
"argument" or "the only argument" or  "the first positional argument". For
example: "if you call the configure method with a single argument (eg:
label_widget.configure("text")), it will return ..."



On Wed, Mar 7, 2018 at 7:46 AM, adil gourinda <rikudou__sen...@live.com>
wrote:

> For the last time, what is the parameter's name that accepts option's name
> as a string:
>
> instance*.configure(*?!?!="option"*)*
>
> I hope I was clear this time.
>
> Thanks
> --
> *From:* Tkinter-discuss <tkinter-discuss-bounces+rikudou__sennin=live.com@
> python.org> on behalf of Michael Lange <klappn...@web.de>
> *Sent:* Tuesday, March 6, 2018 8:46 PM
> *To:* tkinter-discuss@python.org
> *Subject:* Re: [Tkinter-discuss] configure command
>
> Hi,
>
> On Tue, 6 Mar 2018 16:31:23 +
> adil gourinda <rikudou__sen...@live.com> wrote:
>
> > In your example, is "width" a positional argument or a
> > positional-keyword argument (and if it is what is the parameter's
> > name) ?
>
> Not sure what you mean by that; I would tend to say the parameter's name
> is "width" ;)
>
> At
> https://www.tcl.tk/man/tcl8.4/TkCmd/panedwindow.htm#M33
> this is explained in more detail.
>
> Regards
>
> Michael
>
> .-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.
>
> Earth -- mother of the most beautiful women in the universe.
> -- Apollo, "Who Mourns for Adonais?" stardate 3468.1
> ___
> Tkinter-discuss mailing list
> Tkinter-discuss@python.org
> https://mail.python.org/mailman/listinfo/tkinter-discuss
>
> ___
> Tkinter-discuss mailing list
> Tkinter-discuss@python.org
> https://mail.python.org/mailman/listinfo/tkinter-discuss
>
>
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


Re: [Tkinter-discuss] configure command

2018-03-07 Thread adil gourinda
For the last time, what is the parameter's name that accepts option's name as a 
string:

instance.configure(?!?!="option")

I hope I was clear this time.

Thanks

From: Tkinter-discuss 
<tkinter-discuss-bounces+rikudou__sennin=live@python.org> on behalf of 
Michael Lange <klappn...@web.de>
Sent: Tuesday, March 6, 2018 8:46 PM
To: tkinter-discuss@python.org
Subject: Re: [Tkinter-discuss] configure command

Hi,

On Tue, 6 Mar 2018 16:31:23 +
adil gourinda <rikudou__sen...@live.com> wrote:

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

Not sure what you mean by that; I would tend to say the parameter's name
is "width" ;)

At
https://www.tcl.tk/man/tcl8.4/TkCmd/panedwindow.htm#M33
this is explained in more detail.

Regards

Michael

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

Earth -- mother of the most beautiful women in the universe.
-- Apollo, "Who Mourns for Adonais?" stardate 3468.1
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


Re: [Tkinter-discuss] configure command

2018-03-06 Thread Michael Lange
Hi,

On Tue, 6 Mar 2018 16:31:23 +
adil gourinda  wrote:

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

Not sure what you mean by that; I would tend to say the parameter's name
is "width" ;)

At
https://www.tcl.tk/man/tcl8.4/TkCmd/panedwindow.htm#M33
this is explained in more detail.

Regards

Michael

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

Earth -- mother of the most beautiful women in the universe.
-- Apollo, "Who Mourns for Adonais?" stardate 3468.1
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


Re: [Tkinter-discuss] configure command

2018-03-06 Thread adil gourinda
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@python.org> on behalf of 
Michael Lange <klappn...@web.de>
Sent: Monday, March 5, 2018 10:41 PM
To: tkinter-discuss@python.org
Subject: Re: [Tkinter-discuss] configure command

Hi,

On Sun, 4 Mar 2018 23:26:56 +
adil gourinda <rikudou__sen...@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@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


Re: [Tkinter-discuss] configure command

2018-03-05 Thread Mark Roseman
The method “paneconfigure” is not the same as “configure”, so you shouldn’t try 
to shoe-horn it into your diagram. Sure, it behaves similarly, but it’s a 
different command, rather than some ‘magic’ that’s part of regular configure.

I hope you’re using the information in the TkDocs tutorial to guide you in 
terms of translating between languages.

Mark



> On Mar 4, 2018, at 3:26 PM, adil gourinda  wrote:
> 
> 
> 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
> ___
> Tkinter-discuss mailing list
> Tkinter-discuss@python.org 
> https://mail.python.org/mailman/listinfo/tkinter-discuss 
> 
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


Re: [Tkinter-discuss] configure command

2018-03-05 Thread Michael Lange
Hi,

On Sun, 4 Mar 2018 23:26:56 +
adil gourinda  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@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss