I am a green hand in GTK. I came across such problem when I used Glade Interface Designer to design a UI. My purpose is to design two window.And one of button in main_window controls the appearance of create_log_in_window. I had add function 'create_log_in_window' and Object 'main_window' in Glade. However, the button is invalid when I run the program. And such warning was appearing. Here are the codes and warnings:
Gtk-WARNING:Could not find signal handler in 'create_log_in_window'
#include <gtk/gtk.h>
int main (int argc, char *argv[]){
GtkBuilder *builder;
GtkWidget *main_window;
gtk_init (&argc, &argv);
builder = gtk_builder_new();
gtk_builder_add_from_file(builder,"main_window.glade", NULL);
main_window = GTK_WIDGET(gtk_builder_get_object(builder, "main_window"));
gtk_builder_connect_signals(builder, NULL);
g_object_unref(G_OBJECT(builder));
gtk_widget_show_all(main_window);
gtk_main();
return 0;
}
gboolean create_log_in_window(GtkWidget *main_window){
GtkBuilder *builder;
GtkWidget *window;
gtk_widget_hide_all(main_window);
builder = gtk_builder_new();
gtk_builder_add_from_file(builder,"log_in_window.glade",NULL);
window = GTK_WIDGET(gtk_builder_get_object(builder,"log_in_window"));
gtk_builder_connect_signals(builder,NULL);
g_object_unref(G_OBJECT(builder));
gtk_widget_show_all(window);
return true;
}
create_log_in_window()
to? Have you checked that your function signature is correct for that signal? – Jussi Kukkonen