According to 116030:
Front end options, which includes all box options, can take
Dynamic
heads. That basically means that the FE will compute the value of the Dynamic and use it for the option. And that it will be updated whenever a Dynamic dependency updates.
There is even a nice example with Visible
1112.
The problem is that for WindowSize/Margins
options are overwritten with absolute values as soon as I use window frame elements (resize aread etc.) and move/resize the window.
CurrentValue[EvaluationNotebook[], {TaggingRules, "size"}] =
1000 {1, 1/GoldenRatio};
SetOptions[EvaluationNotebook[], WindowSize -> Dynamic[
CurrentValue[ EvaluationNotebook[], {TaggingRules, "size"}]]
];
Dynamic @ InputForm @ CurrentValue[EvaluationNotebook[], WindowSize]
Dynamic[CurrentValue[EvaluationNotebook[], {TaggingRules, "size"}]]
and after resizing:
{1000, 619}
Can WindowSize
and related options remain Dynamic
during interaction with a notebook? Is this expected to happen?
It works for controllers:
DynamicModule[{x = {100, 100}},
Pane[Dynamic[x], ImageSize -> Dynamic[x],
AppearanceElements -> All
]
]
Dynamic[temp, Initialization :> (temp = init)]
, where both are pointing to some TaggingRules. The point would be to have "non-saveable options" so that e.g. WindowSize will always reset toinit
value when nb is reopened. I could do that withNotebookDynamicExpression
but it is unique and I would rather avoid that. $\endgroup$