2
$\begingroup$

I'm deploying a package to consumers to test out that isn't complete and ready to use yet, just so they can give me feedback on usability and do feature requests. While doing so I want it to be clear to them that this is not ready for use, so I added this to popup before the program runs:

DialogInput[{TextCell[
   "This program is incomplete and not intended for use in research 
papers, only for testing user friendliness.", FontSize -> 14, 
   FontWeight -> Bold],
  Button["Proceed", DialogReturn[], 
   Enabled -> Dynamic[Clock[1, 3, 1] == 1]]
  }
 ]

Now I set a Clock so that way they can't exit it too fast and it makes them more likely to read the warning. However there is still the "X" in the top right corner, is there any way to create a window in which that isn't there? Below I've attached a screenshot of the window for clarity. enter image description here

$\endgroup$
2
  • 2
    $\begingroup$ Look at the WindowFrameElements options $\endgroup$
    – M.R.
    Commented Dec 9, 2020 at 5:47
  • $\begingroup$ Perfect, thank you! $\endgroup$
    – Daniel
    Commented Dec 9, 2020 at 6:06

1 Answer 1

2
$\begingroup$

Here's a solution using WindowFrameElements and "PrettyProgressBar" for the win:

c = 0; CreateWindow[
 DialogNotebook[{TextCell[
    "This program is incomplete and not intended for use in research papers,   
     only for testing user friendliness.", FontSize -> 14, 
    FontWeight -> Bold],
   ResourceFunction["PrettyProgressBar"][Dynamic[1 - c], Appearance -> "Barber", 
     Background -> Lighter@Gray, ImageSize -> 340],
   DefaultButton["I UNDERSTAND", DialogReturn[], 
     Enabled -> Dynamic[(c = Clock[1, 3, 1]) == 1]]}], 
 WindowFrameElements -> {}, WindowTitle -> "Warning!",  WindowSize -> {350, 120}]
$\endgroup$
2
  • $\begingroup$ Unfortunately, like most things, notebook options such as WindowFrameElements doesn’t work in the cloud. $\endgroup$
    – M.R.
    Commented Dec 10, 2020 at 2:25
  • $\begingroup$ This is exactly what I was looking for, and fixes that my clock was taking ~10 seconds instead of the specified 3. Thank you! $\endgroup$
    – Daniel
    Commented Dec 10, 2020 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.