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'm trying to create a "template" notebook for myself.
I want to get input from a single InputField, and then run a few operations on it.

How can I make the InputFiled (that is, the box itself) be prettier?

How can I manipulate it's style?

EDIT:
I was asked to define prettier (which stands to reason).
So let's have WolframAlpha's (website) input box as a refrence point.

share|improve this question
3  
Define "prettier". With[{img = ExampleData[{"TestImage", "Elaine"}]}, Panel@Column[{img, InputField[]}] ] :) –  rm -rf Oct 8 '13 at 14:15
    
Ahhh... Lenna... –  Trevor Oct 8 '13 at 14:32

1 Answer 1

up vote 8 down vote accepted

You can get custom colors and rounded corners by adding a custom frame to a frameless InputField. The following code approximates the look of Wolfram Alpha's input field:

With[{opts = {FrameMargins -> 0, ImageMargins -> 0}},
    Framed[
        Framed[InputField[, ImageSize -> {500, 25}, Appearance -> "Frameless"], 
            FrameStyle -> Red, RoundingRadius -> 5, opts
        ],
        BoxFrame -> 3, RoundingRadius -> 7, FrameStyle -> Lighter@Orange, opts
    ]
]

Note that due to a bug, the FrameStyle option for Framed does not follow thickness directives (and possibly others), so a lower level workaround using BoxFrame is necessary.

share|improve this answer
    
Wow! Excellent solution! This would really make my "template" notebook so much prettier. Thanks. –  Trevor Oct 8 '13 at 15:20

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.