May-28-2019, 05:01 PM
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:
Matthew
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