Gtk2::Helper 1.122
Sponsored Links
Gtk2::Helper 1.122 Ranking & Summary
File size:
0.60 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
1193
Date added:
2006-07-18
Publisher:
Kapere
Gtk2::Helper 1.122 description
Gtk2::Helper is a Perl module for convenience functions for the Gtk2 module.
SYNOPSIS
use Gtk2::Helper;
# Handle I/O watchers easily, like Gtk 1.x did
$tag = Gtk2::Helper->add_watch ( $fd, $cond, $callback, $data )
$rc = Gtk2::Helper->remove_watch ( $tag )
ABSTRACT
This module collects Gtk2 helper functions, which should make implementing some common tasks easier.
Gtk2::Helper->add_watch ( ... )
$tag = Gtk2::Helper->add_watch ( $fd, $cond, $callback, $data )
This method is a wrapper for Glib::IO->add_watch. The callback is called every time when its safe to read from or write to the watched filehandle.
$fd
Unix file descriptor to be watched. If you use the FileHandle module you get this value from the FileHandle->fileno() method.
$cond
May be either in or out, depending if you want to read from the filehandle (in) or write to it (out).
$callback
A subroutine reference or closure, which is called, if you can safely operate on the filehandle, without the risk of blocking your application, because the filehandle is not ready for reading resp. writing.
But aware: you should not use Perls builtin read and write functions here because these operate always with buffered I/O. Use low level sysread() and syswrite() instead. Otherwise Perl may read more data into its internal buffer as your callback actually consumes. But Glib wont call the callback on data which is already in Perls buffer, only when events on the the underlying Unix file descriptor occur.
The callback subroutine should return always true. Two signal watchers are connected internally (the I/O watcher, and a HUP watcher, which is called on eof() or other exceptions). Returning false from a watcher callback, removes the correspondent watcher automatically. Because we have two watchers internally, only one of them is removed, but probably not both. So always return true and use Gtk2::Helper->remove_watch to disable a watcher, which was installed with Gtk2::Helper->add_watch.
(Gtk2::Helper could circumvent this by wrapping your callback with a closure returning always true. But why adding another level of indirection if writing a simple "1;" at the end of your callback solves this problem? ;)
$data
This data is passed to the callback.
$tag
The method returns a tag which represents the created watcher. Later you need to pass this tag to Gtk2::Helper->remove_watch to remove the watcher.
SYNOPSIS
use Gtk2::Helper;
# Handle I/O watchers easily, like Gtk 1.x did
$tag = Gtk2::Helper->add_watch ( $fd, $cond, $callback, $data )
$rc = Gtk2::Helper->remove_watch ( $tag )
ABSTRACT
This module collects Gtk2 helper functions, which should make implementing some common tasks easier.
Gtk2::Helper->add_watch ( ... )
$tag = Gtk2::Helper->add_watch ( $fd, $cond, $callback, $data )
This method is a wrapper for Glib::IO->add_watch. The callback is called every time when its safe to read from or write to the watched filehandle.
$fd
Unix file descriptor to be watched. If you use the FileHandle module you get this value from the FileHandle->fileno() method.
$cond
May be either in or out, depending if you want to read from the filehandle (in) or write to it (out).
$callback
A subroutine reference or closure, which is called, if you can safely operate on the filehandle, without the risk of blocking your application, because the filehandle is not ready for reading resp. writing.
But aware: you should not use Perls builtin read and write functions here because these operate always with buffered I/O. Use low level sysread() and syswrite() instead. Otherwise Perl may read more data into its internal buffer as your callback actually consumes. But Glib wont call the callback on data which is already in Perls buffer, only when events on the the underlying Unix file descriptor occur.
The callback subroutine should return always true. Two signal watchers are connected internally (the I/O watcher, and a HUP watcher, which is called on eof() or other exceptions). Returning false from a watcher callback, removes the correspondent watcher automatically. Because we have two watchers internally, only one of them is removed, but probably not both. So always return true and use Gtk2::Helper->remove_watch to disable a watcher, which was installed with Gtk2::Helper->add_watch.
(Gtk2::Helper could circumvent this by wrapping your callback with a closure returning always true. But why adding another level of indirection if writing a simple "1;" at the end of your callback solves this problem? ;)
$data
This data is passed to the callback.
$tag
The method returns a tag which represents the created watcher. Later you need to pass this tag to Gtk2::Helper->remove_watch to remove the watcher.
Gtk2::Helper 1.122 Screenshot
Gtk2::Helper 1.122 Keywords
Helper 1.122
Perl module
for convenience
convenience functions
callback
module
watch
watcher
tag
functions
Gtk2::Helper
Gtk2Helper
Gtk2::Helper 1.122
Libraries
Programming
Bookmark Gtk2::Helper 1.122
Gtk2::Helper 1.122 Copyright
WareSeeker periodically updates pricing and software information of Gtk2::Helper 1.122 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Gtk2::Helper 1.122 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
Gtk2::CodeGen is a code generation utilities for Glib-based bindings. Free Download
Gtk2::GladeXML is a Perl module that create user interfaces directly from Glade XML files. Free Download
Gtk2::Ex::Dialogs is a Perl module with useful tools for Gnome2/Gtk2 Perl GUI design. Free Download
Gtk2::Ex::Utils is a Perl module with extra Gtk2 Utilities for working with Gnome2/Gtk2 in Perl. Free Download
PerlIO is a Perl module created to load on demand PerlIO layers and root of PerlIO::* name space. Free Download
Gtk2::Ex::MindMapView is a Perl module to display mind map or outline on a Gnome2::Canvas. Free Download
Gtk2::SourceView provides Perl wrappers for the GtkSourceView widget. Free Download
Gtk2::Ex::Dialogs::Question is a Perl module that provides a simple question dialog. Free Download
Latest Software
Popular Software
Favourite Software