unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan Djärv" <jan.h.d@swipnet.se>
To: joakim@verona.se
Cc: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: xwidget branch
Date: Fri, 02 Jul 2010 10:40:58 +0200	[thread overview]
Message-ID: <4C2DA61A.3030808@swipnet.se> (raw)
In-Reply-To: <m31vbnc884.fsf@verona.se>



joakim@verona.se skrev 2010-07-01 21.28:
> Jan Djärv<jan.h.d@swipnet.se>  writes:
>
>> joakim@verona.se skrev 2010-06-30 15.09:
>>> Jan Djärv<jan.h.d@swipnet.se>   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	other threads:[~2010-07-02  8:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-23 11:35 xwidget branch joakim
2010-06-30 11:55 ` Jan Djärv
2010-06-30 13:09   ` joakim
2010-07-01 15:52     ` Jan Djärv
2010-07-01 19:28       ` joakim
2010-07-02  8:40         ` Jan Djärv [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C2DA61A.3030808@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=emacs-devel@gnu.org \
    --cc=joakim@verona.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).