Changing single dimension of the enclosing rectangle of an object
Hi, I would like to dynamically change the height of an object.
I am aware that I can send, say, the message "presentation_rect 10. 20. 100. $1" to the object to do so -- where I chose the arbitrary values 10., 20. and 100. as the x offset, the y offset, and the width of my object, respectively.
However, this requires me to know that the x offset is indeed 10., the y offset, 20., and the width, 100.
I would like to know if there is a way to specify only height, not the other dimensions -- like a message which, once sent to my object, would only modify its height, no matter what its other dimensions are.
theres no single-dimension message you can send. If you’re trying to do this kind of thing it’s easiest to use JavaScript because it’s easier to query the box attributes (e.g. presentation_rect) and then set the modified attribute again based on those values.
Thank you, it's good to have a definitive answer even if it's not the one I would have liked better. I might end up going the js route, thanks for the suggestion!
For the record, it seems possible without Javascript, using [getattr]. That's probably what I'm going to use.