CreatePalette[InputField[Dynamic@x], WindowClickSelect -> True]
Edit
As reported by @AlexeiBoulbitch (see comments), this solution seems not to work for Windows OS (it does work for me on OS X, v10.0.2). I actually found a duplicate post which already mention the problem 3 years ago ... This post also gives the following workaround :
CreatePalette[InputField[Dynamic@x], WindowClickSelect -> True, WindowFloating -> False]
which unfortunately makes the palette not really useful, as it can be now hidden by any other notebook ...
Alternatives
1. Floating Notebook
I tried here to create a floating notebook looking very much the same as the palette window.
Is this working for Windows OS ?
CreateWindow[DocumentNotebook[InputField[Dynamic@x]],
WindowFloating -> True, WindowFrame -> "Palette",
WindowElements -> {}, WindowTitle -> "x value", WindowSize -> All,
Editable -> False, Selectable -> False, ShowCellBracket -> False,
WindowFrameElements -> {"CloseBox"}]
(Most of the options used here are presented in these docs).
It looks like this for me (OSX, v10.0.2)
2. Docked Cell
Instead of creating a separate window, it is possible to display some content at the top of the notebook with DockedCells
. This should provide here also a useful solution for the OP, as (for some reasons) the problem is to avoid "to scroll down and up to find that variable and change its value".
Define any content you need, for example here :
mydock = Row[{"x = ", InputField[Dynamic@x, FieldSize -> Tiny]}];
and dock it this way :
SetOptions[InputNotebook[],
DockedCells -> Cell[BoxData[ToBoxes[mydock]], "DockedCell"]]
To undock :
SetOptions[InputNotebook[], DockedCells -> {}]
CreatePalette @ Dynamic @ x
? $\endgroup$