From 92feaad00964210f538ba0d86c5f191fc17b15b4 Mon Sep 17 00:00:00 2001 From: bustico Date: Thu, 29 May 2008 13:29:11 +0000 Subject: update doc for gtk loop --- doc/ivy-c.sgml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/doc/ivy-c.sgml b/doc/ivy-c.sgml index 578ef61..27feeba 100644 --- a/doc/ivy-c.sgml +++ b/doc/ivy-c.sgml @@ -634,7 +634,7 @@ pack .send the following lines into your code: #include <ivy.h> -#include <ivygtkloop.h> +#include <gtk/gtk.h> ... IvyInit ("IvyGtkButton", "IvyGtkButton READY",NULL,NULL,NULL,NULL); IvyBindMsg(textCallback,&tosend,"^Ivy Button text=(.*)"); @@ -648,7 +648,7 @@ pkg-config with gtk-config for older gnome1 libs) #include <gtk/gtk.h> #include <ivy.h> -#include <ivygtkloop.h> +#include <gtk/gtk.h> #include <stdio.h> #include <stdlib.h> @@ -657,7 +657,8 @@ void hello( GtkWidget *widget, gpointer data ) { IvySendMsg(*((char**)data)); } -void textCallback(IvyClientPtr app, void *user_data, int argc, char *argv[]){ +void textCallback(IvyClientPtr app, void *user_data, int argc, char +*argv[]){ *((char **)user_data)=argv[0]; } @@ -666,20 +667,30 @@ int main( int argc, char *argv[] ) { GtkWidget *button; char *bus=getenv("IVYBUS"); char *tosend="foo"; - gtk_init (&argc, &argv); + gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (window), 10); button = gtk_button_new_with_label ("send message"); - g_signal_connect (G_OBJECT(button),"clicked",G_CALLBACK(hello),&tosend); + gtk_signal_connect (GTK_OBJECT(button),"clicked",hello,&tosend); gtk_container_add (GTK_CONTAINER(window),button); gtk_widget_show (button); gtk_widget_show (window); IvyInit ("IvyGtkButton", "IvyGtkButton READY",NULL,NULL,NULL,NULL); - IvyBindMsg(textCallback,&tosend,"^Ivy Button text=(.*)"); + IvyBindMsg(textCallback,&tosend,"^Ivy Button text=(.*)"); IvyStart (bus); gtk_main (); return 0; } + + +assuming that you are in directory tools of ivy source, +you can compile this example with this command : + +gcc -g -Wall -I../src `gtk-config --cflags` `pkg-config --cflags glib` +-o test test.c -L. `pkg-config --libs glib` -lglibivy `gtk-config +--libs` `pcre-config --libs` -L../src + + -- cgit v1.1