Python Forum
The PMW Notebook Widget
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The PMW Notebook Widget
#1
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:
Error:
Traceback (most recent call last): File "E:\WORK_SPACE\NoteBook_Tester.py", line 26, in <module> nb = pmw.NoteBook(root) File "C:\Users\matta\AppData\Local\Programs\Python\Python37-32\lib\site-packages\Pmw\Pmw_2_0_1\lib\PmwNoteBook.py", line 60, in __init__ Pmw.Color.bordercolors(self, self['hull_background']) File "C:\Users\matta\AppData\Local\Programs\Python\Python37-32\lib\site-packages\Pmw\Pmw_2_0_1\lib\PmwColor.py", line 364, in bordercolors '#%04x%04x%04x' % (lightRGB[0], lightRGB[1], lightRGB[2]), TypeError: %x format: an integer is required, not float
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
Reply


Messages In This Thread
The PMW Notebook Widget - by MattSA - May-28-2019, 05:01 PM
RE: The PMW Notebook Widget - by Yoriz - May-28-2019, 06:07 PM
RE: The PMW Notebook Widget - by MattSA - May-28-2019, 07:54 PM
RE: The PMW Notebook Widget - by Yoriz - May-28-2019, 08:50 PM
RE: The PMW Notebook Widget - by MattSA - May-29-2019, 04:08 PM
RE: The PMW Notebook Widget - by MattSA - Jun-03-2019, 05:05 PM
RE: The PMW Notebook Widget - by Larz60+ - Jun-03-2019, 07:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Adding New TAB to NoteBook Widget by Clicking Vicolas 0 2,582 Feb-15-2019, 06:03 PM
Last Post: Vicolas

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020