Andy Piper wrote:
At 03:51 PM 4/6/00 -0700, Ben Wing wrote:
>thanks very much for working on dialog boxes! however, i have some
>comments ...
I would assume you were ill if you didn't.
>the function make-gutter-only-dialog-frame is bogus. the use of the
>gutter here to hold widgets is an implementation detail and should not
>be exposed in the interface. similarly, make-search-dialog should not
>have to do all the futzing that it does. creating the frame unmapped,
>creating an extent and messing with the gutter: all this stuff should be
>hidden. you should have a simple function make-dialog-frame that takes
>a dialog specification, and that's all you need to do.
The problem is that some of the callbacks and such need access to the
*created* frame, so you end up in a catch 22 unless you do what I've done.
Believe me, I did originally do what you describe but it didn't work.
Please credit me with some intelligence.
Andy, I certainly don't think you are stupid. Otherwise, you wouldn't be able
to do what you're doing! And you have done quite a lot of good work. In this
case, though, you really don't seem to understand the difference between
implementation and interface. Your goal is to hide the implementational
detail of using gutters to implement dialog frames, and if your first attempt
fails, like it did, by all means *dont* just give up and expose all the guts,
as in `make-gutter-only-dialog-frame'; just see if you can come up with a
better way that still meets your goal. For example:
(1) Instead of passing in the actual glyph spec or glyph, pass in a function
of two args (the dialog frame and its parents), which when called, creates and
returns the appropriate glyph.
(2) [Better] Provide a way for callbacks to determine where they were invoked
at. This is much more general and is what you should really do. For example,
have the code that calls the callbacks bind some global variables such as
widget-callback-current-glyph and widget-callback-current-channel, which
contain the glyph
whose callback is being invoked, and the window or frame of the glyph
(depending on where the glyph is) where the invocation actually happened.
That way, the callbacks can easily figure out the dialog box and
its parent, and not have to worry about embedding it in at creation time.
>also, these dialog boxes, and this function make-dialog-frame, should
>
>(a) be in dialog.el, not gutter-items.el.
Ok.
>(b) when possible, be placed in the interactive spec of standard lisp
>functions rather than accessed directly from menubar-items.el
Ug. How do I do that?
>(c) wrapped in calls to should-use-dialog-box-p, so the user has control
>over when dialog boxes appear.
Ok, although I'm not sure there will be direct equivalents between dialog
boxes and key commands.
In this case, perhaps not, because isearch is special; but in the majority of
cases, we will be writing dialog boxes to replace reading from the minibuffer,
and in those cases everything maps cleanly.
>finally, once again i implore you to please fix your layout code so it's
>not necessary to specify widths and heights all over the place!
Please believe me when I say that it is not as easy as you consistently
make out. Notice the only width and height specified is that of the frame
and the gutter in the frame. This is because otherwise the gutter would
shrink (i.e. resize dynamically) to accomodate its contents. Changing the
frame size dynamically based on gutter contents seems way to complex and
fraught with difficulty to me, for dubious user benefit. Layouts are fixed
as you describe.
andy
--------------------------------------------------------------
Dr Andy Piper
Principal Consultant, BEA Systems Ltd
--
Ben
In order to save my hands, I am cutting back on my mail. I also write
as succinctly as possible -- please don't be offended. If you send me
mail, you _will_ get a response, but please be patient, especially for
XEmacs-related mail. If you need an immediate response and it is not
apparent in your message, please say so. Thanks for your understanding.
See also
http://www.666.com/ben/typing.html.