5
$\begingroup$

Has anyone observed the following GUI glitches in Mathematica (see screenshots below)? I have noticed this beginning to occur from Mathematica 10 onwards. I've only tested their occurrence with the InputField command.

Update: I have also provided the entire code that is used to create the GUI from which the screenshots below were taken. When I run the code below on macOS 10.12.4 using MMA 11.1, I get the glitches shown.

Glitch dynamics: Glitches occur the moment I click on an "affected" InputField box and remains until the cursor is moved. After that, anytime there is a keyboard entry, these glitches occur and remain on screen until the cursor is moved. As shown in the screenshots below, glitches occur in (apparently) random InputField boxes.

Screenshots showing glitches

CreateWindow[
  DocumentNotebook[
   Deploy[Panel[
     Column[{Row[{Style["Some text Some text Some text", 
          FontSize -> 16, Bold]}], 
       Row[{Column[{Row[{Style["Some text", FontSize -> 14, Bold]}], 
           Panel[Column[{Button["Some textSome text", {func[];}, 
               Method -> "Queued", ImageSize -> Full], 
              Row[{Dynamic[
                 "Some text Some text: " <> 
                  If[StringLength["Some text"] > 40, 
                   "..." <> StringTake["Some text", -37], 
                   "Some text"]]}], 
              Row[{"Some text: ", 
                Button["Some text", {func[];}, Method -> "Queued", 
                 ImageSize -> Automatic], 
                Dynamic[
                 Button["Some text", {func[];}, Method -> "Queued", 
                  ImageSize -> Automatic, 
                  Enabled -> If[False, Automatic, False]]]}], 
              Row[{Dynamic["SSome text Some: " <> y, 
                 Initialization -> (y = "")]}]}]], 
           Row[{Style["Some text Some text", FontSize -> 14, Bold]}], 
           Panel[Column[{Row[{Style["Some text Some", Bold]}], 
              Panel[Column[{Row[{"Some text Some: ", 
                   PopupMenu[
                    Dynamic[a7, 
                    Initialization -> (a7 = False)], {True -> 
                    "Some text Some", 
                    False -> "Some text Some text"}]}], 
                 Row[{"Some text Some: ", 
                   InputField[
                    Dynamic[a6, Initialization -> (a6 = 500)], 
                    FieldSize -> 6]}], 
                 Row[{"Some text Some: ", 
                   InputField[
                    Dynamic[a5, Initialization -> (a5 = 20)], 
                    FieldSize -> 6]}], 
                 Row[{"Some text Some: ", 
                   InputField[Dynamic[a4, Initialization -> (a4 = 2)],
                     FieldSize -> 6]}], 
                 Row[{"Some text Some: ", 
                   InputField[
                    Dynamic[a3, Initialization -> (a3 = 10)], 
                    FieldSize -> 6]}], 
                 Row[{"Some text Some: ", 
                   InputField[
                    Dynamic[a2, Initialization -> (a2 = 1000)], 
                    FieldSize -> 6]}], 
                 Row[{"Some text Some: ", 
                   InputField[
                    Dynamic[a1, Initialization -> (a1 = 200)], 
                    FieldSize -> 6]}], 
                 Row[{Button["Some text Some text", {func[];}, 
                    Method -> "Queued", ImageSize -> Full], 
                   Button["Some text", {func[];}, Method -> "Queued", 
                    ImageSize -> Full]}], 
                 Row[{Dynamic["Some text: " <> "Some text"]}]}]]}]], 
           Row[{Style["Some text", FontSize -> 14, Bold]}], 

           Panel[Column[{Row[{"Some text Some text: ", 
                Dynamic[g, Initialization -> (g = 0)]}], 
              Row[{"Some text Some text: ", 
                InputField[
                 Dynamic[f, Function[f = Round[#, 0.5]], 
                  Initialization -> (f = 0)], FieldSize -> 3]}], 
              Button["Some text", {func[];}, Method -> "Queued", 
               ImageSize -> Full], 
              Button["Some text", {func[];}, Method -> "Queued", 
               ImageSize -> Full]}]]},(*COLUMN OPTIONS*)
          Alignment -> {Left, Center}, BaselinePosition -> Top, 
          Dividers -> False, Frame -> False, Spacings -> {1, 1}, 
          ItemSize -> Automatic], Spacer[20], 
         Column[{Row[{Style["Some text Some text Some text", 
              FontSize -> 14, Bold]}], 
           Panel[Column[{Row[{"Some text Some text: ", 
                PopupMenu[
                 Dynamic[a, Initialization -> (a = 40000)], {10000, 
                  20000, 30000, 40000, 50000}], Spacer[10], 
                Style["Some text Some text Some text Some text", 
                 Italic]}], 
              Row[{"Some text Some text Some text: ", 
                InputField[
                 Dynamic[b, 
                  Initialization -> (b = 
                    Join[Range[75, -30, -15], {-57.5}])], 
                 FieldSize -> 17], Spacer[10], "some text"}], 
              Row[{"Some text Some text: ", 
                Slider[Dynamic[c, Initialization :> (c = 0.)], {0, 20,
                   0.1}, Appearance -> "Labeled"]}], 
              Row[{Column[{Row[{Style["Some text Some text", Bold]}], 
                  Row[{Panel[
                    Column[{Row[{"Some text: ", 
                    Button["Some text", {func[];}, Method -> "Queued",
                     ImageSize -> Automatic], 
                    Dynamic[
                    Button["Some text", {func[];}, Method -> "Queued",
                     ImageSize -> Automatic, 
                    Enabled -> If[False, Automatic, False]]], 
                    Dynamic[
                    Button["Some text", {func[];}, Method -> "Queued",
                     ImageSize -> Automatic, 
                    Enabled -> If[False, Automatic, False]]]}], 
                    Row[{Dynamic["Some text: " <> test, 
                    Initialization -> (test = "")]}], 
                    Row[{"Some text: ", 
                    Checkbox[
                    Dynamic[d, Initialization :> (d = False)]]}], 
                    Panel[Column[{Row[{"Absolute Azimuth Increment \
(in Degrees): ", 
                    InputField[
                    Dynamic[azStep, Initialization -> (azStep = 5)], 
                    FieldSize -> 3]}], 
                    Row[{Style["\nPreset Measurement Options", 
                    Bold]}], 
                    Panel[Column[{Row[{"Measurement Surface: ", 
                    PopupMenu[
                    Dynamic[measurementSurface, 
                    Initialization -> (measurementSurface = 1)], {1 ->
                     "Horizontal", 2 -> "Median-sagittal", 
                    3 -> "Lateral", 4 -> "Spherical"}]}], 
                    Row[{"Measurement Quadrant: ", 
                    Dynamic[
                    If[measurementSurface != 4, 
                    If[measurementSurface != 1, 
                    If[Select[{10, 20}, # < 0 &] == {}, 
                    measurementQuadrant = 
                    If[ListQ[measurementQuadrant], 
                    Select[measurementQuadrant, # < 3 &]];

                    CheckboxBar[Dynamic[measurementQuadrant], 
                    Range[2]], 
                    If[Select[{10, 20}, # >= 0 &] == {}, 
                    measurementQuadrant = 
                    If[ListQ[measurementQuadrant], 
                    Select[measurementQuadrant, (# > 2 && # < 5) &]];

                    CheckboxBar[Dynamic[measurementQuadrant], 
                    Range[3, 4]], 
                    measurementQuadrant = 
                    If[ListQ[measurementQuadrant], 
                    Select[measurementQuadrant, # < 5 &]];

                    CheckboxBar[Dynamic[measurementQuadrant], 
                    Range[4]]]], 

                    measurementQuadrant = 
                    If[ListQ[measurementQuadrant], 
                    Select[measurementQuadrant, # < 5 &]];

                    CheckboxBar[Dynamic[measurementQuadrant], 
                    Range[4]]], 
                    If[Select[{10, 20}, # < 0 &] == {}, 
                    measurementQuadrant = 
                    If[ListQ[measurementQuadrant], 
                    Select[measurementQuadrant, # < 5 &]];

                    CheckboxBar[Dynamic[measurementQuadrant], 
                    Range[4]], 
                    If[Select[{10, 20}, # >= 0 &] == {}, 
                    measurementQuadrant = 
                    If[ListQ[measurementQuadrant], 
                    Select[measurementQuadrant, # > 4 &]];

                    CheckboxBar[Dynamic[measurementQuadrant], 
                    Range[5, 8]], 
                    CheckboxBar[Dynamic[measurementQuadrant], 
                    Range[8], 
                    Appearance -> 
                    "Horizontal" -> {Automatic, 4}]]]]]}]}]], 
                    Row[{Style[
                    "\nUniform Spatial Sampling Measurement Options", 
                    Bold]}], 
                    Panel[Column[{Row[{"Starting Azimuth (in \
Degrees): ", InputField[
                    Dynamic[startAzimuth, 
                    Initialization -> (startAzimuth = 0)], 
                    FieldSize -> 3]}], 

                    Row[{"Ending Azimuth (in Degrees): ", 
                    InputField[
                    Dynamic[endAzimuth, 
                    Initialization -> (endAzimuth = 355)], 
                    FieldSize -> 3]}]}]]}]], 
                    Row[{Style[
                    "\nCustom Spatial Sampling Measurement Options", 
                    Bold]}], 
                    Panel[Column[{Row[{"Ordered Pair List (in \
Degrees): ", InputField[
                    Dynamic[orderedPairList, 
                    Initialization -> (orderedPairList = {{65., 
                    0}, {109., 30}, {246.5, 30}, {315., 0}})], 
                    FieldSize -> 17]}]}]], 
                    Row[{"Use: ", 
                    RadioButtonBar[
                    Dynamic[measurementOption, 
                    Initialization -> (measurementOption = 2)], {1 -> 
                    "Preset", 2 -> "Custom Uniform Sampling", 
                    3 -> "Custom Sampling"}]}], 
                    Grid[{{Dynamic[
                    Button["Some text", {func[];}, Method -> "Queued",
                     Enabled -> If[False, Automatic, False]]], 
                    Row[{" Progress:", 
                    ProgressIndicator[
                    Dynamic[progressBar1Position[[1]], 
                    Initialization -> (progressBar1Position = {0, 
                    0})]]}]}, {SpanFromAbove, 
                    Row[{Dynamic[
                    " Status: " <> progressStatusMessage1[[1]], 
                    Initialization -> (progressStatusMessage1 = {"", 
                    ""})]}]}}, Dividers -> {2 -> True, False}, 
                    Alignment -> {Left, Center}, 
                    Spacings -> {2, -0.5}]}], 
                    BaselinePosition -> Top]}]}, 
                 BaselinePosition -> Top], Spacer[10], 
                Column[{Row[{Style["Some text Some text Some text", 
                    Bold]}], 
                  Column[{Panel[
                    Column[{Row[{"Some text: ", 
                    Button["Some text", {func[];}, Method -> "Queued",
                     ImageSize -> Automatic], 
                    Dynamic[
                    Button["Some text", {func[];}, Method -> "Queued",
                     ImageSize -> Automatic, 
                    Enabled -> If[False, Automatic, False]]], 
                    Dynamic[
                    Button["Some text", {func[];}, Method -> "Queued",
                     ImageSize -> Automatic, 
                    Enabled -> If[False, Automatic, False]]]}], 
                    Row[{Dynamic["Some text: " <> test, 
                    Initialization -> (test = "")]}], 
                    Row[{"Some text: ", 
                    Checkbox[
                    Dynamic[j, Initialization :> (j = False)]]}], 
                    Grid[{{Dynamic[
                    Button["Some text", {func[];}, Method -> "Queued",
                     Enabled -> If[False, Automatic, False]]], 
                    Row[{" Progress:", 
                    ProgressIndicator[
                    Dynamic[progressBar1Position[[2]], 

                    Initialization -> (progressBar1Position = {0, 
                    0})]]}]}, {SpanFromAbove, 
                    Row[{Dynamic[
                    " Status: " <> progressStatusMessage1[[2]], 
                    Initialization -> (progressStatusMessage1 = {"", 
                    ""})]}]}}, Dividers -> {2 -> True, False}, 
                    Alignment -> {Left, Center}, 
                    Spacings -> {2, -0.5}]}]]}, 
                   BaselinePosition -> Top], 
                  Row[{Style["\nSome text", Bold]}], 
                  Column[{Panel[
                    Column[{Row[{Dynamic[
                    "Some text: " <> "Some text"]}], 
                    Button["Some text", {func[];}, Method -> "Queued",
                     ImageSize -> Full], 
                    Row[{Dynamic["Some text: " <> "Some text"]}], 
                    Button["Some text", {func[];}, Method -> "Queued",
                     ImageSize -> Full], 
                    Grid[{{Dynamic[
                    Button["Some text", {func[];}, Method -> "Queued",
                     ImageSize -> Full, 
                    Enabled -> If[False, Automatic, False]]], 
                    ""}, {Dynamic[
                    Button["Some text", {func[];}, Method -> "Queued",
                     ImageSize -> Full, 
                    Enabled -> If[False, Automatic, False]]], 
                    Column[{Row[{" Progress:", 
                    ProgressIndicator[

                    Dynamic[progressBar2Position, 
                    Initialization -> (progressBar2Position = 0)]]}], 
                    Row[{Dynamic[
                    " Status: " <> progressStatusMessage2, 
                    Initialization -> (progressStatusMessage2 = 
                    "")]}]}]}, {Dynamic[
                    Button["Some text", {func[];}, Method -> "Queued",
                     ImageSize -> Full, 
                    Enabled -> If[False, Automatic, False]]], ""}}, 
                    Dividers -> {2 -> True, False}, 
                    Alignment -> {Left, Center}, 
                    Spacings -> {2, {2, {0}, 2}}]}]]}, 
                   BaselinePosition -> Top]}, 
                 BaselinePosition -> Top]}]}]]},(*COLUMN OPTIONS*)
          Alignment -> {Left, Center}, BaselinePosition -> Top, 
          Dividers -> False, Frame -> False, Spacings -> {1, 1}, 
          ItemSize -> Automatic]}]},(*COLUMN OPTIONS*)
      Alignment -> {Center, Center}, BaselinePosition -> Center, 
      Dividers -> {False, All}, Frame -> True, 
      FrameStyle -> Directive[Black, AbsoluteThickness[3]], 
      ItemStyle -> Directive[FontSize -> 12], ItemSize -> Automatic, 
      Spacings -> {2, 2}]]], WindowSize -> Fit, 
   WindowElements -> None]];

Here is a minimal version of the code that still reproduce the glitch when selecting the second input field:

Panel@
 Column[{
   Row[{
     Column[{
       Panel[
        Column[{
          Panel@Column@{
             InputField@
              azStep
             },

          InputField@
           orderedPairList
          }]
        , BaselinePosition -> Top
        ]
       }
      , BaselinePosition -> Top
      ]
     , Spacer[0]
     }]
   }]

Strangely enough, removing any of the options, like Spacer or BaselinePosition also removes the glitch.

$\endgroup$
  • $\begingroup$ I see. The problem is I provided only a snippet of the code (i.e. I narrowed down the example as you observe) so it won't run properly if you try to execute it. Unfortunately, I can't provide the entire piece of code. Let me try replicating the issue with a different example. I'll update once I do. I'm using macOS 10.12.4 and MMA 11.1 $\endgroup$ – Rahul Apr 10 '17 at 7:10
  • $\begingroup$ @Kuba I managed to publish the entire GUI code by replacing parts that were dependent on a larger piece of code. I ran the above on my system and was able to replicate the glitches shown. $\endgroup$ – Rahul Apr 10 '17 at 7:48
  • 2
    $\begingroup$ @Rahul that's still quite a lenghty block of code. Have you tried progressively removing pieces of the UI to pin down what exactly causes the glitch (which I also see by the way)? $\endgroup$ – glS Apr 10 '17 at 8:20
  • 1
    $\begingroup$ @Rahul I took the liberty of editing your post adding a stripped down version of the code that still reproduces the glitch, at least for me. If you do not see the glitch in that code feel free to edit back. (I'm on Windows 10 with v11.1) $\endgroup$ – glS Apr 10 '17 at 8:46
  • 1
    $\begingroup$ I can reproduce the glitch all the way back to v10.0, also macOS 10.12.4. The badly rendered thing appears briefly then disappears in v9.0. I did not look at your code to check if there is anything unusual in there. I suggest you report this to Wolfram Support, and then let us know what they said (confirmed bug or not). I strongly suggest to construct a minimal example (glS's comment) before you send it though. $\endgroup$ – Szabolcs Apr 10 '17 at 9:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.