Capi Question

This is a discussion on Capi Question within the lisp forums in Programming Languages category; I am trying to set the value of an option-pane, yet when I try the examples in the book, which use numbers instead of a string, it works. However it does not work when I... ************************************************** ******* (setf MyList (list "Ron" "Paul" "John")) (setf EmployeeFlyout (make-instance 'option-pane :items MyList :visible-max-width '(:character 30) :selection-callback 'SelectedEmployee :callback-type :data :title "Employee:")) (contain EmployeeFlyout) (capi:apply-in-pane-process EmployeeFlyout #'(setf capi:choice- selected-item) "Paul" EmployeeFlyout) ************************************************** ******* I know I'm missing something. What am I doing wrong? William...

Go Back   Application Development Forum > Programming Languages > lisp

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 06-12-2008, 02:01 PM
Jacobite1607
Guest
 
Default Capi Question

I am trying to set the value of an option-pane, yet when I try the
examples in the book, which use numbers instead of a string, it works.
However it does not work when I...
************************************************** *******
(setf MyList (list "Ron" "Paul" "John"))

(setf EmployeeFlyout (make-instance 'option-pane
:items MyList
:visible-max-width '(:character
30)
:selection-callback
'SelectedEmployee
:callback-type :data
:title "Employee:"))

(contain EmployeeFlyout)

(capi:apply-in-pane-process EmployeeFlyout #'(setf capi:choice-
selected-item)
"Paul" EmployeeFlyout)
************************************************** *******
I know I'm missing something. What am I doing wrong?

William
Reply With Quote
  #2  
Old 06-12-2008, 02:33 PM
John Thingstad
Guest
 
Default Re: Capi Question

På Thu, 12 Jun 2008 20:01:53 +0200, skrev Jacobite1607
<Jacobite1607@gmail.com>:

> I am trying to set the value of an option-pane, yet when I try the
> examples in the book, which use numbers instead of a string, it works.
> However it does not work when I...
> ************************************************** *******
> (setf MyList (list "Ron" "Paul" "John"))
>
> (setf EmployeeFlyout (make-instance 'option-pane
> :items MyList
> :visible-max-width '(:character
> 30)
> :selection-callback
> 'SelectedEmployee
> :callback-type :data
> :title "Employee:"))
>
> (contain EmployeeFlyout)
>
> (capi:apply-in-pane-process EmployeeFlyout #'(setf capi:choice-
> selected-item)
> "Paul" EmployeeFlyout)
> ************************************************** *******
> I know I'm missing something. What am I doing wrong?
>
> William


CAPI questions are better directed to lisp_hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

--------------
John Thingstad
Reply With Quote
  #3  
Old 06-12-2008, 02:36 PM
Geoffrey Summerhayes
Guest
 
Default Re: Capi Question

On Jun 12, 2:01*pm, Jacobite1607 <Jacobite1...@gmail.com> wrote:
> I am trying to set the value of an option-pane, yet when I try the
> examples in the book, which use numbers instead of a string, it works.
> However it does not work when I...
> ************************************************** *******
> (setf MyList (list "Ron" "Paul" "John"))
>
> (setf EmployeeFlyout (make-instance 'option-pane
> * * * * * * * * * * * * * * * * * * * :items MyList
> * * * * * * * * * * * * * * * * * * * :visible-max-width '(:character
> 30)
> * * * * * * * * * * * * * * * * * * * :selection-callback
> 'SelectedEmployee
> * * * * * * * * * * * * * * * * * * * :callback-type :data
> * * * * * * * * * * * * * * * * * * * :title "Employee:"))
>
> (contain EmployeeFlyout)
>
> (capi:apply-in-pane-process EmployeeFlyout #'(setf capi:choice-
> selected-item)
> *"Paul" EmployeeFlyout)
> ************************************************** *******
> I know I'm missing something. What am I doing wrong?


