Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.2K Views
|
6 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How can I center a Top and/or Bottom Control in a Manipulate demo?

Posted 11 years ago

Another beginners question, I'm afraid. I'm working on a demo with lots of controls, and I manage to distribute them Left, Right, Top & Bottom with ControlPlacement. But the Top & Bottom controls stay left-aligned and I would like to center them under the drawing. Thanks for helping.

POSTED BY: Dirk Elseviers
6 Replies

Many thanks. I read about DynamicModule but it seemed daunting, but now I feel encouraged to get into it.

I found a primitive solution to my problem for the faint of heart: simply pad the b controls with spaces!

I would post the code, but the editor here takes the spaces right back out. Is there a way around that?

Also, how does one post a manipulate output like Nasser did? Or should I start a new question?

POSTED BY: Dirk Elseviers

The next step is to simply abandon Manipulate altogether and build your interactive with DynamicModule. Ultimately that is what I always end up doing if I start by creating a Manipulate. Typically though I almost always start with is, in fact, a DynamicModule: it gives you complete detailed control of your design.

POSTED BY: David Reiss

Looks great! Many thanks!!

POSTED BY: Dirk Elseviers
POSTED BY: Nasser M. Abbasi

After edit (I added that control b has a caption).

Here is what I mean:

If you run this example:

Manipulate[Graphics[Circle[{a, b}, c]], {a, 1, 10}, "Caption of b", {b, 1, 10}, {c, 1, 10}, ControlPlacement -> {Left, Top, Top, Right}]

a & c will be indeed left & right, and "caption of b" & b on top, but to the left, instead of over the center of the circle..

David, I can't get your suggestion to work.

POSTED BY: Dirk Elseviers

Is this the sort of behavior you are looking for:

Manipulate[{x, a, b}, {x, 0, 1}, 
 Item[Control[{a, {0, 1}}], Alignment -> Center], {b, 0, 1}]

Not entirely a beginner question! ;-)

POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard