Method

TermboxTerminalcreate_event_source

Declaration

GSource*
tbg_terminal_create_event_source (
  TbgTerminal* self
  GError** error
)

Description

Create a GSource that integrates termbox events with a GMainContext.

The source watches termbox’s terminal and resize file descriptors. When the source is dispatched, it reads all currently available events and emits the corresponding TbgTerminal signals. Attach the returned source with g_source_attach(). The source should be attached to a main-thread GMainContext; termbox-glib does not serialize calls into termbox2 from multiple threads.

Return value

Type: GSource

A new GSource, or NULL on error.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.
The return value can be NULL.