Skip to main content
Kuba
Source Link
e.doroskevic
  • 6k
  • 1
  • 14
  • 32

For fun

Example

DynamicModule[
 {fill},
 fill = .5;
 Panel @ Column[{
    Slider[Dynamic @ fill, {0, 1}],
    Dynamic @ Graphics[{
       {FaceForm @ White, EdgeForm @ {Thick, Black}, 
        Rectangle[{0, 0}]},
       {FaceForm @ Black, Rectangle[{0, 0}, {1, Dynamic @ fill}]}
       }]
    },
   Alignment -> Center]
 ]

Output

output

For fun

DynamicModule[
 {fill},
 fill = .5;
 Panel @ Column[{
    Slider[Dynamic @ fill, {0, 1}],
    Dynamic @ Graphics[{
       {FaceForm @ White, EdgeForm @ {Thick, Black}, 
        Rectangle[{0, 0}]},
       {FaceForm @ Black, Rectangle[{0, 0}, {1, fill}]}
       }]
    },
   Alignment -> Center]
 ]

For fun

Example

DynamicModule[
 {fill},
 fill = .5;
 Panel @ Column[{
    Slider[Dynamic @ fill, {0, 1}],
    Graphics[{
      {FaceForm @ White, EdgeForm @ {Thick, Black}, Rectangle[{0, 0}]},
      {FaceForm @ Black, Rectangle[{0, 0}, {1, Dynamic @ fill}]}
      }]
    },
   Alignment -> Center]
 ]

Output

output

Source Link
e.doroskevic
  • 6k
  • 1
  • 14
  • 32

For fun

DynamicModule[
 {fill},
 fill = .5;
 Panel @ Column[{
    Slider[Dynamic @ fill, {0, 1}],
    Dynamic @ Graphics[{
       {FaceForm @ White, EdgeForm @ {Thick, Black}, 
        Rectangle[{0, 0}]},
       {FaceForm @ Black, Rectangle[{0, 0}, {1, fill}]}
       }]
    },
   Alignment -> Center]
 ]