'breaking off' complex messages returned from object

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

'breaking off' complex messages returned from object

Jeremy L.
This post has NOT been accepted by the mailing list yet.
Hi, I have a question about pulling apart returned messages from an object.  

In my example (which I solved using a different method, btw, so it's already done, but I know I might need to do this later, so I'm asking for guidance now!), I needed to find the display resolution the VM detected so I could do some math on it.  The math was being plugged into a method that was expecting a point ( i.e. 400 @ 300).  However, the only thing I could find that would return anything about the screen resolution was a method that returned the origin and extent as 2 separate points.  

My question is, what's the best way one normally 'peels off' one aspect of a message when working with objects someone else has written?  Should I write an object myself that peels away that information, or should I do it internally in the method that needs that information?  And specifically, to peel that information off, how would I do it?  

Basically what was happening was I was doing some PRINT IT's of Display boundingBox and found the two points it returned, which is why the edit to a method I was modifying didn't work:  it fed a single point to other objects and so returning the two points with their names obviously confused it.  How would I get JUST one value that doesn't get returned by an object via single method but instead chooses to group related values in a previously existing object?  

Would this be a place to create a dummy array maybe within the method and pull out x item from it maybe?  

Thanks for any help!  I think some of this is finally gelling after almost 2 years of trying to learn smalltalk through books and online tutorials...kind of excited, so thanks to the peeps who wrote the Smalltalk workshop files to a PDF...they really REALLY helped me this afternoon to finally have the 'aha!' moment everyone claimed would happen (which seemed more and more distant and fantasy like the longer I struggled).  

Peace, all!