Function

GObject-2.0GObjectsignal_handlers_block_matched

  • Blocks all handlers on an instance that match certain selection criteria. The criteria are passed as properties of a match object. The match object has to have at least func for successful matches. If no handlers were found, 0 is returned, the number of blocked handlers otherwise.

    Parameters

    • instance: GObject.Object

      the instance owning the signal handler to be found.

    • match: { detail: string; func: (...args: any[]) => any; signalId: string }

      a properties object indicating whether to match by signal ID, detail, or callback function.

      • detail: string

        signal detail the handler has to be connected to.

      • func: (...args: any[]) => any

        the callback function the handler will invoke.

      • signalId: string

        signal the handler has to be connected to.

    Returns number

    The number of handlers that matched.

  • Blocks all handlers on an instance that match a certain selection criteria.

    The criteria mask is passed as a combination of GObject.SignalMatchType flags, and the criteria values are passed as arguments. A handler must match on all flags set in mask to be blocked (i.e. the match is conjunctive).

    Passing at least one of the GObject.SignalMatchType.ID, GObject.SignalMatchType.CLOSURE, GObject.SignalMatchType.FUNC or GObject.SignalMatchType.DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of blocked handlers otherwise.

    Support for GObject.SignalMatchType.ID was added in GLib 2.78.

    Parameters

    • instance: GObject.Object

      The instance to block handlers from.

    • mask: SignalMatchType

      Mask indicating which of signal_id, detail, closure, func and/or data the handlers have to match.

    • signal_id: number

      Signal the handlers have to be connected to.

    • detail: number

      Signal detail the handlers have to be connected to.

    • Optionalclosure: Closure<any, any>

      The closure the handlers will invoke.

    • Optionalfunc: any

      The C closure callback of the handlers (useless for non-C closures).

    • Optionaldata: any

      The closure data of the handlers' closures.

    Returns number

    The number of handlers that matched.