diff options
Diffstat (limited to 'src/easygtk.c')
-rw-r--r-- | src/easygtk.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/easygtk.c b/src/easygtk.c index bcca8e4..d6f8dc4 100644 --- a/src/easygtk.c +++ b/src/easygtk.c @@ -192,6 +192,43 @@ GtkWidget *qck_create_label(GObject *object, const char *name, const char *capti } gtk_widget_show(result); + gtk_misc_set_alignment(GTK_MISC(result), 0, 0.5); + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : object = espace dédié à l'inscription de références. * +* name = nom à donner au nouveau composant. * +* text = éventuel contenu initial du champ de saisie. * +* * +* Description : Crée et enregistre un composant 'GtkEntry'. * +* * +* Retour : Champ de saisie mis en place. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GtkWidget *qck_create_entry(GObject *object, const char *name, const char *text) +{ + GtkWidget *result; /* Résultat à renvoyer */ + + result = gtk_entry_new(); + + if (G_IS_OBJECT(object) && name != NULL) + { + gtk_widget_ref(result); + g_object_set_data_full(object, name, result, (GtkDestroyNotify)gtk_widget_unref); + } + + gtk_widget_show(result); + + if (text != NULL) + gtk_entry_set_text(GTK_ENTRY(result), text); return result; |