sending events to the libpurple library without gtk or gnt

Siddharth Chandra siddharthchandra0 at gmail.com
Fri Jul 2 23:28:37 EDT 2010


On Fri, Jul 2, 2010 at 8:34 PM, Ethan Blanton <elb at pidgin.im> wrote:

> Siddharth Chandra spake unto us the following wisdom:
> > Since Libpurple is a thread unsafe library, I wanted to know, how I can
> send
> > UI requests like "send IM" and "status update" etc. without creating a
> new
> > thread. I have gone through pidgin and finch code and have noticed that
> they
> > register gtk and gnt callbacks to do so. I am not using any of these, so
> how
> > can I get the same functionality?
>
> I think you need to clarify your question.  Sending an IM is not a UI
> request, for example.  If you want to send an IM, simply call
> purple_conv_im_send (or whatever) at the point where you wish to send
> an IM.
>

I can call purple_conv_im_send but I don't know where exactly to call it
from? Currently I am creating two threads, the main thread, that runs the
g_main_loop and the other one that takes in all the requests from UI.


>
> In the general case, you are not going to be able to get by without
> callbacks.  The event-driven programming model simply requires them
> for handling complex, multi-stage operations.
>

 I have gone through pidgin's code and seen that it registers some glib
signals to do so. I am a newbie and do not know much about it, but from what
i've seen, the glib signal handlers use gtk widgets. I am not using gtk
widgets for my UI, so i wanted to know how I can get my own UI to be
registered with the libpurple callbacks.



>
> Ethan
>
> --
> The laws that forbid the carrying of arms are laws [that have no remedy
> for evils].  They disarm only those who are neither inclined nor
> determined to commit crimes.
>                -- Cesare Beccaria, "On Crimes and Punishments", 1764
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iQEVAwUBTC3/9P8fixZ3H8crAQju2wf/RSPcHIjtxn/D0fRAxrSkABVcQIJOANor
> vQOaMQce46MUR37ZBcw/Av+lUMkmDPNSdyilw8/4KKj07sAQAs9nRBLp84MKSdsl
> d8HIHQ68OQATQT9KddrGXe4zeqRhCldOogvp+tz4z+Jz0eHtcl1rCbb1/HQDdnCp
> eU3jajiYT4YwynyVV5ruvH+J0q9bFb1Igxnq+eiAEHNHc4x/ysGinscySUmR2jYV
> lYK8IxN7A5ZueSXp4ddgQSfqla7gAKOmGgh8/IGFbX2gq5C/gAMhgZnk1LQZRwQM
> 4bshFfzGJ9Ds4xo8j9V2p6jVuNRWkK+Szht7juQDkBk+sw509+vyQg==
> =qqm3
> -----END PGP SIGNATURE-----
>
> Thanks,
Siddharth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/support/attachments/20100703/f8fed4dc/attachment.html>


More information about the Support mailing list