/*
* GtkMaskedEntry widget for GTK+
- * Copyright (C) 2005-2007 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2005-2009 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
newtext[c] = mask[i];
}
}
- newtext[c] = '\0';
if (c > 0)
{
+ newtext[c] = '\0';
i = start_pos;
g_signal_handlers_block_by_func (editable, (gpointer)gtk_masked_entry_insert_text, user_data);
g_signal_handlers_block_by_func (editable, (gpointer)gtk_masked_entry_delete_text, user_data);
newtext[c++] = (mask[*position + i] == '^' ? toupper (text[i]) : text[i]);
}
}
- newtext[c] = '\0';
if (c > 0)
{
+ newtext[c] = '\0';
g_signal_handlers_block_by_func (editable, (gpointer)gtk_masked_entry_insert_text, user_data);
g_signal_handlers_block_by_func (editable, (gpointer)gtk_masked_entry_delete_text, user_data);
gtk_editable_delete_text (editable, *position, *position + c);
/*
* GtkMaskedEntry widget test
- * Copyright (C) 2005 Andrea Zagli
+ * Copyright (C) 2005-2009 Andrea Zagli <azagli@libero.it>
*
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
label = gtk_label_new ("Set value");
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 4, 5, 0, 0, 3, 3);
gtk_widget_show (label);
-
+
txtValueNew = gtk_entry_new ();
gtk_table_attach (GTK_TABLE (table), txtValueNew, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, 0, 3, 3);
gtk_widget_show (txtValueNew);
-
+
btnValueNew = gtk_button_new_with_label ("Set");
gtk_table_attach (GTK_TABLE (table), btnValueNew, 2, 3, 4, 5, 0, 0, 3, 3);
gtk_widget_show (btnValueNew);
rend = gtk_cell_renderer_masked_new ();
g_object_set (rend, "editable", TRUE, NULL);
g_signal_connect (rend, "edited",
- G_CALLBACK (on_cell_edited), NULL);
+ G_CALLBACK (on_cell_edited), NULL);
col = gtk_tree_view_column_new_with_attributes ("Masked",
rend,