Update of /cvsroot/tleenx/tleenx2/plugins
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14047/plugins
Modified Files:
helloworld.c
Log Message:
hello world plugin reagujÄ
cy na nadejÅcie nowej wiadomoÅci.
Index: helloworld.c
===================================================================
RCS file: /cvsroot/tleenx/tleenx2/plugins/helloworld.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- helloworld.c 21 Mar 2006 00:00:09 -0000 1.1
+++ helloworld.c 5 Oct 2006 17:07:33 -0000 1.2
@@ -13,8 +13,9 @@
{
p->name = "Hello World";
p->version = "0.2";
- p->desc = "Yes! it prints \"Hello World\" message. :]";
+ p->desc = "Sample plugin. Shows \"Hello World\" message.";
p->author = "Kamil Strzelecki";
+ p->homepage = "http://tleenx.sf.net/";
p->prefs_func = hello_preferences;
return TRUE;
@@ -73,12 +74,39 @@
}
+gboolean hello_message_cb(gpointer msg)
+{
+ gchar *s = NULL;
+ GtkWidget *dialog, *label;
+
+ s = g_new0(gchar, 100);
+ g_sprintf(s, "Nowa wiadomoÅÄ od %s", msg);
+
+ dialog = gtk_dialog_new_with_buttons(
+ "Hello World new message notification",
+ NULL,
+ GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
+ GTK_STOCK_CLOSE,
+ GTK_RESPONSE_NONE,
+ NULL);
+ label = gtk_label_new(s);
+ gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label);
+ g_signal_connect_swapped(dialog, "response", G_CALLBACK(gtk_widget_destroy), dialog);
+ gtk_widget_show_all (dialog);
+
+ g_free(s);
+
+ return TRUE;
+}
+
+
gchar *plugin_load(PluginInfo *p)
{
gchar *s = "ZaÅadowano plugin Hello World";
GtkWidget *dialog, *label;
tleenx_action_register("Say hello", (PluginActionCheck )hello_check, (PluginActionFun )hello_action);
+ tleenx_callback_register("new-message", (PluginCallbackFun ) hello_message_cb);
dialog = gtk_dialog_new_with_buttons(
"Hello World",
|