[Top][All Lists]

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

Re: tool bar icons not updated according to :active condition

From: Reiner Steib
Subject: Re: tool bar icons not updated according to :active condition
Date: Sun, 26 Feb 2006 13:15:45 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

On Sat, Feb 25 2006, Reiner Steib wrote:

> On Fri, Feb 24 2006, Chong Yidong wrote:
>>> But after moving up/down in the group buffer (C-p/C-n), the icon is
>>> not updated (enabled/disabled) when changing from a group to a topic
>>> line and vice versa.
>>> After `C-l' (or after `redraw-frame' [3]), the correct icon is
>>> displayed.  A workaround could be to redraw the frame after every
>>> point-motion (is there a after-point-motion-hook?).
>> You could use post-command-hook.
> The following code updates the frame and the tool bar, but I think it
> is too expensive (and maybe irritating for the user) because it
> affects the whole frame, not only the tool bar.  

The following gives better results (but of course it is still a
workaround, not a fix).

--8<---------------cut here---------------start------------->8---
(defvar gnus-group-redraw-line-number nil
  "Internal variable.")

(defun gnus-group-redraw-check ()
  "Check if we need to redraw the frame."
  ;; Work around for
  ;; http://www.google.com/address@hidden
  (when (and (not (featurep 'xemacs))
             (boundp 'tool-bar-mode)
    (let ((no (line-number-at-pos)))
      (unless (eq gnus-group-redraw-line-number no)
        (setq gnus-group-redraw-line-number no)
        ;; (run-with-idle-timer 1 nil 'menu-bar-update-buffers t)
        (run-with-idle-timer 1 nil 'redraw-frame (selected-frame))))))

(with-current-buffer gnus-group-buffer
  (add-to-list (make-local-variable 'post-command-hook)
--8<---------------cut here---------------end--------------->8---

> Is it possible to limit redrawing to the tool bar?

Is there an analog of `menu-bar-update-buffers' or
`menu-bar-update-buffers-1' for the tool bar?  BTW, maybe these
functions should have a doc string.

Bye, Reiner.
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

reply via email to

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