From: Sunil Mishra
Subject: Frustrated by clim activation gestures
Date: 
Message-ID: <39ADDEA2.2030800@everest.com>
I've tried everything I could think of, but I can't figure out some of 
the details of accepting-values dialogs in CLIM. I am *praying* that 
someone here will be able to help me out.

Consider this:

(accepting-values (stream)
(accept 'string :stream stream :prompt "Yes?"))

If you enter some text into the dialog that is displayed and click on 
the OK button, unexpectedly enough, you get back "" from accept. Not 
good. What I would *like* to see is the text that was typed in. And you 
have to enter text followed by the :newline activation gesture to have 
the entered text accepted. This is error prone, to say the least.

I would like my dialogs to behave like any other PC or Mac dialog out 
there -- you should get back from accept what you typed in, regardless 
of whether you have hit your return key after typing it in. I have been 
through the CLIM spec and the symbolics clim book, with no clue toward a 
fix. The first thing that popped into my head was to define a gesture 
that was the equivalent of :select'ing the OK button. Unfortunately, 
there is little documentation on what that gesture would look like. And 
it is not even clear if anything other than the current input field 
would be accepted even if I *did* enter that OK button activation gesture.

A plea to the free clim effort: please make it obvious how to get 
"modern" gui like behavior on input editing :-)

I'm using lispworks 4.1 and CLIM on linux.

Thanks,

Sunil

From: John Watton
Subject: Re: Frustrated by clim activation gestures
Date: 
Message-ID: <8olf7g$48b$1@nnrp1.deja.com>
In article <················@everest.com>,
  Sunil Mishra <············@everest.com> wrote:
> I've tried everything I could think of, but I can't figure out some
of
> the details of accepting-values dialogs in CLIM. I am *praying* that
> someone here will be able to help me out.
>
> Consider this:
>
> (accepting-values (stream)
> (accept 'string :stream stream :prompt "Yes?"))
>

Usually folks do something like:

(let ((answer ""))
  (accepting-values (stream)
    (setq answer (accept 'string :stream stream :prompt "Yes?" :default
answer)))
 answer)

Accepting-values can take on multiple accept's and therefore sensibly
returns nil.

As for newline needed for the string to take - that is not my
experience.  Use tab to get values to take and newline to activate the
OK button. At least that is how ACL's Clim works. Instead of the Clim
manual I recommend the Clim examples/demos which should come in source
form with Clim.

--
John Watton
Alcoa Inc.


Sent via Deja.com http://www.deja.com/
Before you buy.
From: Sunil Mishra
Subject: Re: Frustrated by clim activation gestures
Date: 
Message-ID: <39AEAA2C.4040803@everest.com>
John Watton wrote:

> In article <················@everest.com>,
>   Sunil Mishra <············@everest.com> wrote:
> > I've tried everything I could think of, but I can't figure out some
> of
> > the details of accepting-values dialogs in CLIM. I am *praying* that
> > someone here will be able to help me out.
> >
> > Consider this:
> >
> > (accepting-values (stream)
> > (accept 'string :stream stream :prompt "Yes?"))
> >
> 
> Usually folks do something like:
> 
> (let ((answer ""))
>   (accepting-values (stream)
>     (setq answer (accept 'string :stream stream :prompt "Yes?" :default
> answer)))
>  answer)
> 
> Accepting-values can take on multiple accept's and therefore sensibly
> returns nil.
> 
> As for newline needed for the string to take - that is not my
> experience.  Use tab to get values to take and newline to activate the
> OK button. At least that is how ACL's Clim works. Instead of the Clim
> manual I recommend the Clim examples/demos which should come in source
> form with Clim.
> 
> --
> John Watton
> Alcoa Inc.
> 
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.

I'm using accepting-values almost exactly as you have given above. I 
decided to throw in the abriged version for the ng.

Sounds like accepting-values (and perhaps the activation gestures) are 
implemented differently in ACL and lispworks. I wasn't certain if this 
was something I ought to bother lispworks support with, but now I'm 
beginning to think that is the right thing to do.

I have been heavily relying on the demo examples that come with CLIM, 
and I have also gotten my hands on clasp from umass amherst as an 
example of a more subtantial clim interface. All these resources have 
been absolutely invaluable in figuring out some of the details of CLIM, 
but I am still far from having any real understanding of what CLIM is 
doing under the covers. Which would be necessary for me to get around 
this activation gestures debacle.

Sunil
From: Kent M Pitman
Subject: Re: Frustrated by clim activation gestures
Date: 
Message-ID: <sfwlmxdqkbz.fsf@world.std.com>
John Watton <···········@alcoa.com> writes:

> Usually folks do something like:
> 
> (let ((answer ""))
>   (accepting-values (stream)
>     (setq answer (accept 'string 
>                          :stream stream
>                          :prompt "Yes?"
>                          :default answer)))
>   answer)

Importantly, they should do this (use a temporary) even when there is
an already-existing "place" that you are editing.  e.g., 

 NOT  (accepting-values (stream)
 NOT    (setf (name frob) (accept 'string ... :default (name frob))))

but instead

      (let ((name (name frob)))
        (accepting-values (stream)
          (setq name (accept 'string ... :default name)))
        (setf (name frob) name))

In this way, if an "abort" is done in the middle of the accepting values,
the changes are not permanent.  In fact, it's fairly easy to make a macro like

 (let-tentatively ((var1 form1) ...)
   ...)

which arranges to do the setf's at the end so you don't have to write them
explicitly.