Tanya :
Saya sudah membuat GUI program saya dengan glade, signal handler juga sudah saya sertakan di program yang saya buat. File juga berhasil di kompilasi, tetapi setiap dijalankan masih ada pesan : Gtk-WARNING **: Could not find signal handler
Program saya, tombol.c terlihat seperti ini :
[sourcecode language=”cpp”]
#include <stdio.h>
#include <gtk/gtk.h>
void
on_button1_clicked (GtkButton *object, gpointer user_data)
{
gtk_main_quit();
}
int main (int argc, char *argv[])
{
GtkBuilder *builder;
GtkWidget *window;
GtkWidget *button1;
gtk_init (&argc, &argv);
builder = gtk_builder_new ();
gtk_builder_add_from_file (builder, "tombol.xml", NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
button1 = GTK_WIDGET (gtk_builder_get_object (builder,"button1"));
gtk_builder_connect_signals (builder, NULL);
g_object_unref (G_OBJECT (builder));
gtk_widget_show (window);
gtk_main ();
return 0;
}
[/sourcecode]
Kenapa ya ?
Jawab :
Anda bisa tambahkan flag -export-dynamic saat mengkompilasi file sumber anda jadi bisa tampak seperti ini :
gcc -Wall -export-dynamic -g -o tombol tombol.c `pkg-config --cflags --libs gtk+-2.0 libglade-2.0`
Demikian, semoga membantu (rezaervani@gmail.com)
Leave a Reply