Sorry, but it's too late now for me to read spanish :s Can you provide an "english" version of this please ? Ben On Feb 2, 2013, at 7:54 PM, J. P. L. MartÃn <arguser@gmail.com> wrote:
I'm not sure how should I, for making the GUI we mainly based on the ContactList example on PharoCasts: http://www.pharocasts.com/2011/02/pharo-gui-with-polymorph.html This is my child window:
UIPrestamos>>openModal
openModal | builder content dialog | prestamo id: (Prestamo database size = 0 ifTrue: 1 ifFalse: [Prestamo database last id + 1]) asString. builder := UITheme builder. content := builder newLabelGroup: {('Prestamo: ' -> (builder newLabelFor: self prestamo getLabel: #id getEnabled: nil )). ('Socio ' -> (builder newTextEntryFor: self prestamo getText: #idSocio setText: #idSocio: help: 'Codigo de Socio')). ('Ejemplar: ' -> (builder newTextEntryFor: self prestamo getText: #idEjemplar setText: #idEjemplar: help: 'Codigo de Ejemplar'))}. dialog := builder newPluggableDialogWindow: 'Nuevo Prestamo' for: content. builder openModal: dialog. dialog cancelled ifFalse: [self doOnOK].
---- Which is called this way:
UIBabel>>addPrestamo
addPrestamo | prestamo alerta | prestamo := Prestamo new. alerta := AlertDialogWindow new. UIPrestamos new prestamo: prestamo; onOK: [ ((Ejemplar database anySatisfy: [:x | x idEjemplar = prestamo idEjemplar and: (x fechaBaja = '') ]) and: (Socio database anySatisfy: [:y| y numeroDeSocio = prestamo idSocio])) ifTrue: [Prestamo database add: prestamo] ifFalse: [alerta alert: 'El socio o el ejemplar no se encuentra disponible']. seleccionado := Prestamo database size. self changed: #listado; changed: #selecciono ]; openModal.
---- I've also found another way to show lists, using GridMorph instead of the current PluggableMultiColumnList, sadly it look really hard and lot of refactor should be done :(
* Block a father window when a child is made, so the father window can't be closed if a child window exist.
childerWindow openModal: fatherWindow