summaryrefslogtreecommitdiff
path: root/examples/entry
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2002-02-19 01:25:26 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2002-02-19 01:25:26 +0000
commitbd73a312f06ad6d1a448cab873f309264ee24b46 (patch)
tree62afa03ae970e3260e0677d02a2391e1d0350a1d /examples/entry
parentc3940d4a07a6855998e1d991afeb92f3253bef56 (diff)
downloadgtk+-bd73a312f06ad6d1a448cab873f309264ee24b46.tar.gz
Trivial formatting fixes to all examples, simple functional fixes to
* docs/tutorial/gtk-tut.sgml, docs/examples/*: Trivial formatting fixes to all examples, simple functional fixes to rangewidgets example.
Diffstat (limited to 'examples/entry')
-rw-r--r--examples/entry/entry.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/examples/entry/entry.c b/examples/entry/entry.c
index 4de30711d8..b0b3230397 100644
--- a/examples/entry/entry.c
+++ b/examples/entry/entry.c
@@ -7,7 +7,7 @@ void enter_callback( GtkWidget *widget,
GtkWidget *entry )
{
const gchar *entry_text;
- entry_text = gtk_entry_get_text(GTK_ENTRY(entry));
+ entry_text = gtk_entry_get_text (GTK_ENTRY (entry));
printf("Entry contents: %s\n", entry_text);
}
@@ -21,8 +21,8 @@ void entry_toggle_editable( GtkWidget *checkbutton,
void entry_toggle_visibility( GtkWidget *checkbutton,
GtkWidget *entry )
{
- gtk_entry_set_visibility(GTK_ENTRY(entry),
- GTK_TOGGLE_BUTTON(checkbutton)->active);
+ gtk_entry_set_visibility (GTK_ENTRY (entry),
+ GTK_TOGGLE_BUTTON (checkbutton)->active);
}
int main( int argc,
@@ -39,11 +39,11 @@ int main( int argc,
gtk_init (&argc, &argv);
/* create a new window */
- window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_size_request (GTK_WIDGET (window), 200, 100);
- gtk_window_set_title(GTK_WINDOW (window), "GTK Entry");
- g_signal_connect(GTK_OBJECT (window), "delete_event",
- (GtkSignalFunc) exit, NULL);
+ gtk_window_set_title (GTK_WINDOW (window), "GTK Entry");
+ g_signal_connect (GTK_OBJECT (window), "delete_event",
+ GTK_SIGNAL_FUNC (exit), NULL);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
@@ -51,14 +51,14 @@ int main( int argc,
entry = gtk_entry_new ();
gtk_entry_set_max_length (GTK_ENTRY (entry), 50);
- g_signal_connect(GTK_OBJECT(entry), "activate",
- GTK_SIGNAL_FUNC(enter_callback),
- entry);
+ g_signal_connect (GTK_OBJECT (entry), "activate",
+ GTK_SIGNAL_FUNC (enter_callback),
+ entry);
gtk_entry_set_text (GTK_ENTRY (entry), "hello");
tmp_pos = GTK_ENTRY (entry)->text_length;
gtk_editable_insert_text (GTK_EDITABLE (entry), " world", -1, &tmp_pos);
gtk_editable_select_region (GTK_EDITABLE (entry),
- 0, GTK_ENTRY(entry)->text_length);
+ 0, GTK_ENTRY (entry)->text_length);
gtk_box_pack_start (GTK_BOX (vbox), entry, TRUE, TRUE, 0);
gtk_widget_show (entry);
@@ -66,31 +66,32 @@ int main( int argc,
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_widget_show (hbox);
- check = gtk_check_button_new_with_label("Editable");
+ check = gtk_check_button_new_with_label ("Editable");
gtk_box_pack_start (GTK_BOX (hbox), check, TRUE, TRUE, 0);
- g_signal_connect (GTK_OBJECT(check), "toggled",
- GTK_SIGNAL_FUNC(entry_toggle_editable), entry);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE);
+ g_signal_connect (GTK_OBJECT (check), "toggled",
+ GTK_SIGNAL_FUNC (entry_toggle_editable), entry);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
gtk_widget_show (check);
- check = gtk_check_button_new_with_label("Visible");
+ check = gtk_check_button_new_with_label ("Visible");
gtk_box_pack_start (GTK_BOX (hbox), check, TRUE, TRUE, 0);
- g_signal_connect (GTK_OBJECT(check), "toggled",
- GTK_SIGNAL_FUNC(entry_toggle_visibility), entry);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE);
+ g_signal_connect (GTK_OBJECT (check), "toggled",
+ GTK_SIGNAL_FUNC (entry_toggle_visibility), entry);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
gtk_widget_show (check);
button = gtk_button_new_with_label ("Close");
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
- GTK_SIGNAL_FUNC(exit),
- GTK_OBJECT (window));
+ GTK_SIGNAL_FUNC (exit),
+ GTK_OBJECT (window));
gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show (button);
- gtk_widget_show(window);
+ gtk_widget_show (window);
gtk_main();
+
return 0;
}