summaryrefslogtreecommitdiff
path: root/gtk/testgtk.c
diff options
context:
space:
mode:
authorElliot Lee <sopwith@src.gnome.org>1998-01-07 00:04:19 +0000
committerElliot Lee <sopwith@src.gnome.org>1998-01-07 00:04:19 +0000
commit51a481d9e8ca4d57c69074d8e28a2c980a298e4b (patch)
tree1df9ffb696d5498bd9429ac5dfa5bd0ddf637e3d /gtk/testgtk.c
parentd2aa891c8ecb23b4496d44f6ceec17bf2646d483 (diff)
downloadgtk+-51a481d9e8ca4d57c69074d8e28a2c980a298e4b.tar.gz
Added gtk_entry_set_editable()
Diffstat (limited to 'gtk/testgtk.c')
-rw-r--r--gtk/testgtk.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gtk/testgtk.c b/gtk/testgtk.c
index cf0a793ff6..9c6aaf7951 100644
--- a/gtk/testgtk.c
+++ b/gtk/testgtk.c
@@ -1331,12 +1331,21 @@ create_scrolled_windows ()
/*
* GtkEntry
*/
+
+void entry_toggle_editable (GtkWidget *checkbutton,
+ GtkWidget *entry)
+{
+ gtk_entry_set_editable(GTK_ENTRY(entry),
+ GTK_TOGGLE_BUTTON(checkbutton)->active);
+}
+
void
create_entry ()
{
static GtkWidget *window = NULL;
GtkWidget *box1;
GtkWidget *box2;
+ GtkWidget *editable_check;
GtkWidget *entry;
GtkWidget *button;
GtkWidget *separator;
@@ -1366,7 +1375,6 @@ create_entry ()
gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0);
gtk_widget_show (box2);
-
entry = gtk_entry_new ();
/* gtk_widget_set_usize (entry, 0, 25); */
gtk_entry_set_text (GTK_ENTRY (entry), "hello world");
@@ -1375,6 +1383,12 @@ create_entry ()
gtk_box_pack_start (GTK_BOX (box2), entry, TRUE, TRUE, 0);
gtk_widget_show (entry);
+ editable_check = gtk_check_button_new_with_label("Editable");
+ gtk_box_pack_start (GTK_BOX (box2), editable_check, TRUE, TRUE, 0);
+ gtk_signal_connect (GTK_OBJECT(editable_check), "toggled",
+ GTK_SIGNAL_FUNC(entry_toggle_editable), entry);
+ gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(editable_check), TRUE);
+ gtk_widget_show (editable_check);
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);