Hello, everyone!
Let's say I have morph which contains few other morphs. Is there any way to reposition all these submorphs (if needed resize, but it's optional), so that they do not intersect with each other? Thanks in advance, Mark |
Hi Mark,
you can compose by putting your morphs into AlignmentMorph instances (order them by rows or columns), and you add the AlignmentMorph instances to your top level morph. You'll have to play with the #spaceFill or #shrinkWrap layout resizing options for your morphs to handle filling the available space. An alternative is to work the positions and proportions by hand with layout frames (x pixels from the left, etc...), as if you were doing a MVC view in VisualWorks :) You can also have slider objects to be able to change proportions interactively, but I've never found the container API understandable (and the hack so ugly when looking how it is implemented) that I create those by hand and add them to the view when I need them. And it has bugs... This answer applies to bare, good old Morphic. Spec is something else if this is what you are using, Bloc as well. Thierry 2015-06-25 14:49 GMT+02:00 Mark Rizun <[hidden email]>: Hello, everyone! |
I'll try this approach first.
Yes, I'm working with bare Morphic. At least for now :) Thanks a lot! |
Welcome to the club.
|
In reply to this post by Mark Rizun
2015-06-25 15:32 GMT+02:00 Mark Rizun <[hidden email]>:
I forgot that I used the SmaCC GUI code as a reference to remember, because I find the API confusing. So, have a look at those methods: Any of the addXXX methods in there does some stuff: you have a tabbed GUI, mix of buttons and labels, multiple text areas... Things missing are a menu bar and drop down menus :)
Once you get the hang of it, it clearly works. But, at the same time, the API seems very painfull to use, full of strange symbols and very long methods. And additionnally you get into layout bugs if you spend time resizing too many times :( I'd dream of being able to write something like: [button1]-12-[button2][1] But even if the tech is Smalltalk-originated[2], it seems we won't see it anytime soon.
You're welcome, Thierry |
In reply to this post by Mark Rizun
Hello. You can play with any visible morphs with halo menu "layout" to change layouting strategy for it children. And you will see livelly what supported. 2015-06-25 15:49 GMT+03:00 Mark Rizun <[hidden email]>: Hello, everyone! |
Free forum by Nabble | Edit this page |