xwem-devel
[Top] [All Lists]

My vline thing is still busted

From: Steve Youngs <steve@xxxxxxxx>
Subject: My vline thing is still busted
Date: Wed, 16 Feb 2005 18:50:57 +1000
Organization: The XWEM Project
User-agent: Gnus/5.110003 (No Gnus v0.3) SXEmacs/22.1.2 (Audi, linux)
This just gets stranger and stranger.  Consider the following... 

;:*=======================
;:* Vertical Bar
;; Sometimes it is good to have a visual indicator that your lines of
;; code are just way too long.
(defvar sy-xwem-vline-win nil)
(define-xwem-command sy-xwem-set-vline (&optional column colour)
  "Setup one-pixel wide vertical line at COLUMN.
    
COLOUR is vline colour default \"red\".
Default COLUMN is value of `fill-column'."
  (xwem-interactive 
   (list (or (and xwem-prefix-arg (prefix-numeric-value xwem-prefix-arg))
             fill-column)))
  (unless colour
    (setq colour "red"))
    
  (let (cxwin)
    (setq cxwin
          (X-Win-find-or-make
           (xwem-dpy)
           (float
            (string-to-int (frame-property (last-nonminibuf-frame) 
'window-id)))))
    (when (X-Win-p sy-xwem-vline-win)
      (XDestroyWindow (xwem-dpy) sy-xwem-vline-win)
      (setq sy-xwem-vline-win nil))
    (when (> column 0)
      (setq
       sy-xwem-vline-win
       (XCreateWindow
        (xwem-dpy) cxwin
        (+ (frame-property (last-nonminibuf-frame) 'internal-border-width)
           (* (font-width (face-font 'default)) column))
        0 1
        (frame-pixel-height)
        0 nil nil nil
        (make-X-Attr :background-pixel
                     (XAllocNamedColor
                      (xwem-dpy) (XDefaultColormap (xwem-dpy)) colour))))
      (XMapWindow (xwem-dpy) sy-xwem-vline-win))))

(define-key xwem-global-map (xwem-kbd "H-c m V") 'sy-xwem-set-vline)

If I do M-x sy-xwem-set-vline RET, I get...

http://www.youngs.au.com/~steve/tmp/vline1.png

But if I do H-c m V, I get...

http://www.youngs.au.com/~steve/tmp/vline2.png

Look closely at that 2nd shot... there is a red vertical line, and it
is at the correct column.  It just starts at the top of the toolbar
and finishes at the bottom of the toolbar.


-- 
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
|                        In space,                         |
|             No one can hear you rip a stinky             |
|---------------------------------------<steve@xxxxxxxx>---|

Attachment: pgp5qIcuTMINM.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>