tags:

views:

146

answers:

1

Hi I wondered if anybody could help me with a technique to address the following problem in Smalltalk. Specifically Cincoms Visualworks.

I would like to code a simple GUI that has three fields and processes them as follows:

The first field inputs a number (5 say).

The second field simply displays twice the first field (so it displays 10 in this example)

Now, the interesting bit... the third field displays a value from a different completely different class (lets call it class X). However, the value must be displayed on the GUI whenever that value in the class X changes - it mustn’t wait for a key press from an update button. The value in class X could be sourced from (say) the workspace.

I though I could do this via aspect adaptors but I can’t seem to get the ‘third field value’ to update asynchronously.

Any techniques, hints or tips will be most warmly welcomed - (especially code snippets!!).

Thanks Kevin

+2  A: 

I've sorted this myself. After trying the dependency mechanism (works fine - but simply not needed), looking at announcements (thanks James at Cincom - personnel communication) I found that all I needed to do was to simply create a method and send it a message with a parameter (my value) that method then simply updated the value holder (i.e. the aspect of the GUI field) with the "value:" message. The more I look into Smalltalk the more I like it!

KHWP