4
$\begingroup$

MMA 9.0.1 MacOSX "Mavericks". This issue is apparently mac specific.

The issue of this post is illustrated here, for example. In a SetterBar control straight out of a Manipulate, there are no dividers, though the default appearance in other contexts is to have them. I prefer to have them and don't know why that design decision has been made, but anyway. I found a simple way to restore them using the Paneled option for Manipulate (which happened to produce other beneficial styling effects):

Manipulate[
  Panel@view, {{view, 3, "Fruit:"}, 
    {1 -> "Apples", 2 -> "Pears", 3 -> "Medlars"}, SetterBar}, 
  AppearanceElements -> None, Paneled -> True]

Manipulate[
  Panel@view, {{view, 3, "Fruit:"}, 
    {1 -> "Apples", 2 -> "Pears", 3 -> "Medlars"}, SetterBar}, 
  AppearanceElements -> None,  Paneled -> False]

Panel@
Manipulate[
  Panel@view, {{view, 3, "Fruit:"}, 
    {1 -> "Apples", 2 -> "Pears", 3 -> "Medlars"}, SetterBar}, 
  AppearanceElements -> None, Paneled -> False]

Output of code above

My question: is there a better way to get the dividers back from within a Manipulate?

$\endgroup$
6
  • 1
    $\begingroup$ I have them in the three cases see here. $\endgroup$
    – Öskå
    Commented Apr 28, 2014 at 10:35
  • $\begingroup$ I can reproduce it on V9.0.1 Mac OS 10.8.5. $\endgroup$
    – Michael E2
    Commented Apr 28, 2014 at 10:51
  • $\begingroup$ @Öskå maybe a Mac issue then. $\endgroup$
    – fairflow
    Commented Apr 28, 2014 at 10:52
  • $\begingroup$ @fairflow then you can add the osx tag :) $\endgroup$
    – Öskå
    Commented Apr 28, 2014 at 10:57
  • $\begingroup$ Actually the divider is there, but it's barely visible. $\endgroup$
    – Szabolcs
    Commented Apr 29, 2014 at 1:32

2 Answers 2

1
$\begingroup$

An alternative is a TabView. It will certainly work for your toy problem, but whether it has the functionality you need for your real problem is ... well ... problematic. Here is an implementation of your toy.

Module[{items, lbls, rules},
  items = Panel[#] & /@ Range@3;
  lbls = {"Pears", "Peaches", "Pomegranates"};
  rules = Thread[Rule[lbls, items]];
  Panel @ TabView[rules, 2,
    ImageSize -> 200,
    Alignment -> {Center, Center},
    ControlPlacement -> {Top, Center}]]

TabView

$\endgroup$
1
  • $\begingroup$ Actually this approach works fine within the first argument to Manipulate, I can get a TabView controlled by a variable of the Manipulate, and which also sets this variable as a SetterBar would. But I don't see how to get a Control which is also a TabView within the 2nd argument to Manipulate, which is what I need for layout purposes. I'm producing CDF's btw. $\endgroup$
    – fairflow
    Commented Apr 29, 2014 at 8:42
1
$\begingroup$

There may be a better way but

Panel@
 Manipulate[
  Panel@view, {{view, 3, "Fruit:"}, 
     {1 -> "Apples", 2 -> "Pears", 3 -> "Medlars"}, SetterBar}, 
   AppearanceElements -> None, Paneled -> False]

is the best I've found that allows me to put my view into the 2nd argument (control section) of Manipulate, though I appreciate m_goldberg's suggestion. With apologies, I plan to accept this answer instead.

$\endgroup$
1
  • $\begingroup$ This isn't yet a good answer. I'll post an answer that shows exactly what I need, i.e. a nice-looking view in the control section of a Manipulate $\endgroup$
    – fairflow
    Commented Jun 10, 2014 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.