[mcclim-devel] pixie-tab-bar-pane's width is computed out of the screen in pixie/clx-look

nixie onixie at gmail.com
Tue May 3 03:36:19 UTC 2011


Hello,

I tried pixie/clx-look frame manager with clim-examples' tabdemo.
(tested on sbcl 1.0.47 with mcclim from latest quicklisp in linux)

The tab bar's width is always computed as a very big numbder 20000001/2.
the worse is that the tab layout is always drawn out of screen.

(In ubuntu, it causes the screen to flash when tabdemo displays.
 In gentoo, clx will complain a bad typed 16bit integer error)

I find that draw-pixie-tab-bar-bottom function draws two lines with x
from 0 to +fill+. The +fill+ is a very big number. I think it should
draw the lines with x from 0 to the value of (bounding-rectangle-max-x
(sheet-region pane)) rather than +fill+. This solves the problem.

;; The one will cause the pixie-tab-bar-pane has a very big width.
(defun draw-pixie-tab-bar-bottom (pane)
  (let ((y0 (bounding-rectangle-min-y (sheet-region pane)))
	(y1 (bounding-rectangle-max-y (sheet-region pane))))
    (draw-line* pane 0 (- y1 6) +fill+ (- y1 6) :ink *3d-light-color*)
    (draw-line* pane 0 (- y1 1) +fill+ (- y1 1) :ink *3d-dark-color*)
    #+NIL (draw-line* pane 0 (1- y1) x1 (1- y1)   :ink +gray30+)))

;; I think this is better. And it will solve the problem.
(defun draw-pixie-tab-bar-bottom (pane)
  (let ((y0 (bounding-rectangle-min-y (sheet-region pane)))
	(y1 (bounding-rectangle-max-y (sheet-region pane)))
	(x0 (bounding-rectangle-min-x (sheet-region pane)))
	(x1 (bounding-rectangle-max-x (sheet-region pane))))
    (draw-line* pane 0 (- y1 6) x1 (- y1 6) :ink *3d-light-color*)
    (draw-line* pane 0 (- y1 1) x1 (- y1 1) :ink *3d-dark-color*)
    #+NIL (draw-line* pane 0 (1- y1) x1 (1- y1)   :ink +gray30+)))

I've only test it with sbcl in linux. I don't know if other CL
implementation also has this problem. Does anybody has any idea on this?



BTW, I think tab-layout-pane should have a handle-repaint method which
will redraw the tab header, it will be good when User resizes the tab
layout pane.

;; Handle resize like this one.
(defmethod handle-repaint ((pane pixie-tab-layout-pane) region)
   (pixie-display-tab-header pane
(clim-tab-layout::tab-layout-header-pane pane)))

-- 
nixie <onixie at gmail.com>





More information about the mcclim-devel mailing list