Mercurial > pidgin
annotate plugins/perl/scripts/gtk_frame_test.pl @ 14122:dabbcb9b013d
[gaim-migrate @ 16759]
This initializes threads for glib and dbus, because under some
circumstances multithreaded libraries are causing dbus badness
(namely, gnome-vfs). This fix doesn't really belong in Gaim, but in
the interest of expedience (we don't want to wait for upstream
libraries to get their initializations all worked around to make
things safe) the fix goes here. Note that all Gaim frontends will
have to initialize glib threads if other threaded libraries which
interact with glib or dbus or what-have-you come into play.
committer: Tailor Script <tailor@pidgin.im>
| author | Ethan Blanton <elb@pidgin.im> |
|---|---|
| date | Mon, 14 Aug 2006 21:46:17 +0000 |
| parents | 4d9686e7c234 |
| children |
| rev | line source |
|---|---|
| 11170 | 1 $MODULE_NAME = "GTK Frame Test"; |
| 2 | |
| 3 use Gaim; | |
| 4 | |
| 5 %PLUGIN_INFO = ( | |
| 6 perl_api_version => 2, | |
| 7 name => " Perl: $MODULE_NAME", | |
| 8 version => "0.1", | |
| 9 summary => "Test plugin for the Perl interpreter.", | |
| 10 description => "Implements a set of test proccedures to ensure all functions that work in the C API still work in the Perl plugin interface. As XSUBs are added, this *should* be updated to test the changes. Furthermore, this will function as the tutorial perl plugin.", | |
|
11457
4d9686e7c234
[gaim-migrate @ 13696]
Richard Laager <rlaager@wiktel.com>
parents:
11170
diff
changeset
|
11 author => "John H. Kelm <johnhkelm\@gmail.com>", |
| 11170 | 12 url => "http://gaim.sourceforge.net/", |
| 13 | |
| 14 GTK_UI => TRUE, | |
| 15 gtk_prefs_info => "foo", | |
| 16 load => "plugin_load", | |
| 17 unload => "plugin_unload", | |
| 18 ); | |
| 19 | |
| 20 | |
| 21 sub plugin_init { | |
| 22 return %PLUGIN_INFO; | |
| 23 } | |
| 24 | |
| 25 sub button_cb { | |
| 26 my $widget = shift; | |
| 27 my $data = shift; | |
| 28 print "Clicked button with message: " . $data . "\n"; | |
| 29 } | |
| 30 | |
| 31 sub foo { | |
| 32 eval ' | |
| 33 use Glib; | |
| 34 use Gtk2 \'-init\'; | |
| 35 | |
| 36 $frame = Gtk2::Frame->new(\'Gtk Test Frame\'); | |
| 37 $button = Gtk2::Button->new(\'Print Message\'); | |
| 38 | |
| 39 $frame->set_border_width(10); | |
| 40 $button->set_border_width(150); | |
| 41 $button->signal_connect("clicked" => \&button_cb, "Message Text"); | |
| 42 $frame->add($button); | |
| 43 | |
| 44 $button->show(); | |
| 45 $frame->show(); | |
| 46 '; | |
| 47 return $frame; | |
| 48 } | |
| 49 | |
| 50 sub plugin_load { | |
| 51 my $plugin = shift; | |
| 52 print "#" x 80 . "\n"; | |
| 53 | |
| 54 | |
| 55 ######### TEST CODE HERE ########## | |
| 56 | |
| 57 print "$MODULE_NAME: Loading...\n"; | |
| 58 | |
| 59 | |
| 60 Gaim::debug_info("plugin_load()", "Testing $MODULE_NAME Completed."); | |
| 61 print "#" x 80 . "\n\n"; | |
| 62 } | |
| 63 | |
| 64 sub plugin_unload { | |
| 65 | |
| 66 } |
