Hi,
I'm writing a small app to display the contents of text files and I have the following code:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
void
on_window_destroy (GtkObject *object, gpointer user_data)
{
gtk_main_quit();
}
int
main (int argc, char *argv[])
{
GtkBuilder *builder;
GtkWidget *window;
GtkWidget *textview;
GtkTextBuffer *textbuffer;
gtk_init (&argc, &argv);
builder = gtk_builder_new ();
gtk_builder_add_from_file (builder, "fv.xml", NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
gtk_builder_connect_signals (builder, NULL);
g_object_unref (G_OBJECT (builder));
textview = gtk_text_view_new ();
line 32: textbuffer = gtk_text_view_get_buffer (textview);
gtk_widget_show (window);
gtk_main ();
return 0;
}
and the following is the output from the compiler, gcc version 4.3.2 (Debian 4.3.2-1.1):
Code:
greg@debian:/fv$ gtk-builder-convert fv.glade fv.xml
Wrote fv.xml
greg@debian:/fv$ gcc -Wall -g -o fv fv.c -export-dynamic `pkg-config --cflags --libs gtk+-2.0`
fv.c: In function ‘main’:
fv.c:32: warning: passing argument 1 of ‘gtk_text_view_get_buffer’ from incompatible pointer type
I've tried passing textview, *textview and &textview, but I still get this warning and it seems to be tied into problems I'm having expanding my code. Is there any way to get rid of this warning? Am I using the correct syntax in the code I have posted?
Thanks.