From: Ned Konz Date: 2001-09-21T08:24:11+09:00 Subject: [ruby-talk:21472] ruby-gtk and entry validation The Gtk FAQ has an example of validating a Gtk::Entry field using an insert_text handler: void insert_text_handler (GtkEntry *entry, const gchar *text, gint length, gint *position, gpointer data) { GtkEditable *editable = GTK_EDITABLE(entry); int i, count=0; gchar *result = g_new (gchar, length); for (i=0; i < length; i++) { if (!isalpha(text[i])) continue; result[count++] = islower(text[i]) ? toupper(text[i]) : text[i]; } if (count > 0) { gtk_signal_handler_block_by_func (GTK_OBJECT (editable), GTK_SIGNAL_FUNC (insert_text_handler), data); gtk_editable_insert_text (editable, result, count, position); gtk_signal_handler_unblock_by_func (GTK_OBJECT (editable), GTK_SIGNAL_FUNC (insert_text_handler), data); } gtk_signal_emit_stop_by_name (GTK_OBJECT (editable), "insert_text"); g_free (result); } The problem is that I can't find any way in ruby-gtk to do this. There is signal_handler_unblock in Gtk::Object but not signal_handler_unblock_by_func(). Any suggestions? -- Ned Konz currently: Stanwood, WA email: ned@bike-nomad.com homepage: http://bike-nomad.com