Lisp HUG Maillist Archive

Toolbar won't accept input

We're building an application using LispWorks for Macintosh.

Our client requires that the application have a single, global, 
floating toolbar.  I found how to create such an entity by examining 
the LispWorks podium toolbar (i.e., the interface of class 
lispworks-tools::lispworks-toolbar-window) in the inspector.  I found 
that if I specify

       :window-styles '(:hides-on-deactivate :borderless
                        :always-on-top :movable-by-window-background)

in my toolbar's interface definition, I get the desired behavior.

But, of course, there's a caveat ...

Unlike the LispWorks toolbar, the client's application requires that 
we include a text-input-choice pane in the toolbar.  (The concept is 
similar to the input are in the Excel toolbar; eventually, like 
Excel, our application will also include in-cell editing of data in 
addition to the toolbar's editing pane.)

Imagine my surprise when I found that, while the text input pane 
appears in the toolbar, I can't type anything into it!

If I remove the :borderless attribute from the window styles, I can 
type into the text-input-choice pane in the toolbar window.  But now 
the toolbar window has a title bar and resize widget which is not 
acceptable to our client (or to us, for that matter).

Does anyone have any ideas on what to try now?  (I asked the client; 
moving the toolbar to the document windows isn't acceptable.)

   - Gary Palter
     Principal Software Engineer
     Clozure Associates
     Cell:  617-947-0536


Re: Toolbar won't accept input

At 11:28 PM -0500 3/22/04, Gary Palter wrote:
>We're building an application using LispWorks for Macintosh.
>
>Our client requires that the application have a single, global, 
>floating toolbar.  I found how to create such an entity by examining 
>the LispWorks podium toolbar (i.e., the interface of class 
>lispworks-tools::lispworks-toolbar-window) in the inspector.  I 
>found that if I specify
>
>       :window-styles '(:hides-on-deactivate :borderless
>                        :always-on-top :movable-by-window-background)
>
>in my toolbar's interface definition, I get the desired behavior.
>
>But, of course, there's a caveat ...
>
>Unlike the LispWorks toolbar, the client's application requires that 
>we include a text-input-choice pane in the toolbar.  (The concept is 
>similar to the input are in the Excel toolbar; eventually, like 
>Excel, our application will also include in-cell editing of data in 
>addition to the toolbar's editing pane.)
>
>Imagine my surprise when I found that, while the text input pane 
>appears in the toolbar, I can't type anything into it!
>
>If I remove the :borderless attribute from the window styles, I can 
>type into the text-input-choice pane in the toolbar window.  But now 
>the toolbar window has a title bar and resize widget which is not 
>acceptable to our client (or to us, for that matter).
>
>Does anyone have any ideas on what to try now?  (I asked the client; 
>moving the toolbar to the document windows isn't acceptable.)

After some investigation of the Apple documentation, I found that the 
behavior I'm seeing is the default behavior of Cocoa windows.  (I.e., 
a window cannot receive keyboard events unless it has a title bar or 
resize widget.  It can change that behavior by overriding the 
canBecomeKeyWindow method.)

On looking at Excel, I noticed that its toolbars have a thin title 
bar on the left edge with just a close button.  (Yes, I know Excel 
isn't Cocoa...)

Does anyone know if there's a way to have CAPI do something similar?

   - Gary Palter
     Principal Software Engineer
     Clozure Associates
     Cell:  617-947-0536


Updated at: 2020-12-10 08:57 UTC