From robert at greschke.com Tue Nov 12 15:09:36 2019 From: robert at greschke.com (Robert Greschke) Date: Tue, 12 Nov 2019 13:09:36 -0700 Subject: [Tkinter-discuss] Tkinter to Qt-whatever Message-ID: So pigs have started sprouting wings and I guess "we" (work) are going to start shifting to Qt/PySide2/whatever. I've been playing around for a few weeks and what a mess compared to Tkinter. Does anyone know/think something like Qt-based classes could be written that are called just like and act just like Tkinter Button()s/Frame()s/Entry()s/etc. but spit out Qt widgets? I've got tens of thousands of lines of just Tkinter code (in hundreds of thousands of lines of Python code), that I probably won't HAVE to rewrite, but something like that would be pretty spiffy for running the old stuff and for writing new stuff. Maybe someone will come to their senses and well go back to Tkinter. :) There is nothing Qt widgets do that I need beyond the Tkinter basics...if I can figure out how to even do that stuff. I know some functions may not work out, but it could be worth a try, and either way I guess I'd get to know Qt better. Thanks! Bob From robert at greschke.com Wed Nov 13 12:11:24 2019 From: robert at greschke.com (Robert Greschke) Date: Wed, 13 Nov 2019 10:11:24 -0700 Subject: [Tkinter-discuss] Tkinter to Qt-whatever In-Reply-To: References: Message-ID: <511E8E75-DD2F-4FA0-8319-85A66217B406@greschke.com> Hi! I saw that, but didn't take a look at it. Did I even get a choice? Hmm. I'll look and see if it can handle me. The trigger for all of this was the way things Tkinter look/feel in macOS. I guess I should give tix/ttk stuff a look, again, too. Our stuff doesn't need to look native, but consistent (Linux/Mac/Win) would be nice. The default Linux look is even the same as it was when stuff was still running on SunOS. Everything is generally "big and clunky" which is really nice for field work. No finesse required when the Sun is in your eyes and the wind chill factor is 0F. I've looked at a bunch of documentation online for Qt stuff, got three books, and all of it is just PyDoc quality and 'Hello World' stuff. "...setIconSize(): This sets the icon size of the toolbar icons for this main window." No!! Never would have guessed that. I sleep with Grayson's book to keep anything from happening to it. :) Other than just the standard .config() things I haven't needed to really mess with widgets. Color, padding, maybe the width of the scrollbars (they got really narrow on some macOS versions), etc. A bit of Canvas drawing. Rewriting would be OK if there is even less writing! These are things Tkinter has been fine for: www.passcal.nmt.edu/~bob/passcal/software/index.html It would just be more of the same from here on. Thanks! Bob > On 2019-11-13, at 09:14, Mike Barnett wrote: > > Hi there > > Take a look at PySimpleGUI (http://www.PySimpleGUI.org) > > With it you can write your code once and then easily move between tkinter, Qt, WxPython and Remi (runs in browser). > > Sometimes the only change needed is to the import statement. Other times only slight changes are needed. > > If you're using only the basic kinds of Widgets and aren't getting overly fancy with styles (aren't changing things like scrollbars down deep inside tkinter), then moving across the GUI frameworks is pretty easy. > > A number of the "Demo Programs" found on the GitHub run on multiple GUI frameworks by only changing the import. The OpenCV ones are great examples of this. > > But you will be required to "rewrite" your tkinter code. PySimpleGUI code is up to 10x shorter than tkinter code so it could happen a lot quicker than you think. > > TONS of documentation is available. The Cookbook is being updated daily at the moment and you can run a bunch of sample code on Trinket (https://pysimplegui.trinket.io/demo-programs). > > It is certainly worth a look. > > -mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert at greschke.com Wed Nov 13 12:52:37 2019 From: robert at greschke.com (Robert Greschke) Date: Wed, 13 Nov 2019 10:52:37 -0700 Subject: [Tkinter-discuss] Tkinter to Qt-whatever In-Reply-To: References: <511E8E75-DD2F-4FA0-8319-85A66217B406@greschke.com> Message-ID: <1FC080F1-4FAB-4BDD-AA39-407CAAC1A854@greschke.com> > On 2019-11-13, at 10:16, Mike Barnett wrote: > > Ohhhh?.. on a Mac? yea, not a good combination with tkinter from my experience. It works great if you compile your own Python and link to an included standard Tcl/Tk. We've been doing that since we started using Macs. 12, 15 years? It looks and works just like the normal/standard Linux or Windows installations. But "they" don't want to do that anymore. Someone may have figured out a workaround in Anaconda, but that's a whole other bag of worms. > > Most Mac users of PySimpleGUI are using PySimpleGUIQt because of this. > > PySimpleGUI may very well not have the ?Depth? you need. Because the APIs are meant to be portable across multiple GUI frameworks, things like Toolbars are something users need to create on their own, at least for now. Yeah, we'll see. I don't even use things as "fancy" as Toolbars, but I may change the look of things a bit too much, or maybe not. > > Simple? that?s the main focus of PySimpleGUI? to keep things simple, especially for the developer. No need to write 40 lines of code when 4 will work just as well. > > PySimpleGUI is extendable. There is a section in the documentation about accessing the underlying ?Widgets?. Each PySimpleGUI Element tends to map 1 to 1 with a GUI Framework?s Widget. This gives advanced developers access to changing more detailed settings for a Widget. It?s not, however, meant to be how the normal programming of PySimpleGUI is done. Cool. Hope I can get to it today. Thanks! > > > > From: Robert Greschke > > Sent: Wednesday, November 13, 2019 12:11 PM > To: Mike Barnett > > Cc: Python-Tkinter > > Subject: Re: [Tkinter-discuss] Tkinter to Qt-whatever > > Hi! > > I saw that, but didn't take a look at it. Did I even get a choice? Hmm. I'll look and see if it can handle me. The trigger for all of this was the way things Tkinter look/feel in macOS. I guess I should give tix/ttk stuff a look, again, too. Our stuff doesn't need to look native, but consistent (Linux/Mac/Win) would be nice. The default Linux look is even the same as it was when stuff was still running on SunOS. Everything is generally "big and clunky" which is really nice for field work. No finesse required when the Sun is in your eyes and the wind chill factor is 0F. > > I've looked at a bunch of documentation online for Qt stuff, got three books, and all of it is just PyDoc quality and 'Hello World' stuff. "...setIconSize(): This sets the icon size of the toolbar icons for this main window." No!! Never would have guessed that. I sleep with Grayson's book to keep anything from happening to it. :) > > Other than just the standard .config() things I haven't needed to really mess with widgets. Color, padding, maybe the width of the scrollbars (they got really narrow on some macOS versions), etc. A bit of Canvas drawing. Rewriting would be OK if there is even less writing! > > These are things Tkinter has been fine for: > > www.passcal.nmt.edu/~bob/passcal/software/index.html > > It would just be more of the same from here on. > > Thanks! > > Bob > > > On 2019-11-13, at 09:14, Mike Barnett > wrote: > > Hi there > > Take a look at PySimpleGUI (http://www.PySimpleGUI.org ) > > With it you can write your code once and then easily move between tkinter, Qt, WxPython and Remi (runs in browser). > > Sometimes the only change needed is to the import statement. Other times only slight changes are needed. > > If you're using only the basic kinds of Widgets and aren't getting overly fancy with styles (aren't changing things like scrollbars down deep inside tkinter), then moving across the GUI frameworks is pretty easy. > > A number of the "Demo Programs" found on the GitHub run on multiple GUI frameworks by only changing the import. The OpenCV ones are great examples of this. > > But you will be required to "rewrite" your tkinter code. PySimpleGUI code is up to 10x shorter than tkinter code so it could happen a lot quicker than you think. > > TONS of documentation is available. The Cookbook is being updated daily at the moment and you can run a bunch of sample code on Trinket (https://pysimplegui.trinket.io/demo-programs ). > > It is certainly worth a look. > > -mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at markroseman.com Wed Nov 13 20:27:45 2019 From: mark at markroseman.com (Mark Roseman) Date: Wed, 13 Nov 2019 17:27:45 -0800 Subject: [Tkinter-discuss] Tkinter to Qt-whatever In-Reply-To: References: Message-ID: Hi Bob, You really should look at the ttk stuff, it?s the easiest migration path to quite decent looking GUI?s. As you note, the ?classic? widgets haven?t changed at all in decades. So without the (minimal) API changes to use the ttk widgets, you?re stuck in the deep past. (Also, please ignore Tix if you?re looking for improvements in UI) Have a quick look at the tutorial on my site www.tkdocs.com to get a sense of what?s involved. The last chapter of the tutorial is a case study on modernizing Python?s IDLE, if you?re looking for some before and after.. Mark > On Nov 12, 2019, at 12:09 PM, Robert Greschke wrote: > > So pigs have started sprouting wings and I guess "we" (work) are going to start shifting to Qt/PySide2/whatever. I've been playing around for a few weeks and what a mess compared to Tkinter. Does anyone know/think something like Qt-based classes could be written that are called just like and act just like Tkinter Button()s/Frame()s/Entry()s/etc. but spit out Qt widgets? I've got tens of thousands of lines of just Tkinter code (in hundreds of thousands of lines of Python code), that I probably won't HAVE to rewrite, but something like that would be pretty spiffy for running the old stuff and for writing new stuff. Maybe someone will come to their senses and well go back to Tkinter. :) There is nothing Qt widgets do that I need beyond the Tkinter basics...if I can figure out how to even do that stuff. I know some functions may not work out, but it could be worth a try, and either way I guess I'd get to know Qt better. > > Thanks! > > Bob > > _______________________________________________ > 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: From bryan.oakley at gmail.com Thu Nov 14 10:44:10 2019 From: bryan.oakley at gmail.com (Bryan Oakley) Date: Thu, 14 Nov 2019 09:44:10 -0600 Subject: [Tkinter-discuss] Tkinter to Qt-whatever In-Reply-To: References: Message-ID: tkdocs.com is a real gem! You've done a masterful job of explaining tk and tkinter, and it is by far the best documentation on how to use and configure ttk. In fact, I was visiting there today to re-remind myself about how ttk layouts work. On Wed, Nov 13, 2019 at 8:20 PM Mark Roseman wrote: > Hi Bob, > > You really should look at the ttk stuff, it?s the easiest migration path > to quite decent looking GUI?s. As you note, the ?classic? widgets haven?t > changed at all in decades. So without the (minimal) API changes to use the > ttk widgets, you?re stuck in the deep past. (Also, please ignore Tix if > you?re looking for improvements in UI) > > Have a quick look at the tutorial on my site www.tkdocs.com to get a > sense of what?s involved. The last chapter of the tutorial is a case study > on modernizing Python?s IDLE, if you?re looking for some before and after.. > > Mark > > > On Nov 12, 2019, at 12:09 PM, Robert Greschke wrote: > > So pigs have started sprouting wings and I guess "we" (work) are going to > start shifting to Qt/PySide2/whatever. I've been playing around for a few > weeks and what a mess compared to Tkinter. Does anyone know/think something > like Qt-based classes could be written that are called just like and act > just like Tkinter Button()s/Frame()s/Entry()s/etc. but spit out Qt widgets? > I've got tens of thousands of lines of just Tkinter code (in hundreds of > thousands of lines of Python code), that I probably won't HAVE to rewrite, > but something like that would be pretty spiffy for running the old stuff > and for writing new stuff. Maybe someone will come to their senses and well > go back to Tkinter. :) There is nothing Qt widgets do that I need beyond > the Tkinter basics...if I can figure out how to even do that stuff. I know > some functions may not work out, but it could be worth a try, and either > way I guess I'd get to know Qt better. > > Thanks! > > Bob > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss > > > _______________________________________________ > 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: From robert at greschke.com Thu Nov 14 17:40:22 2019 From: robert at greschke.com (Robert Greschke) Date: Thu, 14 Nov 2019 15:40:22 -0700 Subject: [Tkinter-discuss] Tkinter to Qt-whatever In-Reply-To: References: Message-ID: <3C8CD75B-095F-4227-9675-02D23D3C43EF@greschke.com> Your tkdoc tutorial: Ohhhh! I've never seen things explained this way before. Somehow I thought you always had to go through the style-thing even if you didn't want to change anything. For background colors and stuff, fine, but most of the time you just need the default things. I wonder why things like "bg=" are not in there? I would think that would be easy. Just an addition to the class same as a "length=". I picked up two non-ttk things I didn't know just from the first 'calculate' example! I think I'll tell them they can do pressure-involved things with Qt or fire me. This makes way more sense. I don't mind the classic look, in fact it's a little better for users -- the look and feel is the same everywhere -- but on macOS it all just falls apart. We've always had a self-compiled Python package with everything our programs needed, including decent classic Tkinter widgets on Macs, but management is getting lazy and they don't want to do that anymore. We're academia, so things don't have to make sense. Ordered the book! I like books. Thanks a bunch! > On 2019-11-13, at 18:27, Mark Roseman wrote: > > Hi Bob, > > You really should look at the ttk stuff, it?s the easiest migration path to quite decent looking GUI?s. As you note, the ?classic? widgets haven?t changed at all in decades. So without the (minimal) API changes to use the ttk widgets, you?re stuck in the deep past. (Also, please ignore Tix if you?re looking for improvements in UI) > > Have a quick look at the tutorial on my site www.tkdocs.com to get a sense of what?s involved. The last chapter of the tutorial is a case study on modernizing Python?s IDLE, if you?re looking for some before and after.. > > Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert at greschke.com Thu Nov 14 17:45:01 2019 From: robert at greschke.com (Robert Greschke) Date: Thu, 14 Nov 2019 15:45:01 -0700 Subject: [Tkinter-discuss] Tkinter to Qt-whatever In-Reply-To: References: Message-ID: <74539A51-1BE9-466F-9564-B1723953EE75@greschke.com> I think I'm going to look into ttk first. It - Tkinter - just makes way more sense to me. I can put all of the code 'together', instead of spreading it out over a ton of classes. I don't write a lot of classes. I'm more procedural in the way I program. On top of that Qt does WAY more than I need and just figuring out all of the different methods just to do simple things was taking forever. Tkinter has handled everything I've done. I may have to go back to Qt. You never know. Thanks! > On 2019-11-14, at 04:37, Abdur-Rahmaan Janhangeer wrote: > > Me i recently switched away from tkinter to pyside2/pyqt5. I feel like Ui becomes a breeze + you can use qt designer. > > My main issue with tkinter is that programming could have been simpler in it. You want tabs? bang that's another type of widgets. In pyside2 you learn then it goes fast, really fast. You own custom widget is a lot simpler. You can go really far in terms of ui. In tkinter, beyond basics, it's good luck. I forgot to mention occasional not bugs but bites, things that you have to understand what tkinter is doing concerning references. > > Take the tkinter canvas for example. It does not have opacity control for colouring shapes. I mean, in Js Java etc those are basics. The canvas is most incomplete. > > I am for the complete removal of tkinter if a suitable alternative is found. I lost a lot of time mastering tkinter which could have been used to build nice things! > > Abdur-Rahmaan Janhangeer > http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ > Mauritius -------------- next part -------------- An HTML attachment was scrubbed... URL: From arj.python at gmail.com Thu Nov 14 06:37:09 2019 From: arj.python at gmail.com (Abdur-Rahmaan Janhangeer) Date: Thu, 14 Nov 2019 15:37:09 +0400 Subject: [Tkinter-discuss] Tkinter to Qt-whatever In-Reply-To: References: Message-ID: Me i recently switched away from tkinter to pyside2/pyqt5. I feel like Ui becomes a breeze + you can use qt designer. My main issue with tkinter is that programming could have been simpler in it. You want tabs? bang that's another type of widgets. In pyside2 you learn then it goes fast, really fast. You own custom widget is a lot simpler. You can go really far in terms of ui. In tkinter, beyond basics, it's good luck. I forgot to mention occasional not bugs but bites, things that you have to understand what tkinter is doing concerning references. Take the tkinter canvas for example. It does not have opacity control for colouring shapes. I mean, in Js Java etc those are basics. The canvas is most incomplete. I am for the complete removal of tkinter if a suitable alternative is found. I lost a lot of time mastering tkinter which could have been used to build nice things! Abdur-Rahmaan Janhangeer http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ Mauritius -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike_barnett at hotmail.com Wed Nov 20 21:37:01 2019 From: mike_barnett at hotmail.com (Mike Barnett) Date: Thu, 21 Nov 2019 02:37:01 +0000 Subject: [Tkinter-discuss] ttk styles - is it possible to have one per widget? Message-ID: I have come back to this problem several times and have asked friends for help, but I never seem to crack this nut. What I am trying to do is "style" ttk widgets in a way that each one can have their own unique settings. I've not found code or pseudo-code that does what I'm looking for. Is it possible for ttk widgets to work like tk widgets in that each can have their own unique settings like background color, text color, etc? Any code or pointers to pages with some code that I can lift would be awesome as I can't seem to write my own that works. Happy to share the kinds of things I've tried if it would help. Thank you for your time -mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike_barnett at hotmail.com Fri Nov 22 11:00:07 2019 From: mike_barnett at hotmail.com (Mike Barnett) Date: Fri, 22 Nov 2019 16:00:07 +0000 Subject: [Tkinter-discuss] ttk styles - is it possible to have one per widget? In-Reply-To: References: Message-ID: Hmmm... I didn't see am email go out for this. Did anyone get this email? From: Mike Barnett Sent: Wednesday, November 20, 2019 9:37 PM To: Python-Tkinter Subject: ttk styles - is it possible to have one per widget? I have come back to this problem several times and have asked friends for help, but I never seem to crack this nut. What I am trying to do is "style" ttk widgets in a way that each one can have their own unique settings. I've not found code or pseudo-code that does what I'm looking for. Is it possible for ttk widgets to work like tk widgets in that each can have their own unique settings like background color, text color, etc? Any code or pointers to pages with some code that I can lift would be awesome as I can't seem to write my own that works. Happy to share the kinds of things I've tried if it would help. Thank you for your time -mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From klappnase at web.de Sat Nov 23 12:02:07 2019 From: klappnase at web.de (Michael Lange) Date: Sat, 23 Nov 2019 18:02:07 +0100 Subject: [Tkinter-discuss] ttk styles - is it possible to have one per widget? In-Reply-To: References: Message-ID: <20191123180207.eee06f245909f8c4b50558f6@web.de> Hi, On Fri, 22 Nov 2019 16:00:07 +0000 Mike Barnett wrote: > Hmmm... I didn't see am email go out for this. Did anyone get this > email? > sure :) > What I am trying to do is "style" ttk widgets in a way that each one > can have their own unique settings. I've not found code or pseudo-code > that does what I'm looking for. > > Is it possible for ttk widgets to work like tk widgets in that each can > have their own unique settings like background color, text color, etc? You can do this by defining custom styles that inherit their properties from the widget's default style and set some or other properties to custom values, as for example: from tkinter import * from tkinter import ttk root=Tk() style = ttk.Style() style.configure('my.TButton', background='red') style.configure('myOther.TButton', background='blue') ttk.Button(root, style='my.TButton', text='foo').pack() ttk.Button(root, style='myOther.TButton', text='bar').pack() root.mainloop() I hope this helps Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. The games have always strengthened us. Death becomes a familiar pattern. We don't fear it as you do. -- Proconsul Marcus Claudius, "Bread and Circuses", stardate 4041.2 From Vasilis.Vlachoudis at cern.ch Thu Nov 28 07:59:32 2019 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Thu, 28 Nov 2019 12:59:32 +0000 Subject: [Tkinter-discuss] busy mouse cursor for application Message-ID: <0BC70B5D93E054469872FFD0FE07220E02D872DA37@CERNXCHG53.cern.ch> Hi all, how can I display the cursor as the watch for the whole application. When I set it on the toplevel window as self.toplevel.config(cursor="watch") it displays the cursor almost everywhere (I believe where the cursor is "") except for the widgets like Entry, Text that have the cursor="xterm" or anything that has a custom cursor. Is there a way to set the "watch" for everything and restore it later on Vasilis From emilianogavilan at gmail.com Thu Nov 28 09:55:07 2019 From: emilianogavilan at gmail.com (E) Date: Thu, 28 Nov 2019 11:55:07 -0300 Subject: [Tkinter-discuss] busy mouse cursor for application In-Reply-To: <0BC70B5D93E054469872FFD0FE07220E02D872DA37@CERNXCHG53.cern.ch> References: <0BC70B5D93E054469872FFD0FE07220E02D872DA37@CERNXCHG53.cern.ch> Message-ID: <16c7fb92-6775-fa55-5662-ad16c2907055@gmail.com> El 28/11/2019 a las 09:59 a. m., Vasilis Vlachoudis escribi?: > Hi all, > > how can I display the cursor as the watch for the whole application. > When I set it on the toplevel window as > self.toplevel.config(cursor="watch") > it displays the cursor almost everywhere (I believe where the cursor is "") > except for the widgets like Entry, Text that have the cursor="xterm" or anything > that has a custom cursor. > > Is there a way to set the "watch" for everything and restore it later on Tk provides the command "tk busy" [1] which does what you want, but as far as I can see tkinter still doesn't ship it wrapped [2]. You can steal ideas from the links below. Also note this text in the manual page: """ PORTABILITY Note that the tk busy command does not currently have any effect on OSX when Tk is built using Aqua support. """ [1] https://www.tcl-lang.org/man/tcl8.6/TkCmd/busy.htm [2] https://bugs.python.org/issue28498 Regards Emiliano From Vasilis.Vlachoudis at cern.ch Thu Nov 28 10:18:27 2019 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Thu, 28 Nov 2019 15:18:27 +0000 Subject: [Tkinter-discuss] busy mouse cursor for application In-Reply-To: <16c7fb92-6775-fa55-5662-ad16c2907055@gmail.com> References: <0BC70B5D93E054469872FFD0FE07220E02D872DA37@CERNXCHG53.cern.ch>, <16c7fb92-6775-fa55-5662-ad16c2907055@gmail.com> Message-ID: <0BC70B5D93E054469872FFD0FE07220E02D872DB6F@CERNXCHG53.cern.ch> Many thanks! I was just about to implement the pointer from Roberto G. to https://effbot.org/zone/tkinter-busy.htm but apparently a call to the tk busy is far easier I am just doing on the toplevel window def busy(self): self.tk.call("tk","busy","hold",self) def notbusy(self): self.tk.call("tk","busy","forget",self) and works beautifully! Vasilis ________________________________________ From: Tkinter-discuss [tkinter-discuss-bounces+vasilis.vlachoudis=cern.ch at python.org] on behalf of E [emilianogavilan at gmail.com] Sent: Thursday, November 28, 2019 15:55 To: tkinter-discuss at python.org Subject: Re: [Tkinter-discuss] busy mouse cursor for application El 28/11/2019 a las 09:59 a. m., Vasilis Vlachoudis escribi?: > Hi all, > > how can I display the cursor as the watch for the whole application. > When I set it on the toplevel window as > self.toplevel.config(cursor="watch") > it displays the cursor almost everywhere (I believe where the cursor is "") > except for the widgets like Entry, Text that have the cursor="xterm" or anything > that has a custom cursor. > > Is there a way to set the "watch" for everything and restore it later on Tk provides the command "tk busy" [1] which does what you want, but as far as I can see tkinter still doesn't ship it wrapped [2]. You can steal ideas from the links below. Also note this text in the manual page: """ PORTABILITY Note that the tk busy command does not currently have any effect on OSX when Tk is built using Aqua support. """ [1] https://www.tcl-lang.org/man/tcl8.6/TkCmd/busy.htm [2] https://bugs.python.org/issue28498 Regards Emiliano _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org https://mail.python.org/mailman/listinfo/tkinter-discuss From Vasilis.Vlachoudis at cern.ch Sat Nov 30 08:52:11 2019 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Sat, 30 Nov 2019 13:52:11 +0000 Subject: [Tkinter-discuss] tkinter.PhotoImage to PIL.Image Message-ID: <0BC70B5D93E054469872FFD0FE07220E02E3729C24@CERNXCHG54.cern.ch> Hi all, I have several images loaded as tkinter.PhotoImage, I want some to resize them The PhotoImage zoom accepts only integer values and the result is not that great. While if load them with PIL resize them and then convert to PIL.ImageTk it is much better. I found several references on how to convert from PIL to tkinter but I cannot find how to do the opposite so I can use the PIL resizing with the existing tkinter images. Many thanks Vasilis