Re: :initial-focus initarg for interfaces
Paul, thanks for digging into this. The funny thing is that the code
where I originally saw these problems had an output pane WITH an input
model and it still didn't work. I believe there's some other issue
involved...
On Sun, Jan 27, 2013 at 7:59 PM, paul tarvydas <paultarvydas@gmail.com> wrote:
> The code below does not raise an error.
>
> I'd guess that a plain-jane output-pane does not qualify for getting focus,
> hence, the error. As soon as I added an input-model, it worked (there are
> probably a number of other things you could do with an output-pane that make
> it focus-able).
>
> pt
>
>
> (in-package :cl-user)
>
> (defun draw-input (self x y gspec)
> (let ((data (sys:gesture-spec-data gspec))
> (mods (sys:gesture-spec-modifiers gspec)))
> (gp:draw-string
> self
> (with-output-to-string (ss)
> (sys:print-pretty-gesture-spec
> gspec ss :force-shift-for-upcase nil))
> x y)))
>
> (capi:define-interface test-interface ()
> ()
> (:panes
> (main-pane
> capi:output-pane
> :input-model '((:gesture-spec draw-input)))
>
> (button
> capi:push-button
> :text "Whatever"))
> (:layouts
> (main-layout
> capi:column-layout
> '(main-pane button)))
> (:default-initargs
> :initial-focus 'main-pane))
>
> (defun test ()
> (capi:display (make-instance 'test-interface)))
>
>
>
> On Sun, Jan 27, 2013 at 1:04 PM, Edi Weitz <edi@weitz.de> wrote:
>>
>> On Sun, Jan 27, 2013 at 6:57 PM, paul tarvydas <paultarvydas@gmail.com>
>> wrote:
>>
>> > If I change it to ":initial-focus 'button", then there's no error.
>>
>> Strange.
>>
>> > "(setf pane-initial-focus) may be used to set the initial focus pane,
>> > but
>> > only before pane-with-children has been created. If the setter is called
>> > after pane-with-children has been created, an error is signalled."
>>
>> I would have hoped that the CAPI code took care of this if I'm allowed
>> to provide this initarg...
>
>
_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html