+;;;; Initalization
+
+(defbinding (gtk-init "gtk_parse_args") () nil
+ "Initializes the library without opening the display."
+ (nil null)
+ (nil null))
+
+(defun clg-init (&optional display)
+ "Initializes the system and starts the event handling"
+ (unless (gdk:display-get-default)
+ (gdk:gdk-init)
+ (gtk-init)
+ (prog1
+ (gdk:display-open display)
+ (system:add-fd-handler
+ (gdk:display-connection-number) :input #'main-iterate-all)
+ (setq lisp::*periodic-polling-function* #'main-iterate-all)
+ (setq lisp::*max-event-to-sec* 0)
+ (setq lisp::*max-event-to-usec* 1000))))
+
+