Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I have an InputField adjust to fill the remaining size of the window automatically? For example:

enter image description here

Using the ImageSize option often either freezes or takes 5 seconds or longer to run in Mathematica 8.0 in Windows 7. No longer an issue.

share|improve this question
If characters are fixed-width, find out the width of a character and divide by this? – shrx Jun 17 '13 at 21:47
@shrx With all the different Unicode variations, or even a common example for mathemaiica users the -> I can't really imagine the InputField contain a fixed width font, but I could be wrong. – Liam Jun 17 '13 at 22:40
Have you tried the ImageSize option for InputField? – Silvia Jun 17 '13 at 23:05
@Silvia ImageSize just seems to take forever to evaluate in mathematica for me. I am going to edit the question example that shows the speed issues. – Liam Jun 17 '13 at 23:16
Hmm... I didn't encounter any speed issue with that option. Could you describe your issues more precisely? – Silvia Jun 17 '13 at 23:19
up vote 0 down vote accepted

Not sure if 124px as the difference will work in all Operating System, but it certainly seems to work in Windows 7 M8.0.

width1 = 100;
width = Dynamic[(WindowSize /. 
      Options[SelectedNotebook[], WindowSize])[[1]]];
   InputField["fixed", String,
    ImageSize -> {width1, Automatic}],
   InputField["dynamic", String, 
    ImageSize -> {Dynamic[width] - 124 - width1, Automatic}]
share|improve this answer

Your Answer


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.