Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have been trying to style a TabView like in the examples on the Wolfram CDF site, where they have custom sizes and backgrounds with images or gradients, but I am struggling to find documentation on how to style TabViews

Is there a way in Mathematica I can list all the properties of a control like TabView or just those controls which can be modified by the user?

Edit: Link to an example of styling done by Wolfram

share|improve this question
1  
Please add some links so everyone else can see what exactly are You describing. Meanwhile You can check ??TabView. –  Kuba May 29 '13 at 21:11
    
Thanks Kuba the ?? is something i had not discovered before. I have added a link to CDF example on the Wolfram site that has used the TabView and styled it to be very different from the default look. –  andrew May 30 '13 at 20:02
add comment

2 Answers

This is actually not related to TabView per se, although it might look that way if you're not used to GUI construction in Mathematica. TabView is just one of many GUI elements. Like some other elements such as SlideView, TabView encapsulates graphics. But it doesn't style the graphics that it encapsulates it. The content of TabView or SlideView looks that way independently of what encapsulates it. For example:

TabView[{
  Plot[Sin[x], {x, 0, 2 Pi}, Background -> White, ImagePadding -> 50],
  Plot[Cos[x], {x, 0, 2 Pi}, Background -> White, ImagePadding -> 50]
  }]

example 1

If you take the first Plot command and execute it outside TabView it will look the same.

So the question is not how can we style TabView to get something like what we see in the example you gave us. The answer is that we have to build such an interface outside of TabView and then put it in.

I will leave it for you to experiment more with GUI construction, for which there are tutorials in the documentation and online as well. But the main building block is Grid or Row and Column respectively. That's how you can divide up the screen estate into block that you can fill with content such as menus and charts.

share|improve this answer
add comment

I downloaded and examined the CDF you refer to. I conclude from my examination that what looks like a highly stylized TabView may actually be a custom control built based on EvenHandler. Often when one sees what look like fancy versions of Mathematica controls in sophisticated CDFs, they are custom replacements such as the one you were looking at.

As far as I know there is not much customization available for TabView (more experienced Mathematica users may be able to successfully dispute this). However, you could get a fair amount of look-and-feel control by replacing a TabView by a Row of buttons because buttons are easily styled.

Here is an example.

The standard, un-stylized look

Row[{Button["Foo", Print["foo"]], Button["Bar", Print["bar"]]}]

standard

A stylized version

Row[{
  Button[Style["Foo", 24, White, Background -> Red], Print["foo"], Appearance -> None],
  Button[Style["Bar", 24, White, Background -> Blue], Print["bar"], Appearance -> None]
}, " "]

fancy

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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