Skip to content

Instantly share code, notes, and snippets.

@withgod
Created March 17, 2011 03:41
Show Gist options
  • Save withgod/873791 to your computer and use it in GitHub Desktop.
Save withgod/873791 to your computer and use it in GitHub Desktop.
Growl::Any test
#!/usr/bin/perl
use Growl::Any;
my $growl = Growl::Any->new("my app", ["event1", "event2"]);
$growl->notify("event1", "title", "message");
@mattn
Copy link

mattn commented Mar 17, 2011

これが動いてない?

@withgod
Copy link
Author

withgod commented Mar 17, 2011

yes. tweetしようと思いつつ、発言欄で止まってたw

Growl::Any って perl -MCPAN -e 'install Gworl::Any'だけで関連するライブラリも入らないんですかね?
これで動かなくて、G::A:MacGrowlを直接利用したらエラー、で Mac::Growlが入ってない事が判明してMac::Growl をCPANから入れたら別のエラーが出だした
http://paste2.org/p/1307103
これはサンプルコードが間違ってるだけだろうから、e-q.plを動かしてみたらこんな感じのエラーが。
http://paste2.org/p/1307104

@withgod
Copy link
Author

withgod commented Mar 17, 2011

ちなみに、Mac::Growlのテストはちゃんと動いてGrowlの通知出ていた。

今の問題点は

  • Growl::Any 入れても Mac::Growlが入らない
  • Growl::Any のサンプル動かない(ほんとにコピペしてるだけだから、何かおかしいかも)
  • earthquake-growler.pl がエラー

って感じかな?

@mattn
Copy link

mattn commented Mar 17, 2011

Growl::AnyのMac::Growlの使い方がマズってるのかも。
Mac::Growlでうまく動く、日本語使ったサンプルもらえますか?

@withgod
Copy link
Author

withgod commented Mar 17, 2011

http://paste2.org/p/1307186

前者は動くけど後者は動かない(通知が出ないけど、エラーも出ない)
registする時点で日本語アプリ名がレジスト出来ないっぽい(UTF8の扱い云々?適当。)
あとふと思ったのが、Growl::AnyのコンストラクタとMac::Growlのコンストラクタに差異が有りますね、Mac::GrowlはdefaultNotificationsが必須っぽい。

perlはos xに付随のperl(今試してるのは無印leopard(10.5))
perl -v
This is perl, v5.8.8 built for darwin-thread-multi-2level
(with 4 registered patches, see perl -V for more detail)

@withgod
Copy link
Author

withgod commented Mar 17, 2011

こんな感じに用意してみた

http://paste2.org/p/1307265

ら、今まで化けてなかった前者の通知が化け始めたのと、後者の部分で "e-q.plを動かしてみたら"の時と同じエラーが出始めた

~/Documents/code/mac-growl% perl ./m-g2.pl                                                                                                                 
**** ERROR **** PerlObjCBridge: convertPerlToObjC(): Referenced thingy not blessed
**** ERROR **** PerlObjCBridge: convertArg() for index 2: convertPerlToObjC() failed
**** ERROR **** PerlObjCBridge: sendObjcMessage: Error converting argument 1 for message "setObject:forKey:"
**** ERROR **** PerlObjCBridge: error sending message setObject:forKey: at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/PerlObjCBridge.pm line 233.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment