From wilde at sha-bang.de Mon Mar 9 10:42:15 2009 From: wilde at sha-bang.de (Sascha Wilde) Date: Mon, 09 Mar 2009 11:42:15 +0100 Subject: [mcclim-devel] event handling outside the top-level loop Message-ID: Hi *, I'm playing around with an mandelbrot explorer with an simple clim interface. This means the application spends a lot of time in an local loop[0]. During this time the interface is "dead" as no events are handled. So I would like to trigger the event handling from time to time in my own code -- is there an easy way to do so? cheers sascha [0] actually an recursion with the algorithm I'm using -- Sascha Wilde Real programmers don't want "what you see is what you get", they want "you asked for it, you got it". They want editors that are terse, powerful, cryptic, and unforgiving. In a word, Teco. From ahefner at gmail.com Tue Mar 10 03:41:42 2009 From: ahefner at gmail.com (Andy Hefner) Date: Mon, 9 Mar 2009 23:41:42 -0400 Subject: [mcclim-devel] event handling outside the top-level loop In-Reply-To: References: Message-ID: <31ffd3c40903092041v196cca6crc6fc1ae35b65e048@mail.gmail.com> On Mon, Mar 9, 2009 at 6:42 AM, Sascha Wilde wrote: > I'm playing around with an mandelbrot explorer with an simple clim > interface. ?This means the application spends a lot of time in an local > loop[0]. ?During this time the interface is "dead" as no events are > handled. ?So I would like to trigger the event handling from time to > time in my own code -- is there an easy way to do so? You can manually poll the event queue and dispatch any events that are present. This might look something like this*: (let ((queue (frame-event-queue frame))) (loop for event = (event-queue-read-no-hang queue) while event do (handle-event (event-sheet event) event))) This is not exactly equivalent to a CLIM app idle at its top level (notably, you're outside of the command loop, so interactor panes won't work at all), but should suffice for getting working repaint events, gadget callbacks, scroll bars, etc. *Disclaimer: I haven't tried this code. From jch at pps.jussieu.fr Mon Mar 2 21:29:22 2009 From: jch at pps.jussieu.fr (Juliusz Chroboczek) Date: Mon, 02 Mar 2009 21:29:22 -0000 Subject: [mcclim-devel] [PATCH] cooperate with window manager Message-ID: <87iqmrtz16.fsf@trurl.pps.jussieu.fr> Hi, The attached patch makes the CLX backend cooperate better with X11 window managers by marking frames as top-level windows. Juliusz -------------- next part -------------- A non-text attachment was scrubbed... Name: window-management.patch Type: text/x-diff Size: 1105 bytes Desc: not available URL: From jch at pps.jussieu.fr Mon Mar 2 21:29:28 2009 From: jch at pps.jussieu.fr (Juliusz Chroboczek) Date: Mon, 02 Mar 2009 21:29:28 -0000 Subject: [mcclim-devel] Set save-unders for transient windows Message-ID: <87fxhvtyxi.fsf@trurl.pps.jussieu.fr> Minimises redraws. Juliusz -------------- next part -------------- A non-text attachment was scrubbed... Name: save-under.patch Type: text/x-diff Size: 1242 bytes Desc: not available URL: From jch at pps.jussieu.fr Mon Mar 2 21:29:34 2009 From: jch at pps.jussieu.fr (Juliusz Chroboczek) Date: Mon, 02 Mar 2009 21:29:34 -0000 Subject: [mcclim-devel] Use Unicode fonts when available Message-ID: <87d4cztypk.fsf@trurl.pps.jussieu.fr> Don't leave the choice of font encoding to the server, as this is highly unreliable. Try fonts as iso10646-1 if the server supports that, fall-back to iso8859-1. If that's still not available, choose any font at all. iso10646-1 is only tried when (> char-code-limit #x100). Juliusz -------------- next part -------------- A non-text attachment was scrubbed... Name: unicode-fonts.patch Type: text/x-diff Size: 2754 bytes Desc: not available URL: From jch at pps.jussieu.fr Mon Mar 2 22:14:50 2009 From: jch at pps.jussieu.fr (Juliusz Chroboczek) Date: Mon, 02 Mar 2009 22:14:50 -0000 Subject: [mcclim-devel] Fix crash Message-ID: <877i37tvwh.fsf@trurl.pps.jussieu.fr> Index: stream-input.lisp =================================================================== RCS file: /project/mcclim/cvsroot/mcclim/stream-input.lisp,v retrieving revision 1.54 diff -u -r1.54 stream-input.lisp --- stream-input.lisp 1 May 2008 21:45:23 -0000 1.54 +++ stream-input.lisp 2 Mar 2009 22:12:58 -0000 @@ -215,7 +215,7 @@ ;;; Do streams care about any other events? (defun handle-non-stream-event (buffer) (let* ((event (event-queue-peek buffer)) - (sheet (event-sheet event))) + (sheet (and event (event-sheet event)))) (if (and event (or (and (gadgetp sheet) (gadget-active-p sheet)) From deego3 at gmail.com Mon Mar 9 00:26:50 2009 From: deego3 at gmail.com (Dave Goel) Date: Mon, 09 Mar 2009 00:26:50 -0000 Subject: [mcclim-devel] For panes, :menu-bar height is always zero. Message-ID: <87skln8tmx.fsf@marie.gnufans.net> I am playing with a new mcclim, downloaded yesterday or so via clbuild. If I specify a :menu-bar for a pane explicitly, the height is always zero, no matter what. My current workaround is to use clim-internals:make-menu-bar. As an example, I am attaching a file, with several menubars. Moreover, I switch the layout of the menu-bars dynamically (and can even show/hide some bars as I want) using the movethingsaround button. See the commented out parts in there like: ;;(pane2 :menu-bar :command-table 'menubarb-command-table :min-y 100 which I had to replace with clim-internals:make-menu-bar. I am both attaching as well as including the file below. Thanks a lot. -dave -- ;; 2009-03-08 T19:39:18-0400 (Sunday) D. Goel ;; Some of this came from http://constantly.at/lisp/ui.html ;;; This example manually specifies the menu-bar panes. ;; Not only that, each menu-bar's submenu is further a command-table ;; rather than a simple command.. ;; Notice that the quit button is greyed out for mcclim because we ;; defineed it via define-command-table. We should have defined it via ;; define-frame-tag-command-table instead! ;; This method does not work for mcclim. ;; (pane2 :menu-bar :command-table 'menubarb-command-table :min-y 100 ;; The height is 0 no matter what you do. So, instead we call ;; clim-internals! (define-command-table menubar-command-table :menu (("Menub" :menu menu-command-table) ;;("Move 2nd bar" :command move-things) ("Exitb" :command com-quit-frame))) (define-command-table menubarb-command-table :menu (("Menu" :menu menub-command-table) ("Quit" :command com-quit-frame))) (define-application-frame tags-frame () ((message :initform "Message" :accessor tags-message)) (:panes ;; The commented out should be the best method, but broken. ;; This should be the actual method in clim, but is broken ;; (invisible bar, so make-menu-bar instead. ;;(pane2 :menu-bar :command-table 'menubarb-command-table :min-y 100 ;;:min-height 100 :height 100) ;; ;; This one is broken in mcclim for the same reason! ;;(pane2 (make-pane :menu-bar :command-table 'menubar-command-table ;; :height 100 :min-height 30)) ;; We next explore two other methods to make menubar. (pane1 (clim-internals::make-menu-bar 'menubar-command-table)) (pane2 (clim-internals::make-menu-bar 'menubarb-command-table)) (some-pane :application :display-function 'display-some-pane) (my-interactor :interactor) (mouse :pointer-documentation)) (:layouts (default (vertically () (1/3 pane1) (1/3 pane2) (1/3 some-pane) (:fill my-interactor) mouse)) (moved (vertically () (1/3 pane1) (1/3 some-pane) pane2 (:fill my-interactor) mouse)))) ;; Notice that while it serves as a quit function within pane1 and ;; pane2, it also shows as a "Quit frame" command on the very top ;; menu. That part happens because we have included a :menu t below. (define-tags-frame-command (com-quit-frame :menu t) () (frame-exit *application-frame*)) ;; this was in there originally, but these are greyed out! ;; (define-command com-hello () ;; (setf (tags-message *application-frame*) "Hello there!")) ;; Now see, the introduction of this move-things causes mcclim to come ;; up with its own menubar as well. If this hadn't been there, mcclim ;; would not have its own menubar. Of course, we can also make it a ;; subpart of one of the menubars we have defined. (define-tags-frame-command (com-move-things :menu t) () (setf (frame-current-layout *application-frame*) (if (eql (frame-current-layout *application-frame*) 'default) 'moved 'default))) (define-tags-frame-command com-hello () (setf (tags-message *application-frame*) "Hello there!")) (define-tags-frame-command com-exclaim () (setf (tags-message *application-frame*) "You there!")) ;; Notice how this one shows greyed out!! This is because it is not ;; defined as a tags-frame command table. (define-command com-hi () (setf (tags-message *application-frame*) "Hi there!")) (define-command-table menu-command-table :menu (("Say Hello" :command com-hello) ("Say Hi" :command com-hi))) (define-command-table menub-command-table :menu (("Exclaim" :command com-exclaim) ("Exclaim" :command com-exclaimb))) (defun test () (flet ((run () ;; Intentional sleep to test the sleep-enough function below. (sleep 1) (let ((frame (make-application-frame 'tags-frame :top 0 :left 0 :right 3000 :bottom 30000 ))) (setq *test-frame* frame) (run-frame-top-level frame)))) (mp:process-run-function "tags" #'run))) (defmethod display-some-pane ((frame tags-frame) stream) (format stream (tags-message frame))) (defmethod display-another-pane ((frame tags-frame) stream) (declare (ignore stream)) (let ((pane (get-frame-pane *application-frame* 'another-pane))) (window-clear pane) (draw-rectangle* pane 10 10 200 150 :filled nil :line-thickness 2) (draw-ellipse* pane 150 100 10 0 0 30))) -------------- next part -------------- A non-text attachment was scrubbed... Name: ex3b.lisp Type: application/octet-stream Size: 4503 bytes Desc: not available URL: