emacs-devel
[Top][All Lists]
Advanced

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

Re: xwidget branch


From: Jan Djärv
Subject: Re: xwidget branch
Date: Fri, 02 Jul 2010 10:40:58 +0200
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1



address@hidden skrev 2010-07-01 21.28:
Jan Djärv<address@hidden>  writes:

address@hidden skrev 2010-06-30 15.09:
Jan Djärv<address@hidden>   writes:

This sounds like fun.  How do you handle multiple windows, that is the
same buffer with widgets displayed in different frames/windows?

There are some notes in the readme. I paste it below so we can discuss it
and improve it. This is as you might imagine the really tricky part.



I guess it takes some kind of proxy object that keeps track of
creating the real widget for each window.  GtkAction:s can help here.
You can have a GtkAction instead of the real widget.  When redisplay
is done, check all proxy widgets for the GtkAction, and if no one is
present for the window, create one.  The window can be saved in the
real widget as widget data.

Ill have to look into that idea. Would it really work for all sorts of
widgets, like sliders? Maybe you can elaborate a bit more, it sounds
interesting.

No, unfortunately GtkAction only works with widgets that implement the interface GtkActivatable. A custom Emacs proxy would be needed.

I was just thinking of a list that stores <widget, window> pairs and adds to it if the current window isn't there. Of course removing from this list becomes a problem. Keeping thinks like sliders in sync is also an issue.


I think the "don't display cursor over widget"-problem should have
some precedence, it really looks awful :-).

Its not spectacularily beautiful no. But doesnt images have the same
issues? Maybe images have some cursor handling code that can be reused?

It can be tricky to do exactly the same. Images just alter the background when the cursor is over them. But Gtk+ widgets can repaint the background when they feel like it. I suggest trying to alter the widget state, for example to PRELIGHT. Then again, not all widgets differ between normal and prelight state.


I see lots of redisplay-problems with widgets, but that is to expected
as Emacs doesn't use the Gtk+ event loop.  It took a while before Gtk+
scrollbars displayed nicely, and even now bugs show up.  You have to
request redraw on widgets and flush the Gdk event queue manually at
appropriate places.

Do you have any example pointers in the Emacs source handy?


x_clear_frame and x_clear_frame_area in xterm.c, xg_update_scrollbar_pos in gtkutil.c forces redraw.

        Jan D.




reply via email to

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