Lisp HUG Maillist Archive

TEXT-INPUT-PANE with text selected?

Hmm, I'm probably missing something obvious again but I can't find it
at the moment: Is there a way to present a text input pane to the user
with the text already selected (so that he just has to press the
Backspace key to delete the text)?

Thanks,
Edi.


Re: TEXT-INPUT-PANE with text selected?

On Nov 27, 2005, at 4:26 PM, Edi Weitz wrote:

> Hmm, I'm probably missing something obvious again but I can't find it
> at the moment: Is there a way to present a text input pane to the user
> with the text already selected (so that he just has to press the
> Backspace key to delete the text)?
>
> Thanks,
> Edi.
>
>

Did you try set-text-input-pane-selection?

You're welcome!

Laughing Water


Re: TEXT-INPUT-PANE with text selected?

On Sun, 27 Nov 2005 17:09:19 -0700, Laughing Water <lw@mt.net> wrote:

> Did you try set-text-input-pane-selection?

Thanks, that was the one that didn't occur to me last night.  However,
if I write something like this:

  (capi:define-interface foo-interface ()
    ()
    (:panes
     (text-input-pane
      capi:text-input-pane
      :text "Something"
      :accessor text-input-pane))
    (:default-initargs
     :create-callback (lambda (interface)
                        (let* ((pane (text-input-pane interface))
                               (text (capi:text-input-pane-text pane)))
                          (capi:set-text-input-pane-selection pane
                                                              0
                                                              (length text))))))

then instances of FOO-INTERFACE will /not/ have the text initially
selected as expected (at least with LWW 4.4.6).  I tried replacing the
create callback with an :AFTER method on CAPI:INTERFACE-DISPLAY but
that also didn't help.

Is this a timing problem?  A bug?  Any other ideas?

Thanks,
Edi.


Re: TEXT-INPUT-PANE with text selected?

On mac OS 10.4 it works find, even without the create-callback (when only
one text-input-pane).
With several panes, the function set-pane-focus determine witch text is
completely selected.

(capi:define-interface foo-interface ()
  ()
  (:panes
   (text-input-pane1
    capi:text-input-pane
    :text "Something"
    :accessor text-input-pane1)
   (text-input-pane2
    capi:text-input-pane
    :text "Something"
    :accessor text-input-pane2)))

(let ((interface (mki 'foo-interface)))
  (display interface)
  (set-pane-focus (text-input-pane2 interface)))

Denis

Le 28/11/05 10:48, « Edi Weitz » <edi@agharta.de> a écrit :

> On Sun, 27 Nov 2005 17:09:19 -0700, Laughing Water <lw@mt.net> wrote:
> 
>> Did you try set-text-input-pane-selection?
> 
> Thanks, that was the one that didn't occur to me last night.  However,
> if I write something like this:
> 
> (capi:define-interface foo-interface ()
>   ()
>   (:panes
>    (text-input-pane
>     capi:text-input-pane
>     :text "Something"
>     :accessor text-input-pane))
>   (:default-initargs
>    :create-callback (lambda (interface)
>                       (let* ((pane (text-input-pane interface))
>                              (text (capi:text-input-pane-text pane)))
>                         (capi:set-text-input-pane-selection pane
>                                                             0
>                                                             (length text))))))
> 
> then instances of FOO-INTERFACE will /not/ have the text initially
> selected as expected (at least with LWW 4.4.6).  I tried replacing the
> create callback with an :AFTER method on CAPI:INTERFACE-DISPLAY but
> that also didn't help.
> 
> Is this a timing problem?  A bug?  Any other ideas?
> 
> Thanks,
> Edi.
> 
> 



----------------------------------------------------
Denis Pousseur
6 clos du Drossart
1180 Bruxelles, Belgique

Mail :  denis.pousseur@compositeurs.be
Website : http://compositeurs.be
----------------------------------------------------




Re: TEXT-INPUT-PANE with text selected?

On Mon, 28 Nov 2005 11:23:51 +0100, Denis Pousseur <denis.pousseur@compositeurs.be> wrote:

> On mac OS 10.4 it works find, even without the create-callback (when
> only one text-input-pane).  With several panes, the function
> set-pane-focus determine witch text is completely selected.
>
> (capi:define-interface foo-interface ()
>   ()
>   (:panes
>    (text-input-pane1
>     capi:text-input-pane
>     :text "Something"
>     :accessor text-input-pane1)
>    (text-input-pane2
>     capi:text-input-pane
>     :text "Something"
>     :accessor text-input-pane2)))
>
> (let ((interface (mki 'foo-interface)))
>   (display interface)
>   (set-pane-focus (text-input-pane2 interface)))

Hmm, that doesn't seem to work for me on Windows.  Actually, I know a
couple of Windows apps which work that way - edit the address in
Firefox, switch to another app and back to Firefox, now the whole text
is selected.  But with LispWorks it's not like that.

Thanks,
Edi.


Re: TEXT-INPUT-PANE with text selected?

On Mon, 28 Nov 2005 17:59:17 +0300, "Dmitriy Ivanov" <divanov@aha.ru> wrote:

> Timing. The following should work (inspired by Wade):

Yep, that works fine.

Thanks a lot,
Edi.


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