summaryrefslogtreecommitdiff
path: root/examples/selection
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/selection
parentc3940d4a07a6855998e1d991afeb92f3253bef56 (diff)
downloadgdk-pixbuf-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/selection')
-rw-r--r--examples/selection/gettargets.c8
-rw-r--r--examples/selection/setselection.c26
2 files changed, 17 insertions, 17 deletions
diff --git a/examples/selection/gettargets.c b/examples/selection/gettargets.c
index 45d6af4ae..7dee64ca0 100644
--- a/examples/selection/gettargets.c
+++ b/examples/selection/gettargets.c
@@ -47,7 +47,7 @@ void selection_received( GtkWidget *widget,
atoms = (GdkAtom *)selection_data->data;
item_list = NULL;
- for (i=0; i<selection_data->length/sizeof(GdkAtom); i++)
+ for (i = 0; i < selection_data->length / sizeof(GdkAtom); i++)
{
char *name;
name = gdk_atom_name (atoms[i]);
@@ -75,7 +75,7 @@ int main( int argc,
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
g_signal_connect (GTK_OBJECT (window), "destroy",
- GTK_SIGNAL_FUNC (exit), NULL);
+ GTK_SIGNAL_FUNC (exit), NULL);
/* Create a button the user can click to get targets */
@@ -83,9 +83,9 @@ int main( int argc,
gtk_container_add (GTK_CONTAINER (window), button);
g_signal_connect (GTK_OBJECT(button), "clicked",
- GTK_SIGNAL_FUNC (get_targets), NULL);
+ GTK_SIGNAL_FUNC (get_targets), NULL);
g_signal_connect (GTK_OBJECT(button), "selection_received",
- GTK_SIGNAL_FUNC (selection_received), NULL);
+ GTK_SIGNAL_FUNC (selection_received), NULL);
gtk_widget_show (button);
gtk_widget_show (window);
diff --git a/examples/selection/setselection.c b/examples/selection/setselection.c
index fe93c4489..105545bf2 100644
--- a/examples/selection/setselection.c
+++ b/examples/selection/setselection.c
@@ -7,7 +7,7 @@
void selection_toggled( GtkWidget *widget,
gint *have_selection )
{
- if (GTK_TOGGLE_BUTTON(widget)->active)
+ if (GTK_TOGGLE_BUTTON (widget)->active)
{
*have_selection = gtk_selection_owner_set (widget,
GDK_SELECTION_PRIMARY,
@@ -15,7 +15,7 @@ void selection_toggled( GtkWidget *widget,
/* if claiming the selection failed, we return the button to
the out state */
if (!*have_selection)
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), FALSE);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
}
else
{
@@ -37,7 +37,7 @@ gint selection_clear( GtkWidget *widget,
gint *have_selection )
{
*have_selection = FALSE;
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), FALSE);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
return TRUE;
}
@@ -52,13 +52,13 @@ void selection_handle( GtkWidget *widget,
gchar *timestr;
time_t current_time;
- current_time = time(NULL);
- timestr = asctime (localtime(&current_time));
+ current_time = time (NULL);
+ timestr = asctime (localtime (&current_time));
/* When we return a single string, it should not be null terminated.
That will be done for us */
gtk_selection_data_set (selection_data, GDK_SELECTION_TYPE_STRING,
- 8, timestr, strlen(timestr));
+ 8, timestr, strlen (timestr));
}
int main( int argc,
@@ -78,7 +78,7 @@ int main( int argc,
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
g_signal_connect (GTK_OBJECT (window), "destroy",
- GTK_SIGNAL_FUNC (exit), NULL);
+ GTK_SIGNAL_FUNC (exit), NULL);
/* Create a toggle button to act as the selection */
@@ -86,17 +86,17 @@ int main( int argc,
gtk_container_add (GTK_CONTAINER (window), selection_button);
gtk_widget_show (selection_button);
- g_signal_connect (GTK_OBJECT(selection_button), "toggled",
- GTK_SIGNAL_FUNC (selection_toggled), &have_selection);
- g_signal_connect (GTK_OBJECT(selection_button), "selection_clear_event",
- GTK_SIGNAL_FUNC (selection_clear), &have_selection);
+ g_signal_connect (GTK_OBJECT (selection_button), "toggled",
+ GTK_SIGNAL_FUNC (selection_toggled), &have_selection);
+ g_signal_connect (GTK_OBJECT (selection_button), "selection_clear_event",
+ GTK_SIGNAL_FUNC (selection_clear), &have_selection);
gtk_selection_add_target (selection_button,
GDK_SELECTION_PRIMARY,
GDK_SELECTION_TYPE_STRING,
1);
- g_signal_connect (GTK_OBJECT(selection_button), "selection_get",
- GTK_SIGNAL_FUNC (selection_handle), &have_selection);
+ g_signal_connect (GTK_OBJECT (selection_button), "selection_get",
+ GTK_SIGNAL_FUNC (selection_handle), &have_selection);
gtk_widget_show (selection_button);
gtk_widget_show (window);