1 | =head1 NAME |
1 | =head1 NAME |
2 | |
2 | |
3 | Glib::Event - convert the Glib event loop a subsystem of the Event module |
3 | Glib::Event - Coerce Glib into using the Event module as event loop. |
4 | |
4 | |
5 | =head1 SYNOPSIS |
5 | =head1 SYNOPSIS |
6 | |
6 | |
7 | use Glib::Event; |
7 | use Glib::Event; |
|
|
8 | |
|
|
9 | # example with Gtk2: |
|
|
10 | use Gtk2; |
|
|
11 | use Glib::Event; |
|
|
12 | use Event; # any order |
|
|
13 | Event->timer (after => 1, interval => 1, cb => sub { print "I am here!\n" }); |
|
|
14 | main Gtk2; |
|
|
15 | # etc., it just works |
8 | |
16 | |
9 | =head1 DESCRIPTION |
17 | =head1 DESCRIPTION |
10 | |
18 | |
11 | This module coerces the Glib event loop to use the Event module as |
19 | This module coerces the Glib event loop to use the Event module as |
12 | underlying event loop, i.e. Event will be used by Glib for all events. |
20 | underlying event loop, i.e. Event will be used by Glib for all events. |
… | |
… | |
38 | |
46 | |
39 | BEGIN { |
47 | BEGIN { |
40 | $VERSION = 0.1; |
48 | $VERSION = 0.1; |
41 | |
49 | |
42 | require XSLoader; |
50 | require XSLoader; |
43 | XSLoader::load Glib::Event, $VERSION; |
51 | XSLoader::load (Glib::Event, $VERSION); |
44 | |
52 | |
45 | $default_poll_func = install (undef); |
53 | $default_poll_func = install (undef); |
46 | } |
54 | } |
47 | |
55 | |
48 | =back |
56 | =back |
49 | |
57 | |
50 | =cut |
58 | =cut |
|
|
59 | |
|
|
60 | =head1 BUGS |
|
|
61 | |
|
|
62 | * No documented API to patch other main contexts. |
|
|
63 | * Uses one_event, which is inefficient. |
51 | |
64 | |
52 | =head1 SEE ALSO |
65 | =head1 SEE ALSO |
53 | |
66 | |
54 | L<Event>, L<Glib>, L<Glib::MainLoop>. |
67 | L<Event>, L<Glib>, L<Glib::MainLoop>. |
55 | |
68 | |