Index: minipager.h
===================================================================
--- minipager.h	(revision 196)
+++ minipager.h	(working copy)
@@ -6,5 +6,4 @@
 #include <X11/Xmd.h>
 #include <glib-2.0/glib.h>
 
-#define DESKTOPS 10
 #define MAX_PROPERTY_VALUE_LEN 4096
Index: main.cpp
===================================================================
--- main.cpp	(revision 196)
+++ main.cpp	(working copy)
@@ -1,31 +1,30 @@
 #include "box.h"
 
-XServer server;
-box currentDesktop;
-box desktop[DESKTOPS];
+static XServer server;
+static box *currentDesktop;
+static box *desktopList;
 
-char * active_fill;
-char * active_border;
-char * inactive_fill;
-char * inactive_border;
+static char * active_fill;
+static char * active_border;
+static char * inactive_fill;
+static char * inactive_border;
 
 gboolean update_pager () {
-	if (currentDesktop.number < 0 && server.get_number_desktops () != NULL) {
-		printf ("draw pager from beginning!\n");
+	if (currentDesktop->get_number() < 0 && server.get_number_desktops () != NULL) {
 		server.recalculate_width ();
 		for (int count = 0; count < server.get_number_desktops (); count++) {
-			desktop[count].init (count, &server, active_fill, active_border, inactive_fill, inactive_border);
-			desktop[count].create (server.get_current_width (), server.get_current_height () - 20);
+			desktopList[count].init (count, &server, active_fill, active_border, inactive_fill, inactive_border);
+			desktopList[count].create (server.get_current_width (), server.get_current_height () - 20);
 		}
 
-		currentDesktop = desktop[server.get_current_desktop ()];
-		currentDesktop.redraw_active ();
+		currentDesktop = &desktopList[server.get_current_desktop ()];
+		currentDesktop->redraw_active ();
 	}
 
-	else if (currentDesktop.number != desktop[server.get_current_desktop ()].number) {
-		currentDesktop.redraw_inactive ();
-		currentDesktop = desktop[server.get_current_desktop ()];
-		currentDesktop.redraw_active ();
+	else if (currentDesktop->get_number() != desktopList[server.get_current_desktop ()].get_number()) {
+		currentDesktop->redraw_inactive ();
+		currentDesktop = &desktopList[server.get_current_desktop ()];
+		currentDesktop->redraw_active ();
 	}
 
 	return TRUE;
@@ -33,9 +32,9 @@
 
 void set_desktop (XButtonEvent * ev) {
 	for (int count = 0; count < server.get_number_desktops (); count++) {
-		if (desktop[count].win == ev->window) {
+		if (desktopList[count].win == ev->window) {
 			server.client_msg(server.root, "_NET_CURRENT_DESKTOP", 
-		        	desktop[count].number, 0, 0, 0, 0);
+		        	desktopList[count].get_number(), 0, 0, 0, 0);
 			break;
 		}
 	}
@@ -53,10 +52,9 @@
 gboolean check_window_refresh (void) {
 	XEvent ev;
 	if (XCheckMaskEvent (server.disp, ExposureMask, &ev)) {
-		printf ("redraw window!\n");
 		for (int count = 0; count < server.get_number_desktops (); count++) {
-			if (desktop[count].win == ev.xexpose.window) {
-				desktop[count].redraw ();
+			if (desktopList[count].win == ev.xexpose.window) {
+				desktopList[count].redraw ();
 
 			}
 		}
@@ -79,29 +77,28 @@
 		exit (1);
 	}
 
-	printf ("number of desktops: %i\n", server.get_number_desktops ());
-	printf ("current desktop: %i\n", server.get_current_desktop ());
+//	printf ("number of desktops: %i\n", server.get_number_desktops ());
+//	printf ("current desktop: %i\n", server.get_current_desktop ());
 
 	if (server.get_number_desktops () == NULL) {
 		printf ("probably no window manager running.\n");
 	}
 	else {
 
+		desktopList = new box[ server.get_number_desktops () ];
 		for (int count = 0; count < server.get_number_desktops (); count++) {
-			desktop[count].init (count, &server, active_fill, active_border, inactive_fill, inactive_border);
-			desktop[count].create (server.get_current_width (), server.get_current_height () - 20);
+			desktopList[count].init (count, &server, active_fill, active_border, inactive_fill, inactive_border);
+			desktopList[count].create (server.get_current_width (), server.get_current_height () - 20);
 		}
 
-		currentDesktop = desktop[server.get_current_desktop ()];
+		currentDesktop = &desktopList[server.get_current_desktop ()];
 
-		currentDesktop.redraw_active ();
+		currentDesktop->redraw_active ();
 	
 		g_timeout_add (50, (GSourceFunc) update_pager, NULL);
 		g_timeout_add (50, (GSourceFunc) check_button_event, NULL);
 		g_timeout_add (50, (GSourceFunc) check_window_refresh, NULL);
 
-		XEvent ev;
-
 		g_main_loop_run (loop);
 	}
 	return 0;
Index: box.h
===================================================================
--- box.h	(revision 196)
+++ box.h	(working copy)
@@ -17,9 +17,9 @@
 		};
 
 		int state;
+		int number;
 
 	public: 
-		int number;
 		Window win;
 	
 		box ();
@@ -33,4 +33,6 @@
              	void redraw (void);
 		void redraw_inactive (void);
 		void redraw_active (void);
+		void set_number(int newnum) { this->number = newnum; }
+		int get_number() { return this->number; }
 };
