[Pharo-project] UITheme builder, change newList list onButtonClick
Hello, I'm having trouble to figure out how to do this, I have a simple window with 3 buttons, each button should change the content listed on the list below them but I'm really not sure about how to do it. This is the code for the window: --- open "Abre la ventana principal del Sistema de Gestion Bibleotecaria" | builder contain | builder := UITheme builder. contain := builder newColumn: {builder newRow: { builder newButtonFor: self action: #onPrestamosClick label: 'Prestamos' help: ''. builder newButtonFor: self action: #onMaterialesClick label: 'Materiales' help: ''. builder newButtonFor: self action: #onSociosClick label: 'Socios' help: ''}. builder newColumn: { builder newListFor: self list: nil selected: nil changeSelected: nil help: '' }.}. (contain openInWindowLabeled: 'Babel') extent: 600@600. --- How should I define #onLabelClick to set the list to for example: Prestamo database. Thanks in advance.
Quick question: what's with all the curly braces? This doesn't look much like Smalltalk code to me :-P -- Cheers, Peter. On 2 jan 2013, at 10:02, J. P. L. MartÃn <arguser@gmail.com> wrote:
Hello, I'm having trouble to figure out how to do this, I have a simple window with 3 buttons, each button should change the content listed on the list below them but I'm really not sure about how to do it.
This is the code for the window: --- open "Abre la ventana principal del Sistema de Gestion Bibleotecaria"
| builder contain | builder := UITheme builder. contain := builder newColumn: {builder newRow: { builder newButtonFor: self action: #onPrestamosClick label: 'Prestamos' help: ''. builder newButtonFor: self action: #onMaterialesClick label: 'Materiales' help: ''. builder newButtonFor: self action: #onSociosClick label: 'Socios' help: ''}. builder newColumn: { builder newListFor: self list: nil selected: nil changeSelected: nil help: '' }.}.
(contain openInWindowLabeled: 'Babel') extent: 600@600. ---
How should I define #onLabelClick to set the list to for example: Prestamo database.
Thanks in advance.
On 2 January 2013 09:09, Peter Hugosson-Miller <oldmanlink@gmail.com> wrote:
Quick question: what's with all the curly braces? This doesn't look much like Smalltalk code to me :-P
I don't know how much this is tongue-in-cheek: assuming none ( :) ), it's a literal Array assembled by sending messages, as opposed to the other kind of literal Array: #(1 (2 3)) = Array with: 1 with: (Array with: 2 with: 3). frank
-- Cheers, Peter.
On 2 jan 2013, at 10:02, J. P. L. MartÃn <arguser@gmail.com> wrote:
Hello, I'm having trouble to figure out how to do this, I have a simple window with 3 buttons, each button should change the content listed on the list below them but I'm really not sure about how to do it.
This is the code for the window: --- open "Abre la ventana principal del Sistema de Gestion Bibleotecaria"
| builder contain | builder := UITheme builder. contain := builder newColumn: {builder newRow: { builder newButtonFor: self action: #onPrestamosClick label: 'Prestamos' help: ''. builder newButtonFor: self action: #onMaterialesClick label: 'Materiales' help: ''. builder newButtonFor: self action: #onSociosClick label: 'Socios' help: ''}. builder newColumn: { builder newListFor: self list: nil selected: nil changeSelected: nil help: '' }.}.
(contain openInWindowLabeled: 'Babel') extent: 600@600. ---
How should I define #onLabelClick to set the list to for example: Prestamo database.
Thanks in advance.
Actually the code of the GUI is inspired on the Pharocast video on the making of a Contact list. I wonder if the list is static since is defined there as a newListFor and because that you can't send any message to it, I'm sure there should be a way to do it so #onPrestamosClick look like: --- #onPrestamosClick listMorph list: Prestamo database. --- or something like that. On Wed, Jan 2, 2013 at 6:12 AM, Frank Shearar <frank.shearar@gmail.com>wrote:
On 2 January 2013 09:09, Peter Hugosson-Miller <oldmanlink@gmail.com> wrote:
Quick question: what's with all the curly braces? This doesn't look much like Smalltalk code to me :-P
I don't know how much this is tongue-in-cheek: assuming none ( :) ), it's a literal Array assembled by sending messages, as opposed to the other kind of literal Array: #(1 (2 3)) = Array with: 1 with: (Array with: 2 with: 3).
frank
-- Cheers, Peter.
On 2 jan 2013, at 10:02, J. P. L. MartÃn <arguser@gmail.com> wrote:
Hello, I'm having trouble to figure out how to do this, I have a simple window with 3 buttons, each button should change the content listed on the list below them but I'm really not sure about how to do it.
This is the code for the window: --- open "Abre la ventana principal del Sistema de Gestion Bibleotecaria"
| builder contain | builder := UITheme builder. contain := builder newColumn: {builder newRow: { builder newButtonFor: self action: #onPrestamosClick label: 'Prestamos' help: ''. builder newButtonFor: self action: #onMaterialesClick label: 'Materiales' help: ''. builder newButtonFor: self action: #onSociosClick label: 'Socios' help: ''}. builder newColumn: { builder newListFor: self list: nil selected: nil changeSelected: nil help: '' }.}.
(contain openInWindowLabeled: 'Babel') extent: 600@600. ---
How should I define #onLabelClick to set the list to for example: Prestamo database.
Thanks in advance.
I wasn't being ironic, I just didn't know. In my 18 years of Smalltalk programming, I've managed to avoid coming across that particular syntax before. Is it Pharo-specific? -- Cheers, Peter. On 2 jan 2013, at 10:12, Frank Shearar <frank.shearar@gmail.com> wrote:
On 2 January 2013 09:09, Peter Hugosson-Miller <oldmanlink@gmail.com> wrote:
Quick question: what's with all the curly braces? This doesn't look much like Smalltalk code to me :-P
I don't know how much this is tongue-in-cheek: assuming none ( :) ), it's a literal Array assembled by sending messages, as opposed to the other kind of literal Array: #(1 (2 3)) = Array with: 1 with: (Array with: 2 with: 3).
frank
-- Cheers, Peter.
On 2 jan 2013, at 10:02, J. P. L. MartÃn <arguser@gmail.com> wrote:
Hello, I'm having trouble to figure out how to do this, I have a simple window with 3 buttons, each button should change the content listed on the list below them but I'm really not sure about how to do it.
This is the code for the window: --- open "Abre la ventana principal del Sistema de Gestion Bibleotecaria"
| builder contain | builder := UITheme builder. contain := builder newColumn: {builder newRow: { builder newButtonFor: self action: #onPrestamosClick label: 'Prestamos' help: ''. builder newButtonFor: self action: #onMaterialesClick label: 'Materiales' help: ''. builder newButtonFor: self action: #onSociosClick label: 'Socios' help: ''}. builder newColumn: { builder newListFor: self list: nil selected: nil changeSelected: nil help: '' }.}.
(contain openInWindowLabeled: 'Babel') extent: 600@600. ---
How should I define #onLabelClick to set the list to for example: Prestamo database.
Thanks in advance.
On Jan 2, 2013, at 10:25 AM, Peter Hugosson-Miller <oldmanlink@gmail.com> wrote:
I wasn't being ironic, I just didn't know. In my 18 years of Smalltalk programming, I've managed to avoid coming across that particular syntax before. Is it Pharo-specific?
It was introduced in Squeak quite early (before 2000). Marcus
Guess it's a bit like the ##(some expression here) of VisualAge Smalltalk? -- Cheers, Peter. On 2 jan 2013, at 10:27, Marcus Denker <marcus.denker@inria.fr> wrote:
On Jan 2, 2013, at 10:25 AM, Peter Hugosson-Miller <oldmanlink@gmail.com> wrote:
I wasn't being ironic, I just didn't know. In my 18 years of Smalltalk programming, I've managed to avoid coming across that particular syntax before. Is it Pharo-specific? It was introduced in Squeak quite early (before 2000).
Marcus
On 2 January 2013 09:52, Peter Hugosson-Miller <oldmanlink@gmail.com> wrote:
Guess it's a bit like the ##(some expression here) of VisualAge Smalltalk?
I think so, but I've only seen ##(foo) in GNU Smalltalk, where it's a compile-time literal: http://www.gnu.org/software/smalltalk/manual/gst.html frank
-- Cheers, Peter.
On 2 jan 2013, at 10:27, Marcus Denker <marcus.denker@inria.fr> wrote:
On Jan 2, 2013, at 10:25 AM, Peter Hugosson-Miller <oldmanlink@gmail.com> wrote:
I wasn't being ironic, I just didn't know. In my 18 years of Smalltalk programming, I've managed to avoid coming across that particular syntax before. Is it Pharo-specific? It was introduced in Squeak quite early (before 2000).
Marcus
Sorry for hijacking the thread, I just wanted to be sure I understood it properly. So now I think it's a kind of syntactical sugar for a nicer way of writing: Array with: (builder newButtonFor: self action: #onPrestamosClick label: 'Prestamos' help: '') with: (builder newButtonFor: self action: #onMaterialesClick label: 'Materiales' help: '') with: (builder newButtonFor: self action: #onSociosClick label: 'Socios' help: '') Does that sound like a good explanation? -- Cheers, Peter On Wed, Jan 2, 2013 at 11:15 AM, Frank Shearar <frank.shearar@gmail.com>wrote:
On 2 January 2013 09:52, Peter Hugosson-Miller <oldmanlink@gmail.com> wrote:
Guess it's a bit like the ##(some expression here) of VisualAge Smalltalk?
I think so, but I've only seen ##(foo) in GNU Smalltalk, where it's a compile-time literal: http://www.gnu.org/software/smalltalk/manual/gst.html
frank
-- Cheers, Peter.
On 2 jan 2013, at 10:27, Marcus Denker <marcus.denker@inria.fr> wrote:
On Jan 2, 2013, at 10:25 AM, Peter Hugosson-Miller <
oldmanlink@gmail.com> wrote:
I wasn't being ironic, I just didn't know. In my 18 years of Smalltalk
programming, I've managed to avoid coming across that particular syntax before. Is it Pharo-specific?
It was introduced in Squeak quite early (before 2000).
Marcus
On 2 January 2013 10:39, Peter Hugosson-Miller <oldmanlink@gmail.com> wrote:
Sorry for hijacking the thread, I just wanted to be sure I understood it properly.
So now I think it's a kind of syntactical sugar for a nicer way of writing:
Array with: (builder newButtonFor: self action: #onPrestamosClick label: 'Prestamos' help: '') with: (builder newButtonFor: self action: #onMaterialesClick label: 'Materiales' help: '') with: (builder newButtonFor: self action: #onSociosClick label: 'Socios' help: '')
Does that sound like a good explanation?
Yes. frank
-- Cheers, Peter
On Wed, Jan 2, 2013 at 11:15 AM, Frank Shearar <frank.shearar@gmail.com> wrote:
On 2 January 2013 09:52, Peter Hugosson-Miller <oldmanlink@gmail.com> wrote:
Guess it's a bit like the ##(some expression here) of VisualAge Smalltalk?
I think so, but I've only seen ##(foo) in GNU Smalltalk, where it's a compile-time literal: http://www.gnu.org/software/smalltalk/manual/gst.html
frank
-- Cheers, Peter.
On 2 jan 2013, at 10:27, Marcus Denker <marcus.denker@inria.fr> wrote:
On Jan 2, 2013, at 10:25 AM, Peter Hugosson-Miller <oldmanlink@gmail.com> wrote:
I wasn't being ironic, I just didn't know. In my 18 years of Smalltalk programming, I've managed to avoid coming across that particular syntax before. Is it Pharo-specific? It was introduced in Squeak quite early (before 2000).
Marcus
2013/1/2 Frank Shearar <frank.shearar@gmail.com>:
On 2 January 2013 09:52, Peter Hugosson-Miller <oldmanlink@gmail.com> wrote:
Guess it's a bit like the ##(some expression here) of VisualAge Smalltalk?
I think so, but I've only seen ##(foo) in GNU Smalltalk, where it's a compile-time literal: http://www.gnu.org/software/smalltalk/manual/gst.html
Dolphin Smalltalk also uses this, to avoid recalculation of constants, but preserving the readability of code. http://www.object-arts.com/downloads/docs/index.html?constantaccessmethod.ht... Regards! Esteban A. Maringolo
could another way be on button action set a temporal variable "list"? for newListFor. On Wed, Jan 2, 2013 at 6:02 AM, J. P. L. MartÃn <arguser@gmail.com> wrote:
Hello, I'm having trouble to figure out how to do this, I have a simple window with 3 buttons, each button should change the content listed on the list below them but I'm really not sure about how to do it.
This is the code for the window: --- open "Abre la ventana principal del Sistema de Gestion Bibleotecaria"
| builder contain | builder := UITheme builder. contain := builder newColumn: {builder newRow: { builder newButtonFor: self action: #onPrestamosClick label: 'Prestamos' help: ''. builder newButtonFor: self action: #onMaterialesClick label: 'Materiales' help: ''. builder newButtonFor: self action: #onSociosClick label: 'Socios' help: ''}. builder newColumn: { builder newListFor: self list: nil selected: nil changeSelected: nil help: '' }.}.
(contain openInWindowLabeled: 'Babel') extent: 600@600. ---
How should I define #onLabelClick to set the list to for example: Prestamo database.
Thanks in advance.
Another question, when I try this: Prestamo database collect: [:x | x id,' ',x idMaterial] I get Receiver of "," nil. How do I solve it? On Wed, Jan 2, 2013 at 9:33 AM, J. P. L. MartÃn <arguser@gmail.com> wrote:
could another way be on button action set a temporal variable "list"? for newListFor.
On Wed, Jan 2, 2013 at 6:02 AM, J. P. L. MartÃn <arguser@gmail.com> wrote:
Hello, I'm having trouble to figure out how to do this, I have a simple window with 3 buttons, each button should change the content listed on the list below them but I'm really not sure about how to do it.
This is the code for the window: --- open "Abre la ventana principal del Sistema de Gestion Bibleotecaria"
| builder contain | builder := UITheme builder. contain := builder newColumn: {builder newRow: { builder newButtonFor: self action: #onPrestamosClick label: 'Prestamos' help: ''. builder newButtonFor: self action: #onMaterialesClick label: 'Materiales' help: ''. builder newButtonFor: self action: #onSociosClick label: 'Socios' help: ''}. builder newColumn: { builder newListFor: self list: nil selected: nil changeSelected: nil help: '' }.}.
(contain openInWindowLabeled: 'Babel') extent: 600@600. ---
How should I define #onLabelClick to set the list to for example: Prestamo database.
Thanks in advance.
2013/1/2 J. P. L. MartÃn <arguser@gmail.com>:
Another question, when I try this:
Prestamo database collect: [:x | x id,' ',x idMaterial]
I get Receiver of "," nil. How do I solve it?
You probably have one or more elements in the collection returned by "Prestamo database" whose id's are nil. Then you're sending #, to a nil element. I would ensure all elements have an ID, or better than that I would delegate the printing responsibility to the element itself. It is: Prestamo database collect: [:x | x printIdAndMaterial] This way the testing of a nil id is done by the receiver. Regards, Esteban.
Thanks Esteban, I have another question. Some of the elements of Prestamo are Date objects, how can i collec them from database since they are not indexable? *btw, I'm trying to show them on a list. Thanks in advance! On Wed, Jan 2, 2013 at 11:18 AM, Esteban A. Maringolo <emaringolo@gmail.com>wrote:
2013/1/2 J. P. L. MartÃn <arguser@gmail.com>:
Another question, when I try this:
Prestamo database collect: [:x | x id,' ',x idMaterial]
I get Receiver of "," nil. How do I solve it?
You probably have one or more elements in the collection returned by "Prestamo database" whose id's are nil. Then you're sending #, to a nil element.
I would ensure all elements have an ID, or better than that I would delegate the printing responsibility to the element itself. It is: Prestamo database collect: [:x | x printIdAndMaterial]
This way the testing of a nil id is done by the receiver.
Regards,
Esteban.
Done, I've just append asString on the collect: block. :D On Wed, Jan 2, 2013 at 11:18 AM, Esteban A. Maringolo <emaringolo@gmail.com>wrote:
2013/1/2 J. P. L. MartÃn <arguser@gmail.com>:
Another question, when I try this:
Prestamo database collect: [:x | x id,' ',x idMaterial]
I get Receiver of "," nil. How do I solve it?
You probably have one or more elements in the collection returned by "Prestamo database" whose id's are nil. Then you're sending #, to a nil element.
I would ensure all elements have an ID, or better than that I would delegate the printing responsibility to the element itself. It is: Prestamo database collect: [:x | x printIdAndMaterial]
This way the testing of a nil id is done by the receiver.
Regards,
Esteban.
Yes, the concatenation method (it is, #,) works only with collections(*). There is no automatic casting of objects to a string representation. In the long run you'll love that. And since String "is a" Collection, you can't send #, to other object, and neither pass an argument that is not a collection. Hence the need of the "conversion"(**) to a String. (*) In some particular cases the #, method is implemented in non collection classes for convenience. (**) There is no conversion taking place, your object is returning another one, instance of String, that is supposed to represent it as a whole or some aspect of it. You might create the String every time the message is received or if it is its name, you just return it. ps: I don't know how this relates to the Morphic subject :) Esteban A. Maringolo 2013/1/2 J. P. L. MartÃn <arguser@gmail.com>:
Done, I've just append asString on the collect: block.
:D
On Wed, Jan 2, 2013 at 11:18 AM, Esteban A. Maringolo <emaringolo@gmail.com> wrote:
2013/1/2 J. P. L. MartÃn <arguser@gmail.com>:
Another question, when I try this:
Prestamo database collect: [:x | x id,' ',x idMaterial]
I get Receiver of "," nil. How do I solve it?
You probably have one or more elements in the collection returned by "Prestamo database" whose id's are nil. Then you're sending #, to a nil element.
I would ensure all elements have an ID, or better than that I would delegate the printing responsibility to the element itself. It is: Prestamo database collect: [:x | x printIdAndMaterial]
This way the testing of a nil id is done by the receiver.
Regards,
Esteban.
J. P. L. MartÃn wrote:
Hello, I'm having trouble to figure out how to do this, I have a simple window with 3 buttons, each button should change the content listed on the list below them but I'm really not sure about how to do it.
This is the code for the window: --- open "Abre la ventana principal del Sistema de Gestion Bibleotecaria"
| builder contain | builder := UITheme builder. contain := builder newColumn: {builder newRow: { builder newButtonFor: self action: #onPrestamosClick label: 'Prestamos' help: ''. builder newButtonFor: self action: #onMaterialesClick label: 'Materiales' help: ''. builder newButtonFor: self action: #onSociosClick label: 'Socios' help: ''}. builder newColumn: { builder newListFor: self list: nil selected: nil changeSelected: nil help: '' }.}.
(contain openInWindowLabeled: 'Babel') extent: 600@600. ---
How should I define #onLabelClick to set the list to for example: Prestamo database.
Thanks in advance.
J. P. L. MartÃn wrote:
Actually the code of the GUI is inspired on the Pharocast video on the making of a Contact list. I wonder if the list is static since is defined there as a newListFor and because that you can't send any message to it,
The #changed: method tells the list to get its contents again - see example below.
I'm sure there should be a way to do it so #onPrestamosClick look like: --- #onPrestamosClick listMorph list: Prestamo database. --- or something like that.
You didn't explicitly state your references, I presume you a referring to http://www.pharocasts.com/2011/02/pharo-gui-with-polymorph.html. Note that ContactManager-LaurentLaffront.1.mcz referred to from this post uses... |builder newListFor: self list: #contacts selected: #contactSelectedIndex changeSelected: #contactSelectedIndex: help: ''.| whereas you have... builder newListFor: self list: nil selected: nil changeSelected: nil help: '' which is the key part you are missing, where the (list: #contacts) defines the method to return the list contents, for example... --- #contacts ^ Contact database collect: [:aContact| ', ' join: {aContact lastName. aContact firstName} ]. --- You have defined your list contents as (list: nil), whereas if it was (list: #selectedDatabase) the following might work... --- #onPrestamosClick selectedDatabase := Prestamo database. self changed: #selectedDatabase. --- #selectedDatabase ^selectedDatabase. --- good luck, cheers -ben
I got everything working besides the list update when changed. Also, is there anyway to properly display data in columns? This is what i have: http://i.imgur.com/bwK2M.png On Wed, Jan 2, 2013 at 11:47 AM, Ben Coman <btc@openinworld.com> wrote:
J. P. L. MartÃn wrote:
Hello, I'm having trouble to figure out how to do this, I have a simple
window with 3 buttons, each button should change the content listed on the list below them but I'm really not sure about how to do it.
This is the code for the window: --- open "Abre la ventana principal del Sistema de Gestion Bibleotecaria"
| builder contain | builder := UITheme builder. contain := builder newColumn: {builder newRow: { builder newButtonFor: self action: #onPrestamosClick label: 'Prestamos' help: ''. builder newButtonFor: self action: #onMaterialesClick label: 'Materiales' help: ''. builder newButtonFor: self action: #onSociosClick label: 'Socios' help: ''}. builder newColumn: { builder newListFor: self list: nil selected: nil changeSelected: nil help: '' }.}.
(contain openInWindowLabeled: 'Babel') extent: 600@600. ---
How should I define #onLabelClick to set the list to for example: Prestamo database.
Thanks in advance.
J. P. L. MartÃn wrote:
Actually the code of the GUI is inspired on the Pharocast video on the making of a Contact list. I wonder if the list is static since is defined there as a newListFor and because that you can't send any message to it,
The #changed: method tells the list to get its contents again - see example below.
I'm sure there should be a way to do it so #onPrestamosClick look like: --- #onPrestamosClick listMorph list: Prestamo database. --- or something like that.
You didn't explicitly state your references, I presume you a referring to http://www.pharocasts.com/**2011/02/pharo-gui-with-**polymorph.html<http://www.pharocasts.com/2011/02/pharo-gui-with-polymorph.html> . Note that ContactManager-**LaurentLaffront.1.mcz referred to from this post uses...
|builder newListFor: self list: #contacts selected: #contactSelectedIndex changeSelected: #contactSelectedIndex: help: ''.|
whereas you have...
builder newListFor: self list: nil selected: nil changeSelected: nil help: '' which is the key part you are missing, where the (list: #contacts) defines the method to return the list contents, for example... --- #contacts ^ Contact database collect: [:aContact| ', ' join: {aContact lastName. aContact firstName} ]. ---
You have defined your list contents as (list: nil), whereas if it was (list: #selectedDatabase) the following might work... --- #onPrestamosClick
selectedDatabase := Prestamo database. self changed: #selectedDatabase. --- #selectedDatabase ^selectedDatabase.
---
good luck, cheers -ben
I only used Polymorph for the first time a couple of months ago. I don't really know what is available, but having a quick poke around what I found was: 1. If you follow the call-chain from UITheme>>newListFor:list:selected:changeSelected:help: you end up in UITheme>>newListIn:for: list: selected: changeSelected: getEnabled: help: which uses PluggableListMorph 2. There is also PluggableMultiColumnListMorph (read its comment) but if if you check "References" for it, it does not appear to be used by UITheme So the short answer seems to be - no, Polymorph doesn't out of the box support multi-column lists. The long answer - the components seem to be available for you to add multi-column-lists to Polymorph yourself - perhaps just replicating the call-chain from (1.) to end up using PluggableMultiColumnListMorph) cheers -ben J. P. L. MartÃn wrote:
I got everything working besides the list update when changed. Also, is there anyway to properly display data in columns? This is what i have: http://i.imgur.com/bwK2M.png
On Wed, Jan 2, 2013 at 11:47 AM, Ben Coman <btc@openinworld.com> wrote:
J. P. L. MartÃn wrote:
Hello, I'm having trouble to figure out how to do this, I have a simple
window with 3 buttons, each button should change the content listed on the list below them but I'm really not sure about how to do it.
This is the code for the window: --- open "Abre la ventana principal del Sistema de Gestion Bibleotecaria"
| builder contain | builder := UITheme builder. contain := builder newColumn: {builder newRow: { builder newButtonFor: self action: #onPrestamosClick label: 'Prestamos' help: ''. builder newButtonFor: self action: #onMaterialesClick label: 'Materiales' help: ''. builder newButtonFor: self action: #onSociosClick label: 'Socios' help: ''}. builder newColumn: { builder newListFor: self list: nil selected: nil changeSelected: nil help: '' }.}.
(contain openInWindowLabeled: 'Babel') extent: 600@600. ---
How should I define #onLabelClick to set the list to for example: Prestamo database.
Thanks in advance.
J. P. L. MartÃn wrote:
Actually the code of the GUI is inspired on the Pharocast video on the making of a Contact list. I wonder if the list is static since is defined there as a newListFor and because that you can't send any message to it,
The #changed: method tells the list to get its contents again - see example below.
I'm sure there should be a way to do it so #onPrestamosClick look like: --- #onPrestamosClick listMorph list: Prestamo database. --- or something like that.
You didn't explicitly state your references, I presume you a referring to http://www.pharocasts.com/**2011/02/pharo-gui-with-**polymorph.html<http://www.pharocasts.com/2011/02/pharo-gui-with-polymorph.html> . Note that ContactManager-**LaurentLaffront.1.mcz referred to from this post uses...
|builder newListFor: self list: #contacts selected: #contactSelectedIndex changeSelected: #contactSelectedIndex: help: ''.|
whereas you have...
builder newListFor: self list: nil selected: nil changeSelected: nil help: '' which is the key part you are missing, where the (list: #contacts) defines the method to return the list contents, for example... --- #contacts ^ Contact database collect: [:aContact| ', ' join: {aContact lastName. aContact firstName} ]. ---
You have defined your list contents as (list: nil), whereas if it was (list: #selectedDatabase) the following might work... --- #onPrestamosClick
selectedDatabase := Prestamo database. self changed: #selectedDatabase. --- #selectedDatabase ^selectedDatabase.
---
good luck, cheers -ben
participants (6)
-
Ben Coman -
Esteban A. Maringolo -
Frank Shearar -
J. P. L. MartÃn -
Marcus Denker -
Peter Hugosson-Miller