PATCH: periodically randomize life applet
- From: Daniel Burrows <Daniel_Burrows brown edu>
- To: gnome-list gnome org
- Subject: PATCH: periodically randomize life applet
- Date: Sat, 27 Mar 1999 18:12:44 -0500
I've attached a short patch I wrote to randomize the life applet every 15
minutes so it doesn't get too boring. ;-)
Daniel
--
Whoever created the human body left in a fairly basic design flaw. It has a
tendency to bend at the knees.
-- Terry Pratchett, _Men at Arms_
Index: life.c
===================================================================
RCS file: /cvs/gnome/gnome-core/applets/life/life.c,v
retrieving revision 1.1
diff -u -r1.1 life.c
--- life.c 1999/03/24 06:29:31 1.1
+++ life.c 1999/03/27 23:09:42
@@ -14,6 +14,9 @@
#define LIFE_CYCLE 300
+#define RANDOMIZE_INTERVAL 1000*60*15
+/* Randomize every 15 minutes */
+
int board[APPLET_SIZE][APPLET_SIZE];
GtkWidget *darea = NULL;
@@ -88,6 +91,12 @@
life_draw();
}
+static int
+randomize_timeout (gpointer data)
+{
+ randomize(NULL, data);
+ return TRUE;
+}
static GtkWidget *
create_life (void)
@@ -172,6 +181,8 @@
NULL);
gtk_timeout_add(LIFE_CYCLE,cycle,NULL);
+
+ gtk_timeout_add(RANDOMIZE_INTERVAL,randomize_timeout,NULL);
applet_widget_gtk_main ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]