Subject: Re: How can I access the widget the text is drawn in?
From: Martin Sevior (email@example.com)
Date: Tue Feb 15 2000 - 21:49:11 CST
On Tue, 15 Feb 2000, Daniel Weber wrote:
> I need to get access to the main edit widget, but I haven't been able to
> find where this widget is, or how it's accessed. Any pointers in the
> right direction would be appreciated. I'm trying to kill off 522
> forever, and I need to send focus back to this widget after you use the
> combo boxes in the toolbar.
This is a very interesting question from another perspective. Ever since
Paul issued his assert and told us the RIGHT way to do modeless dialogs
was to send input back to the window most recently focussed I've been
thinking about how to do that while doing many, many other non-coding
I think the way to do this is to have a new data structure which stores
pointers to the edit widgets in order of most recently focussed. This
would be something like a ring structure. The most recently focussed edit
window is moved to the front of the ring. This structure must be
accessible from all the widgets in abiword. We already have such a
structure, the clipboard. So to implement this we need a new data area
accessible via the same mechanism as the clipboard. We need a new set of
classes to deal with this.
(a) Add a new pointer to the ring every time a new edit widget is created.
(b) Delete the pointer whenever an edit widget is destroyed.
(c) Capture focus events to edit widget's and update the ring.
(d) Report the most recently focussed edit widget.
If we have such a ring you could just access it to get your pointer as
could all modeless dialogs.
I think I know how all this could be implemented in gtk. Unfortunately I
have no time to work on this for the forseeable future.
By the way I hope to get a modal "insert_symbol" dialog going by the of
next week. If I haven't done it by then someone else should work on it.
I'm certainly no abi guru but I believe the current edit widget is
the "m_pG" class. If this is not correct please let me know.
This archive was generated by hypermail 2b25 : Tue Feb 15 2000 - 21:49:27 CST