Morphs automatic repositioning (and resizing)

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

Morphs automatic repositioning (and resizing)

Mark Rizun
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
Reply | Threaded
Open this post in threaded view
|

Re: Morphs automatic repositioning (and resizing)

Thierry Goubier
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!

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



--
View this message in context: http://forum.world.st/Morphs-automatic-repositioning-and-resizing-tp4834043.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Morphs automatic repositioning (and resizing)

Mark Rizun
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.

I'll try this approach first.
 
This answer applies to bare, good old Morphic. Spec is something else if this is what you are using, Bloc as well.

Yes, I'm working with bare Morphic. At least for now :)
 
Thanks a lot!
Reply | Threaded
Open this post in threaded view
|

Re: Morphs automatic repositioning (and resizing)

Uko2

On 25 Jun 2015, at 15:32, Mark Rizun <[hidden email]> wrote:

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.

I'll try this approach first.
 
This answer applies to bare, good old Morphic. Spec is something else if this is what you are using, Bloc as well.

Yes, I'm working with bare Morphic. At least for now :)

Welcome to the club.

 
Thanks a lot!

Reply | Threaded
Open this post in threaded view
|

Re: Morphs automatic repositioning (and resizing)

Thierry Goubier
In reply to this post by Mark Rizun


2015-06-25 15:32 GMT+02:00 Mark Rizun <[hidden email]>:
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.

I'll try this approach first.

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 :)
 
 
This answer applies to bare, good old Morphic. Spec is something else if this is what you are using, Bloc as well.

Yes, I'm working with bare Morphic. At least for now :)

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.


 
 
Thanks a lot!

You're welcome,

Thierry 

Reply | Threaded
Open this post in threaded view
|

Re: Morphs automatic repositioning (and resizing)

Denis Kudriashov
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!

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



--
View this message in context: http://forum.world.st/Morphs-automatic-repositioning-and-resizing-tp4834043.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.