From the look of it, I'd say the capi package qualifier
on option-pane and contain.

---
Geoff
Reply With Quote
  #4  
Old 06-12-2008, 03:19 PM
Simon Katz
Guest
 
Default Re: Capi Question

On Thu, 12 Jun 2008 11:01:53 -0700 (PDT), Jacobite1607
<Jacobite1607@gmail.com> wrote:

>I am trying to set the value of an option-pane, yet when I try the
>examples in the book, which use numbers instead of a string, it works.
>However it does not work when I...
>************************************************* ********
>(setf MyList (list "Ron" "Paul" "John"))
>
>(setf EmployeeFlyout (make-instance 'option-pane
> :items MyList
> :visible-max-width '(:character
>30)
> :selection-callback
>'SelectedEmployee
> :callback-type :data
> :title "Employee:"))
>
>(contain EmployeeFlyout)
>
>(capi:apply-in-pane-process EmployeeFlyout #'(setf capi:choice-
>selected-item)
> "Paul" EmployeeFlyout)
>************************************************* ********
>I know I'm missing something. What am I doing wrong?
>
>William



You need to add
:test-function #'equal
to the make-instance call, otherwise EQ or EQL is used (I'm not sure
which) and that doesn't do what you want for strings.

(And as John said, LispWorks-specific questions are best asked on
the LW-specific list.)

___________________
Real email address:
(substitute #\@ #\+ (substitute #\s #\! "u!enet001+nomi!tech.com"))
Reply With Quote
  #5  
Old 06-12-2008, 04:11 PM
Jacobite1607
Guest
 
Default Re: Capi Question

> You need to add
> * * :test-function #'equal
> to the make-instance call, otherwise EQ or EQL is used (I'm not sure
> which) and that doesn't do what you want for strings.


Excellent, thank you! That worked like a champ.

>
> (And as John said, LispWorks-specific questions are best asked on
> the LW-specific list.)


I did actually send the question to them, at the same time I posted
here it has yet to appear. I have sent a question to their gmane list
in the past and it went through successfully so who knows why. Even
with all the spam on this group it's still better than gmane.

Thanks,

William

Reply With Quote
  #6  
Old 06-12-2008, 04:30 PM
Rainer Joswig
Guest
 
Default Re: Capi Question

In article
<7e16119e-65ba-44ae-92c7-eac939f69d0a@z72g2000hsb.googlegroups.com>,
Jacobite1607 <Jacobite1607@gmail.com> wrote:

> > You need to add
> > * * :test-function #'equal
> > to the make-instance call, otherwise EQ or EQL is used (I'm not sure
> > which) and that doesn't do what you want for strings.

>
> Excellent, thank you! That worked like a champ.
>
> >
> > (And as John said, LispWorks-specific questions are best asked on
> > the LW-specific list.)

>
> I did actually send the question to them, at the same time I posted
> here it has yet to appear. I have sent a question to their gmane list
> in the past and it went through successfully so who knows why. Even
> with all the spam on this group it's still better than gmane.
>
> Thanks,
>
> William


Gmane is a different system unrelated to LispWorks (the company).
Gmane makes many mailing lists accessible.

But if you want to post, it is best to use the LISP-HUG mailing
list directly. Read here how you can subscribe:
http://www.lispworks.com/support/lisp-hug.html

--
http://lispm.dyndns.org/
Reply With Quote
  #7  
Old 06-19-2008, 11:24 AM
Jacobite1607
Guest
 
Default Re: Capi Question

> But if you want to post, it is best to use the LISP-HUG mailing
> list directly. Read here how you can subscribe:http://www.lispworks.com/support/lisp-hug.html


After my post here I checked and found that I was mistaken about
posting on Lisp-hug in the past. Someone from Lispworks contacted me
and found that my email was being formatted with a line break and
therefore I wasn't properly registered. The problem has been
corrected.

Thanks for everyone's help.

William
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 11:16 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.