xwem-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XWEM]: Re: Adding things to xwem-tray


From: Zajcev Evgeny
Subject: Re: [XWEM]: Re: Adding things to xwem-tray
Date: Fri, 09 Apr 2004 11:57:40 +0400
User-agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.5 (celery, berkeley-unix)

Steve Youngs <address@hidden> writes:

> * Zajcev Evgeny <address@hidden> writes:
>
>   > Steve Youngs <address@hidden> writes:
>   >> I've been looking at my screen wondering "what's missing?"... The date!
>
> [...]
>
>   > I think date support can be added to xwem-time, customizable variable
>   > like `display-time-day-and-date'.
>
> Nope, that doesn't work. :-(

I just thought about such variable :), it is not in xwem-time now.

>
> But this does...
>
> ;; Display the date in the bottom right of screen using OSD
> (require 'xwem-osd)
> (copy-face 'default 'sy-osd-face)
> (set-face-foreground 'sy-osd-face "cyan")
>
> (defun sy-show-date-osd ()
>   (let* ((fromleft 830)
>        (fromtop 740)
>        (face `sy-osd-face)
>        (text (format-time-string "%a, %b%e")))
>     (setq sy-osd (xwem-osd-create (xwem-dpy) fromleft fromtop 400 200))
>     (xwem-osd-set-color sy-osd (face-foreground-name face))
>     (xwem-osd-set-font sy-osd (face-font-name face))
>     (xwem-osd-text sy-osd text)
>     (xwem-osd-show sy-osd)))
>
> (defun sy-hide-date-osd ()
>   (xwem-osd-hide sy-osd))
>
> (defun sy-update-osd-date-maybe ()
>   (let* ((now (decode-time))
>        (cur-hour (nth 2 now))
>        (cur-min (nth 1 now))
>        (cur-comp-time (+ (* cur-hour 60) cur-min)))
>     (when (= 0 cur-comp-time)
>       (sy-hide-date-osd)
>       (sy-show-date-osd))))
>
> (add-hook 'xwem-after-init-hook 'sy-show-date-osd)
>
> (start-itimer "sy-osd-date-itimer"
>             'sy-update-osd-date-maybe
>             60 60)
>

Just great! This shows that handling always-ontop property must be
handled in OSD itself, not globally.  Because for example if you have
two OSD, one with always-ontop prop, other not, currently osd event
handler can't know is obscured OSD was with that prop or not, and
assumes value of `xwem-osd-always-ontop'.  This is bug, will fix.

Thanks!

-- 
lg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]