An error is a special kind of response that is used when an error occured. It will be “packed into” a Python exception in Error.set().
raise the right exception for the ooxcb.libxcb.xcb_generic_error_t struct err if it is an error.
| Parameter: | err – a ctypes pointer to a ooxcb.libxcb.xcb_generic_error_t. |
|---|
An event is a special kind of response. And in ooxcb, it comes with a builtin ability to be dispatched.
For that purpose, every Event subclass has an event_name member. That’s the name of the event, e.g. ‘on_configure_notify’. It is ‘on_event’ as fallback here, so if you stumble upon ‘on_event’ somewhere, there is something wrong.
So, if you want to dispatch an event, just call dispatch(). A typical line in the main loop would then be:
conn.wait_for_event().dispatch()
which will automatically dispatch every received event.
Every event will be dispatched to an appropriate target, e.g. a ooxcb.xproto.ButtonPressEvent will be dispatched to the window the event happened in. The targets are defined in the interface files. The fallback target is the connection.
If you want to know which event types a class receives, you can access the event_types attribute that is a list of event names.
If you want to know the event target of an event, you can access its event_target attribute.
Every event is sent with the event itself as the first and only argument. So all ooxcb event handlers have the following signature:
def on_blabla(evt)
Base class for all protocol objects.
None as default, but it can be a classmethod used to create a Protobj instance lazily for convenience.
| See: | ooxcb.builder.build_list() |
|---|
None as default, but if it can be a method used to pythonize a protocol object lazily if it’s inside a list.
| See: | ooxcb.list.List |
|---|
| Parameter: | address – an int pointing to the data in the memory |
|---|
| Parameter: | stream – a stream-like object to read from. |
|---|
Placeholder for subclasses. :param stream: an object providing a buffer interface. Read
myself from that stream!