inital gtk2 patch
[claws.git] / src / editbook.c
index 5184005..9b5d9c8 100644 (file)
@@ -95,11 +95,12 @@ static gint edit_book_delete_event( GtkWidget *widget, GdkEventAny *event, gbool
        return TRUE;
 }
 
-static void edit_book_key_pressed( GtkWidget *widget, GdkEventKey *event, gboolean *cancelled ) {
+static gboolean edit_book_key_pressed( GtkWidget *widget, GdkEventKey *event, gboolean *cancelled ) {
        if (event && event->keyval == GDK_Escape) {
                *cancelled = TRUE;
                gtk_main_quit();
        }
+       return FALSE;
 }
 
 static void edit_book_file_check( void ) {
@@ -146,18 +147,18 @@ static void addressbook_edit_book_create( gboolean *cancelled ) {
        GtkWidget *hsbox;
        gint top;
 
-       window = gtk_window_new(GTK_WINDOW_DIALOG);
-       gtk_widget_set_usize(window, 450, -1);
+       window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+       gtk_widget_set_size_request(window, 450, -1);
        gtk_container_set_border_width( GTK_CONTAINER(window), 0 );
        gtk_window_set_title(GTK_WINDOW(window), _("Edit Addressbook"));
        gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
        gtk_window_set_modal(GTK_WINDOW(window), TRUE); 
-       gtk_signal_connect(GTK_OBJECT(window), "delete_event",
-                          GTK_SIGNAL_FUNC(edit_book_delete_event),
-                          cancelled);
-       gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
-                          GTK_SIGNAL_FUNC(edit_book_key_pressed),
-                          cancelled);
+       g_signal_connect(G_OBJECT(window), "delete_event",
+                        G_CALLBACK(edit_book_delete_event),
+                        cancelled);
+       g_signal_connect(G_OBJECT(window), "key_press_event",
+                        G_CALLBACK(edit_book_key_pressed),
+                        cancelled);
 
        vbox = gtk_vbox_new(FALSE, 8);
        gtk_container_add(GTK_CONTAINER(window), vbox);
@@ -210,16 +211,16 @@ static void addressbook_edit_book_create( gboolean *cancelled ) {
        hsep = gtk_hseparator_new();
        gtk_box_pack_end(GTK_BOX(vbox), hsep, FALSE, FALSE, 0);
 
-       gtk_signal_connect(GTK_OBJECT(name_entry), "focus_in_event",
-                          GTK_SIGNAL_FUNC(edit_book_name_focus), NULL );
-       gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
-                          GTK_SIGNAL_FUNC(edit_book_ok), cancelled);
-       gtk_signal_connect(GTK_OBJECT(cancel_btn), "clicked",
-                          GTK_SIGNAL_FUNC(edit_book_cancel), cancelled);
-/*     gtk_signal_connect(GTK_OBJECT(file_btn), "clicked", */
-/*                        GTK_SIGNAL_FUNC(edit_book_file_select), NULL); */
-       gtk_signal_connect(GTK_OBJECT(check_btn), "clicked",
-                          GTK_SIGNAL_FUNC(edit_book_file_check), NULL);
+       g_signal_connect(G_OBJECT(name_entry), "focus_in_event",
+                        G_CALLBACK(edit_book_name_focus), NULL );
+       g_signal_connect(G_OBJECT(ok_btn), "clicked",
+                        G_CALLBACK(edit_book_ok), cancelled);
+       g_signal_connect(G_OBJECT(cancel_btn), "clicked",
+                        G_CALLBACK(edit_book_cancel), cancelled);
+/*     g_signal_connect(G_OBJECT(file_btn), "clicked", */
+/*                      G_CALLBACK(edit_book_file_select), NULL); */
+       g_signal_connect(G_OBJECT(check_btn), "clicked",
+                        G_CALLBACK(edit_book_file_check), NULL);
 
        gtk_widget_show_all(vbox);