emacs-devel
[Top][All Lists]
Advanced

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

Re: how to find out when display property is deleted in C?


From: joakim
Subject: Re: how to find out when display property is deleted in C?
Date: Mon, 12 May 2008 16:58:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> How do I find out when a display property is deleted in C?
>
> You don't/can't.

Hmm.

>
>> In the xwidget patch I need to delete the corresponding xwdiget when
>> the display property is deleted.
>
> What happens if the display property is later re-added?
> If that situations is not problematic, then you can keep your xwidgets
> in a cache which you can flush every once in a while.

But I need to remove the gtk widget from display the precise moment the
display property goes away, or there will be very awkward display bugs.

As it is now, the widgets happily live on in the emacs window even after
their display property has been deleted. It looks very odd.

Images work differently, since you either draw them or you don't. In the
xwidget case, its the toolkit that owns the actual gtk widget, and the
toolkit must be informed when the widget is not to be drawn.

I could maybe have a new phase at the end of emacs redisplay, where all
xwidgets which haven't been drawn in this redisplay will be deleted.

This will be problematic for widgets that have been moved off screen
by cursor movement in the window though.

> Also what happens if the same display property gets added at two places
> (either in the same buffer or in different buffers)?

They cant be the same, because I require a unique id for every xwidget
in the display property:

(put-text-property (point) (+ 1 (point)) 'display '(xwidget :xwidget-id 3 :type 
3 :title "3" :width 400 :height 200))

adding the same id twice is an error, as currently designed.

>
>         Stefan
-- 
Joakim Verona




reply via email to

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