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

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



Bo,

Okay, so the load_font is not raising an error, which is a bug,  and could you try modifying CALL_FUNCTION to be USEREVENT+1 ? 45 is the value of K_MINUS. I don't know if that would cause the issue, but if its still throwing an error for 25, then its not a conflict with a key value.

Thank you!

-Tyler

On Tue, May 12, 2009 at 7:43 AM, Bo Jangeborg <bo@xxxxxxxxxxx> wrote:
### 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



--
Visit my blog at http://oddco.ca/zeroth/zblog