Updating a shell from a created subshell?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Updating a shell from a created subshell?

gregarican
I have a shell that presents the user with a menu bar. The various menu
bar commands create other shells which are associated with contact
record management tasks. For example I have a method in the main shell
which opens up a contact record. Here's the code:

openContact
        "Lookup an existing CRM contact record."
        contactRecord := CrmContactModel new.
        CrmLookupShell showOn: contactRecord.

I created an instance variable for the CrmContactModel so that I can
enable or disable the various menu bar commands depending if a matching
record was found or not. The main shell's #queryCommand method checks
things out based on this instance variable. This all works fine and
dandy.

My question is my CrmLookupShell needs to update the main shell with
the found contact data. For example, I would like to update the caption
in the main shell to include the contact record's last name and home
phone number. How can I reference the main shell from a method within
the CrmLookupShell that's created?


Reply | Threaded
Open this post in threaded view
|

Re: Updating a shell from a created subshell?

Bruno Brasesco
> phone number. How can I reference the main shell from a method within
> the CrmLookupShell that's created?
>

CrmLookupShell
someMethod

        " some code "
        self topShell caption: self updateCaption.

Regards Bruno


Reply | Threaded
Open this post in threaded view
|

Re: Updating a shell from a created subshell?

gregarican
Bruno wrote:

> CrmLookupShell
> someMethod
>
>         " some code "
>         self topShell caption: self updateCaption.
>
>
> Regards Bruno

Thanks. I apologize for all of the questions. It's just that after
creating GUI's using Ruby, Python, and some other languages the MVP
specifics in Dolphin Smalltalk threw me a learning curve. Slowly but
surely I am getting past some of my initial hurdles. Plus I figured out
how to have a main shell and subshell both share the same model so that
things work a little cleaner too. That's the toughest part of
unlearning some of my previous habits. I could force Dolphin Smalltalk
to do what I needed it to do, but I would also lose a lot of the MVP
paradigm and OOP beauty of what I would benefit from after I was done.
Thanks again!