Re: [Tkinter-discuss] tcl/tk's syntax to python's syntax
23.10.17 12:27, Michael Lange пише: Actually the widgets' names (as "b" and "f" in the above example) go to the widget's "name" option in Python, which is hardly ever used though (in Tkinter we usually let Python assign the widget names automatically which leads to something that looks like ".1234567890.1234567891" instead of ".f.b"). In Python 3.6 automatically assigned names look more human-readable, e.g. ".!frame2.!button5". ___ Tkinter-discuss mailing list Tkinter-discuss@python.org https://mail.python.org/mailman/listinfo/tkinter-discuss
Re: [Tkinter-discuss] tcl/tk's syntax to python's syntax
Tkinter is the standard GUI for python but there is no official Tkinter's documentation so I am obliged to read from Tcl/Tk reference ( http:// tmml.sourceforge.net<http://tmml.sourceforge.net> /doc/ tk / index.html<http://index.html>), To make Tcl/Tk syntax EASY TO READ for pythonic programmers I made those diagrams, My purpose is so simple. From: Tkinter-discuss on behalf of Rob Ward Sent: Monday, October 30, 2017 3:35:45 AM To: tkinter-discuss@python.org Subject: Re: [Tkinter-discuss] tcl/tk's syntax to python's syntax Unfortunately I am not an expert, so my feed back is extremely limited, however I can see value in what you are doing. I have been designing a simple PCB designer to drive my CNC machine. It is Python 3 and uses the tkinter library. I am making good progress but find the syntax for the GUI elements somewhat "taxing" as it makes the setting up the components feel like a dog's dinner. Different, but related functions, don't feel logical. Given the amount required for even a simple GUI any rationalisation of the syntax that helps understand their interdependence would be good. I hope I have understood your intentions. Cheers, RobW On 27 October 2017 8:24:41 pm AEDT, adil gourinda wrote: Hy I am asking your opinion about the last diagram, I want to solve the pathname problem with it. From: Tkinter-discuss on behalf of Michael Lange Sent: Monday, October 23, 2017 10:27:19 AM To: tkinter-discuss@python.org Subject: Re: [Tkinter-discuss] tcl/tk's syntax to python's syntax Hi, On Sun, 22 Oct 2017 21:11:48 + adil gourinda wrote: > With the aim to make translation of tcl/tk's syntax to python's syntax > more easy I made this flowchart and I ask you to check it. > > Thanks for your help😊 I think the translation of the Tk pathName is problematic. One thing that might come closer could be ".parentWidget.childWidget" -> "Instance" ".parentWidget" -> "parentWidget" But strictly speaking I think this is not correct either. If the Tk root window is the parent, parentWidget is only "." . If a Frame ".f" is the parent, parent widget *is* ".f" in Tk,and a Button widget "b" that is a child of ".f" in Tk *is* ".f.b". Of course considering this the chart might look a bit pointless, like "parentWidget" -> "parentWidget" Actually the widgets' names (as "b" and "f" in the above example) go to the widget's "name" option in Python, which is hardly ever used though (in Tkinter we usually let Python assign the widget names automatically which leads to something that looks like ".1234567890.1234567891" instead of ".f.b"). I hope this makes some sense, and maybe one of the Tk experts here can provide a better explanation. Best regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. It [being a Vulcan] means to adopt a philosophy, a way of life which is logical and beneficial. We cannot disregard that philosophy merely for personal gain, no matter how important that gain might be. -- Spock, "Journey to Babel", stardate 3842.4 ___ 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] tcl/tk's syntax to python's syntax
Unfortunately I am not an expert, so my feed back is extremely limited, however I can see value in what you are doing. I have been designing a simple PCB designer to drive my CNC machine. It is Python 3 and uses the tkinter library. I am making good progress but find the syntax for the GUI elements somewhat "taxing" as it makes the setting up the components feel like a dog's dinner. Different, but related functions, don't feel logical. Given the amount required for even a simple GUI any rationalisation of the syntax that helps understand their interdependence would be good. I hope I have understood your intentions. Cheers, RobW On 27 October 2017 8:24:41 pm AEDT, adil gourinda wrote: >Hy >I am asking your opinion about the last diagram, I want to solve the >pathname problem with it. > >From: Tkinter-discuss > on behalf >of Michael Lange >Sent: Monday, October 23, 2017 10:27:19 AM >To: tkinter-discuss@python.org >Subject: Re: [Tkinter-discuss] tcl/tk's syntax to python's syntax > >Hi, > >On Sun, 22 Oct 2017 21:11:48 + >adil gourinda wrote: > >> With the aim to make translation of tcl/tk's syntax to python's >syntax >> more easy I made this flowchart and I ask you to check it. >> >> Thanks for your help😊 > >I think the translation of the Tk pathName is problematic. One thing >that >might come closer could be > >".parentWidget.childWidget" -> "Instance" >".parentWidget" -> "parentWidget" > >But strictly speaking I think this is not correct either. If the Tk >root >window is the parent, parentWidget is only "." . If a Frame ".f" is the >parent, parent widget *is* ".f" in Tk,and a Button widget "b" that is a >child of ".f" in Tk *is* ".f.b". Of course considering this the chart >might look a bit pointless, like > >"parentWidget" -> "parentWidget" > >Actually the widgets' names (as "b" and "f" in the above example) go to >the widget's "name" option in Python, which is hardly ever used though >(in Tkinter we usually let Python assign the widget names automatically >which leads to something that looks like ".1234567890.1234567891" >instead >of ".f.b"). > >I hope this makes some sense, and maybe one of the Tk experts here can >provide a better explanation. > >Best regards > >Michael > > >.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . >.-. > >It [being a Vulcan] means to adopt a philosophy, a way of life which is >logical and beneficial. We cannot disregard that philosophy merely for >personal gain, no matter how important that gain might be. >-- Spock, "Journey to Babel", stardate 3842.4 >___ >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] tcl/tk's syntax to python's syntax
Hy I am asking your opinion about the last diagram, I want to solve the pathname problem with it. From: Tkinter-discuss on behalf of Michael Lange Sent: Monday, October 23, 2017 10:27:19 AM To: tkinter-discuss@python.org Subject: Re: [Tkinter-discuss] tcl/tk's syntax to python's syntax Hi, On Sun, 22 Oct 2017 21:11:48 + adil gourinda wrote: > With the aim to make translation of tcl/tk's syntax to python's syntax > more easy I made this flowchart and I ask you to check it. > > Thanks for your help😊 I think the translation of the Tk pathName is problematic. One thing that might come closer could be ".parentWidget.childWidget" -> "Instance" ".parentWidget" -> "parentWidget" But strictly speaking I think this is not correct either. If the Tk root window is the parent, parentWidget is only "." . If a Frame ".f" is the parent, parent widget *is* ".f" in Tk,and a Button widget "b" that is a child of ".f" in Tk *is* ".f.b". Of course considering this the chart might look a bit pointless, like "parentWidget" -> "parentWidget" Actually the widgets' names (as "b" and "f" in the above example) go to the widget's "name" option in Python, which is hardly ever used though (in Tkinter we usually let Python assign the widget names automatically which leads to something that looks like ".1234567890.1234567891" instead of ".f.b"). I hope this makes some sense, and maybe one of the Tk experts here can provide a better explanation. Best regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. It [being a Vulcan] means to adopt a philosophy, a way of life which is logical and beneficial. We cannot disregard that philosophy merely for personal gain, no matter how important that gain might be. -- Spock, "Journey to Babel", stardate 3842.4 ___ 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] tcl/tk's syntax to python's syntax
Hy and sorry for my late response 😊 Yes I agree, The translation of Tk pathName is problematic and I was prepared to hear something about this point 😏 but this is my best. The pathname reflect in addition to the widget's name the hierarchy of the widget's parents, I think by knowing the difference between the Tk and python widget's hierarchy allow a better understanding of the Tk pathName. Combining this image with the last one make thinks more clear. ___ Tkinter-discuss mailing list Tkinter-discuss@python.org https://mail.python.org/mailman/listinfo/tkinter-discuss
Re: [Tkinter-discuss] tcl/tk's syntax to python's syntax
Interesting, I think. On 23 October 2017 8:27:19 pm AEDT, Michael Lange wrote: >Hi, > >On Sun, 22 Oct 2017 21:11:48 + >adil gourinda wrote: > >> With the aim to make translation of tcl/tk's syntax to python's >syntax >> more easy I made this flowchart and I ask you to check it. >> >> Thanks for your help😊 > >I think the translation of the Tk pathName is problematic. One thing >that >might come closer could be > > ".parentWidget.childWidget" -> "Instance" > ".parentWidget" -> "parentWidget" > >But strictly speaking I think this is not correct either. If the Tk >root >window is the parent, parentWidget is only "." . If a Frame ".f" is the >parent, parent widget *is* ".f" in Tk,and a Button widget "b" that is a >child of ".f" in Tk *is* ".f.b". Of course considering this the chart >might look a bit pointless, like > > "parentWidget" -> "parentWidget" > >Actually the widgets' names (as "b" and "f" in the above example) go to >the widget's "name" option in Python, which is hardly ever used though >(in Tkinter we usually let Python assign the widget names automatically >which leads to something that looks like ".1234567890.1234567891" >instead >of ".f.b"). > >I hope this makes some sense, and maybe one of the Tk experts here can >provide a better explanation. > >Best regards > >Michael > > >.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . >.-. > >It [being a Vulcan] means to adopt a philosophy, a way of life which is >logical and beneficial. We cannot disregard that philosophy merely for >personal gain, no matter how important that gain might be. > -- Spock, "Journey to Babel", stardate 3842.4 >___ >Tkinter-discuss mailing list >Tkinter-discuss@python.org >https://mail.python.org/mailman/listinfo/tkinter-discuss -- Sent from my Android device with K-9 Mail. Please excuse my brevity.___ Tkinter-discuss mailing list Tkinter-discuss@python.org https://mail.python.org/mailman/listinfo/tkinter-discuss
Re: [Tkinter-discuss] tcl/tk's syntax to python's syntax
Hi, On Sun, 22 Oct 2017 21:11:48 + adil gourinda wrote: > With the aim to make translation of tcl/tk's syntax to python's syntax > more easy I made this flowchart and I ask you to check it. > > Thanks for your help😊 I think the translation of the Tk pathName is problematic. One thing that might come closer could be ".parentWidget.childWidget" -> "Instance" ".parentWidget" -> "parentWidget" But strictly speaking I think this is not correct either. If the Tk root window is the parent, parentWidget is only "." . If a Frame ".f" is the parent, parent widget *is* ".f" in Tk,and a Button widget "b" that is a child of ".f" in Tk *is* ".f.b". Of course considering this the chart might look a bit pointless, like "parentWidget" -> "parentWidget" Actually the widgets' names (as "b" and "f" in the above example) go to the widget's "name" option in Python, which is hardly ever used though (in Tkinter we usually let Python assign the widget names automatically which leads to something that looks like ".1234567890.1234567891" instead of ".f.b"). I hope this makes some sense, and maybe one of the Tk experts here can provide a better explanation. Best regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. It [being a Vulcan] means to adopt a philosophy, a way of life which is logical and beneficial. We cannot disregard that philosophy merely for personal gain, no matter how important that gain might be. -- Spock, "Journey to Babel", stardate 3842.4 ___ Tkinter-discuss mailing list Tkinter-discuss@python.org https://mail.python.org/mailman/listinfo/tkinter-discuss
[Tkinter-discuss] tcl/tk's syntax to python's syntax
With the aim to make translation of tcl/tk's syntax to python's syntax more easy I made this flowchart and I ask you to check it. Thanks for your help😊 ttk tcl to ttk python.pdf Description: ttk tcl to ttk python.pdf ___ Tkinter-discuss mailing list Tkinter-discuss@python.org https://mail.python.org/mailman/listinfo/tkinter-discuss