ioAddWatch

fnuint ioAddWatch(glib.iochannel.IOChannel channel, int priority, glib.types.IOCondition condition, glib.types.IOFunc func)

Adds the #GIOChannel into the default main loop context with the given priority.

This internally creates a main loop source using [glib.global.ioCreateWatch] and attaches it to the main loop context with [glib.source.Source.attach]. You can do these steps manually if you need greater control.

Parameters

channela #GIOChannel
prioritythe priority of the #GIOChannel source
conditionthe condition to watch for
functhe function to call when the condition is satisfied

Returns

the event source id