Re: How to find out when plugin is disabled

Bill WIlson <[email protected]>
Newsgroups gmane.comp.gnome.apps.gkrellm
Message-ID <[email protected]>
On Mon, 26 Jun 2006 14:22:26 +0200
"Michal Nazarewicz" <[email protected]> wrote:

> I've just started writing a plugin which needs to do some clean up when  
> it's disabled or GKrellM is being closed. I figured out that I could check  
> the plugin_mon.privet->enabled like once a second to check if was enabled  
> but doesn't seem like an elegant solution plus it won't work when GKrellM  
> is closed. What I need is some kind of destroy_plugin() function which  
> will be called by GKrellM when the plugin is disabled or GKrellM being  
> closed. Is there anything like that or any mechanism that does what I want?

1) At start up or for an enable after start up, the create_plugin() function has the
first_create arg true.

2) To get notified of a disable, call (see demo4.c):
    gkrellm_disable_plugin_connect(monitor, your_plugin_disabled_function);

3) To get notified of gkrellm quiting, use the glib function:
    g_atexit(your_exit_function)

Bill

_______________________________________________
Gkrellm mailing list
[email protected]
http://ninja.linux-phreak.biz/mailman/listinfo/gkrellm
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.