The PMW Notebook Widget - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: GUI (https://python-forum.io/forum-10.html) +--- Thread: The PMW Notebook Widget (/thread-18715.html) |
The PMW Notebook Widget - MattSA - May-28-2019 I am working in Python 3.7.3. I am trying to make use of the Pmw Notebook widget. When I try to declare a widget of this type it returns the following error: I opened the Pmw.Color class module and replaced the following code:return ( '#%04x%04x%04x' % (lightRGB[0], lightRGB[1], lightRGB[2]), '#%04x%04x%04x' % (darkRGB[0], darkRGB[1], darkRGB[2]) )with: return ( '#%04x%04x%04x' % (int(lightRGB[0]), int(lightRGB[1]), int(lightRGB[2])), '#%04x%04x%04x' % (int(darkRGB[0]), int(darkRGB[1]), int(darkRGB[2])) )By casting the RGB color components to int the widget works. However, I am worried about deployment. Users of my application will be using the original Pmw.Color class. Have I overworked the problem? Is there an easier solution? Matthew RE: The PMW Notebook Widget - Yoriz - May-28-2019 What is Pmw, is it compatible with Python 3.7.3, what is the code you are running, can you pass in integers instead of floats in your code. RE: The PMW Notebook Widget - MattSA - May-28-2019 Pmw referring to python mega widget. When I try to declare a widget of this type it throws the above error. I copied and pasted a number of examples from the web and they threw the same error. From the output error, I opened the pmw.Color module in the Python installation directory and changed the erroneous line with the cast statements, and the widget now appears on the screen. I am hoping there is a top-level fix (basic code, rather than changing the pmw module code)to this problem. Here is my code: import tkinter as tk import tkinter.ttk as ttk import Pmw as pmw root = tk.Tk() root.geometry("800x600") pmw.initialise() notebook = pmw.NoteBook(root) notebook.pack(side='top', anchor='w', padx=50, pady=50) root.mainloop()Which produces the following error:
RE: The PMW Notebook Widget - Yoriz - May-28-2019 https://sourceforge.net/p/pmw/bugs/51/ Wrote:Pmw.Color.bordercolors() fails in Python 3. It seems to be assuming integer division. The clearest demonstration is to invoke directly or run a Notebook demo. RE: The PMW Notebook Widget - MattSA - May-29-2019 How would I do so (invoke directly)? What would the declaration look like? RE: The PMW Notebook Widget - MattSA - Jun-03-2019 Sorry about last post. I did not see the patch at the end of Thomas' post. I went to SourceForge and downloaded fix. I do not know how to run it, and did not want to set up a new account just to ask. Can you please tell me how to open the downloaded file, or install? Thanks, MattSA RE: The PMW Notebook Widget - Larz60+ - Jun-03-2019 Here's a calculator done using pmw and tkinter. The post below shows what the GUI looks like https://python-forum.io/Thread-Tkinter-VS-PyQt?pid=675#pid675 |