[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] BUG, Userevents disapears in pygame 1.9



### Font error first.

fullname = C:\Projekt\eclipse\Pyos\System\LiberationSans-Regular.ttf
a file that does not exist.

here is the full error trace:

Traceback (most recent call last):
File "C:\Projekt\eclipse\Pyos\System\DB_Edit\db_edit.pyw", line 1338, in <module>
   main()
File "C:\Projekt\eclipse\Pyos\System\DB_Edit\db_edit.pyw", line 60, in main
   standalone=True)
File "C:\Projekt\eclipse\Pyos\System\DB_Edit\db_edit.pyw", line 101, in __init__
   height_max = 20
 File "C:\Projekt\eclipse\Pyos\System\widgets.py", line 7660, in __init__
   alpha, align, flags, **extra_attributes)
 File "C:\Projekt\eclipse\Pyos\System\widgets.py", line 4401, in __init__
   self.font = get_font(self, font)
 File "C:\Projekt\eclipse\Pyos\System\widgets.py", line 4870, in get_font
   fontobj = _Fontcache(parent.gui, font, parent.app.get_source_path())
 File "C:\Projekt\eclipse\Pyos\System\widgets.py", line 4904, in __init__
   self.font_object = self.load_font(font_path)
 File "C:\Projekt\eclipse\Pyos\System\widgets.py", line 4921, in load_font
   font_object = pygame.font.Font(fullname, self.size)
RuntimeError: Can't seek in stream


### Event error

I added  "print CALL_FUNCTION, eventdata" to your output
and I changed your second print to events2

and the combined output was this:

[]
[]
45 {'item': ('Table view', <bound method DbEditor.set_table_view of <__main__.DbEditor instance at 0x02E7E030>>, None, 'Ctrl-T'), 'gui': <System.widgets.Gui instance at 0x024C4BE8>, 'hit_pos': (18, 3), 'over_widget': <System.widgets.MenuItem instance at 0x084EB5D0>}

In other words the event  disappears without a trace.
Bo)

Tyler Laing skrev:
Well, to the first bug, could we please see the exact text of the RuntimeError versus the IOError? The runtime error could be related to processing the font file, if the font loader didn't throw an error that there was no file.

The second bug, can you please show what the output of this code does?:

pygame.event.clear()
pygame.event.post(pygame.event.Event(CALL_FUNCTION,  event_data))
events = pygame.event.get()
print events
events2 = pygame.event.get(CALL_FUNCTION)
print events