MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Styling the selected Tab's label in TabView

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98231] Styling the selected Tab's label in TabView
  • From: Bryce Schober <bryce.schober at dynonavionics.com>
  • Date: Fri, 3 Apr 2009 04:35:58 -0500 (EST)

It seems that you can't set the LabelStyle of individual tabs in a TabView.
Starting with the example in my TabView->Examples->Scope->Control
documentation, I got to:

labels = {"Bill", "Susan"};
DynamicModule[
 {selected},
 TabView[
  Table[
   With[
    {i = i},
    Graphics[
      Style[
       Text[labels[[i]]],
       FontWeight -> Dynamic[
         If[i === selected,
          Bold,
          Plain
          ]
         ]
       ],
      ImageSize -> All,
      PlotRangePadding -> .5
      ] -> ("Hello " <> labels[[i]] <> "!")
    ],
   {i, Length[labels]}
   ],
  Dynamic[selected]
  ]
 ]

This manages to bold the selected tab, but ImageSize -> All isn't limiting
itself to the size of the Text[], and I'm not sure how to limit the
resulting tab size to only that required for the text display...

-- 
Bryce Schober



  • Prev by Date: Re: Interpolation: Method->"Spline"
  • Next by Date: Re: Integrating package documentation with the documentation center
  • Previous by thread: Re: release memory
  • Next by thread: Re: Styling the selected Tab's label in TabView