���
You might investigate using a Groupbox with a getContentSelector.
That way your model can replace the group content depending on your conditions.
 
A simple example is attached.
 
File in and doit on
 
ExampleModel new
 open;
 inspect
 
 
In the inspector bottom pane doit for:
 
self aVariable: #one
 
or
 
self aVariable: #two
 
or
 
self aVariable: #blank
 
(or anything else for that matter)
 
 
Your model should implement
a method that answers the content (morph) for the group depending on your conditions.
Doing "self changed: <selector>" (<selector> being the name of that method) in the model object
will cause the group to change its contents appropriately.
 
Hope that helps! Any questions, do ask, though not around at weekends!

Regards, Gary
----- Original Message -----
From: J. P. L. Mart��n
To: pharo-project@lists.gforge.inria.fr
Sent: Friday, January 11, 2013 3:50 PM
Subject: [Pharo-project] Dynamic GUI possible?

Hi, I'm trying to display buttons only if a condition is true on the same window, making the condition is easy but I can get the conditional to run again when a change is done so it displays the row with the buttons, here is the code:

open
    | builder content |
    builder := UITheme builder.
    content := builder
        newColumn:
            {(builder
                newRow:
                    {(builder
                        newButtonFor: self
                        action: #listaPrestamos
                        label: 'Prestamos'
                        help: 'Listar Prestamos').
                    (builder
                        newButtonFor: self
                        action: #listaMateriales
                        label: 'Material'
                        help: 'Listar Material').
                    (builder
                        newButtonFor: self
                        action: #listaSocios
                        label: 'Socios'
                        help: 'Listar Socios').
                    (builder
                        newButtonFor: self
                        action: #listaEjemplares
                        label: 'Ejemplares'
                        help: 'Lista de Ejemplares')}).
            (builder
                newColumn:
                    {((PluggableMultiColumnListMorph
                        on: self
                        list: #listado
                        selected: #seleccionado
                        changeSelected: #seleccionado:
                        menu: nil
                        wrapSelector: #wrap:at:) extent: 600@600)})}.
            #listado = Prestamo database ifTrue: [builder
                newRow:
                    {(builder
                        newButtonFor: self
                        action: #addPrestamo
                        getEnabled: nil
                        label: 'Nuevo Prestamo'
                        help: 'Ingresar nuevo prestamo').
                    (builder
                        newButtonFor: self
                        action: #devPrestamo
                        getEnabled: #selecciono
                        label: 'Devolver'
                        help: 'Devolver').
                    (builder
                        newButtonFor: self
                        action: #addEjemplar
                        label: 'Agregar Ejemplar'
                        help: 'Ingresar nuevo ejemplar').
                    (builder
                        newButtonFor: self
                        action: #addMaterial
                        label: 'Agregar Material'
                        help: 'Ingresar nuevo material').
                    (builder
                        newButtonFor: self
                        action: #addSocio
                        label: 'Nuevo Socio'
                        help: 'Ingresar nuevo socio').
                    (builder
                        newButtonFor: self
                        action: #remover
                        getEnabled: #selecciono
                        label: 'Remover'
                        help: 'Ingresar nuevo prestamo').
                    (builder
                        newButtonFor: self
                        action: #guardar
                        label: 'guardar'
                        help: 'Ingresar nuevo socio')}] ifFalse: (Transcript show: 'Flase'; cr).
    (content openInWindowLabeled: 'Babel') extent: 600 @ 600.
    self changed: #listado;
    changed: #open.