.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "IO::Async::Loop::Glib 3pm" .TH IO::Async::Loop::Glib 3pm 2024-02-25 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME "IO::Async::Loop::Glib" \- use "IO::Async" with Glib or GTK .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use IO::Async::Loop::Glib; \& \& my $loop = IO::Async::Loop::Glib\->new(); \& \& $loop\->add( ... ); \& \& ... \& # Rest of GLib/Gtk program that uses GLib \& \& Glib::MainLoop\->new\->run(); .Ve .PP Or .PP .Vb 1 \& $loop\->run; .Ve .PP Or .PP .Vb 3 \& while(1) { \& $loop\->loop_once(); \& } .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This subclass of \f(CW\*(C`IO::Async::Loop\*(C'\fR uses the \f(CW\*(C`Glib::MainLoop\*(C'\fR to perform read-ready and write-ready tests. .PP The appropriate \f(CW\*(C`Glib::IO\*(C'\fR sources are added or removed from the \&\f(CW\*(C`Glib::MainLoop\*(C'\fR when notifiers are added or removed from the set, or when they change their \f(CW\*(C`want_writeready\*(C'\fR status. The callbacks are called automatically by Glib itself; no special methods on this loop object are required. .SH CONSTRUCTOR .IX Header "CONSTRUCTOR" .SS new .IX Subsection "new" .Vb 1 \& $loop = IO::Async::Loop::Glib\->new() .Ve .PP This function returns a new instance of a \f(CW\*(C`IO::Async::Loop::Glib\*(C'\fR object. It takes no special arguments. .SH METHODS .IX Header "METHODS" There are no special methods in this subclass, other than those provided by the \f(CW\*(C`IO::Async::Loop\*(C'\fR base class. .SS loop_once .IX Subsection "loop_once" .Vb 1 \& $loop\->loop_once( $timeout ) .Ve .PP This method calls the \f(CWiteration()\fR method on the underlying \&\f(CW\*(C`Glib::MainContext\*(C'\fR. If a timeout value is supplied, then a Glib timeout will be installed, to interrupt the loop at that time. If Glib indicates that any callbacks were fired, then this method will return 1 (however, it does not mean that any \f(CW\*(C`IO::Async\*(C'\fR callbacks were invoked, as there may be other parts of code sharing the Glib main context. Otherwise, it will return 0. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP \(bu 4 Glib \- Perl wrappers for the GLib utility and Object libraries .IP \(bu 4 Gtk2 \- Perl interface to the 2.x series of the Gimp Toolkit library .SH AUTHOR .IX Header "AUTHOR" Paul Evans