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 want to ask how can I control the CDF WindowSize in such a way that the end user can minimise its size upto some extent only. For example, If the WindowSize is less than or equal to {300,200}, then it should not be minimised but, it can be maximised.

Dynamic[(width = CurrentValue["WindowSize"][[1]];
        height = CurrentValue["WindowSize"][[2]];
 If[width <= 300, (width = 301), (width = CurrentValue["WindowSize"][[1]])];
 If[height <= 200, (height = 201), (height = CurrentValue["WindowSize"][[2]])];
 Panel[Button["Click1"], {width, height}, ImageSize -> {width, height}])]
share|improve this question

1 Answer 1

up vote 2 down vote accepted

The following code seems to be a possible start point, though far from satisfying:

CreateDocument[{
  Cell[BoxData[
    DynamicWrapperBox[

     RowBox[{"WindowSize: ",
       DynamicBox[ToBoxes[CurrentValue[WindowSize], StandardForm]]}],

     SetOptions[EvaluationNotebook[],
      WindowSize -> {Max[300, CurrentValue[WindowSize][[1]]],
        Max[200, CurrentValue[WindowSize][[2]]]}]
     ]
    ]]}, WindowSize -> {300, 200}]
share|improve this answer

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.