Hi! I'm programming a software for a friend ( and that is a good excuse for me to work on squeak!), but i have (only one) trouble with prefab API.
It concernes the PrefabListBox thing! I think i've done all the stuff correctly( i think!) but it doesn't work.
Here is the code:
listBox is an instance variable and #listBox is the tag for my PrefabListBox.
In the initialize methode i have implemented: listBox := self clientWithTag: #listBox.
In the addSemanticActions methode i have implemented: listBox targetClicked: self; actionClicked: [Transcript show: ' listBox' ].
And when i click on an item of the liste, i got the error message:
ERROR: Argument count mismatch in response.
Does anybody can help me to sort that out.
Here my e-mail address:
dominiquerico@hotmail.com
thanks
_________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
On Fri, Jul 18, 2003 at 09:51:38AM +0000, Dominique RICO wrote:
Hi! I'm programming a software for a friend ( and that is a good excuse for me to work on squeak!), but i have (only one) trouble with prefab API.
It concernes the PrefabListBox thing! I think i've done all the stuff correctly( i think!) but it doesn't work.
In the addSemanticActions methode i have implemented: listBox targetClicked: self; actionClicked: [Transcript show: 'listBox' ].
And when i click on an item of the liste, i got the error message:
Your problem is that the BlockContext you're passing to #actionClicked: needs to take an argument. When you click on an entry, the response gets, as an argument, the tag associated with that entry. That way, you know which entry was clicked.
Try changing it to:
listBox actionClicked: [ :tag | Transcript show: 'listBox ', tag printString].
(The tags are explained in the PrefabListBox class comment and the comment preceding its #at:put: method.)
BTW, note that you don't need to set a target (via #targetClicked:) if you're using a BlockContext as the action. It's only there if you give action*: a message to send to target*:.
--Chris
squeak-dev@lists.squeakfoundation.org