# Create a Checkbox

Write a program that creates a two-state checkbox that people can interact with using a mouse.

Specifically, your program should achieve all of the following:

1. Have a 8×8 pixel (or larger if desired) region of the screen that is the clickable area of the checkbox. Henceforth this region is simply called the checkbox.

2. When the mouse cursor is moved within the checkbox and the default* mouse button is pressed, the checkbox should toggle states.
Checked becomes unchecked. Unchecked becomes checked.

3. The checkbox should not move when it is toggled.

4. In the checked state, the checkbox may be any colors.

5. In the unchecked state, the checkbox may be any colors as long as at least 16 pixels are visually distinct from the checked state.

6. In a single program instance, all checked states should be visually identical to one another and all unchecked states should be visually identical to one another.

7. Don't end the program until it's explicitly terminated (e.g. via exit button or Alt+F4), so a user can click the checkbox as much as they want.

*You may assume the default mouse button is always left click, but it's also fine to use the default as defined by mouse software or the OS, which may not actually be left click depending on the user.

# Notes

• It does not matter what is outside of your checkbox region. It could just be the desktop. It could be a portion of a console that changes on every toggle.

• It does not matter what state your checkbox starts in.

• The checkbox region may have any dimensions at or above 8×8 pixels. It need not be square.

• You may make minor allowances for settings that are out of your control such as console font size, browser zoom, monitor resolution, etc. As long your program works in a reasonable test setting it should be valid.

• If your program opens a window, you may assume it has been dragged to an appropriate location on the screen if necessary (e.g. top left corner).

• You may use markup languages such as HTML or other languages we usually don't consider as full-fledged programming languages.

• Your checkbox must be be toggleable using the default mouse button. It's alright if it also toggles for other forms of input (e.g. right mouse button), with the exception of mouse motion. i.e. the state should not change if the mouse is merely moved within the checkbox.

• Screenshots of your checkbox in action are highly encouraged!

# Scoring

The shortest code in bytes wins.

# Example

A canonical HTML example in 23 bytes.

<input type="checkbox">

For me in Google Chrome, this makes a 12×12 pixel checkbox and about 30 pixels clearly change between checked and unchecked states.

I make the allowance that browser zoom is at 100%.

• Can the checkbox cover the entire screen? – user41805 Feb 5 '17 at 11:19
• @KritixiLithos Yes, that would be valid.Though note that you may, if desired, count a particular 8x8 region as the official checkbox, even if a larger region works. – Calvin's Hobbies Feb 5 '17 at 11:22
• @Helka Homba - is it allowed for an app to display other controls, aside the checkbox itself ? – zeppelin Feb 5 '17 at 12:54
• Is it OK for the checkbox to toggle on other sorts of input? (For example, is a solution correct if the checkbox toggles on any sort of user input, regardless of whether it's a mouse click, a mouse movement, or a keypress? It'd toggle on a mouse click, but it'd toggle on other stimuli too.) – user62131 Feb 5 '17 at 16:27
• @zeppelin "It does not matter what is outside of your checkbox region. It could just be the desktop. It could be a portion of a console that changes on every toggle." So, as long as the checkbox is there, it doesn't matter what else is. – Calvin's Hobbies Feb 5 '17 at 20:42

## Mathematica, 10 bytes

Checkbox[]


Assumes Mathematica's notebook environment.

The two states look like this:

• Sure. Mathematica cheats again. – Matthew Roh Feb 5 '17 at 12:45
• It's funny how the comment has more upvotes than the answer – RudolfJelin Feb 9 '17 at 15:56
• @RudolfL.Jelínek it's funny how the answer has any upvotes at all... – Martin Ender Feb 9 '17 at 18:28

## HTML, 20 bytes

Don't know how valid this will be as an answer. HTML requires the tag to be closed to legally validate, but modern browsers will automatically close them so it's executable.

<input type=checkbox

• I was looking at this as an option earlier (without quotes) but completely missed the closing >. +1 and valid IMHO. – ElPedro Feb 5 '17 at 21:08
• On this site, languages are defined by their implementation, so this seems fine to me. – John Gowers Feb 6 '17 at 15:59
• Thanks @JohnGowers , I've been wondering about the definition of how much abuse is acceptable. – Jan Feb 6 '17 at 16:05
• I think you need to be more specific about which "modern browsers". It doesn't work in FF for me. – Steve Bennett Apr 30 at 0:08

# Bash, 6755503532 31 bytes

:()(read -p$[i^=1] ›?9h -sn6 :)  The code contains a CR byte (first newline) and a CSI byte (small right angle bracket with the Windows-1252 encoding). It requires xterm (or equivalent) and the ISO-8859-1 encoding (or similar). The code defines a function named :, which alternately displays a white 1 or 0 in a black rectangle. There are exactly 24 differing pixels with xterm's default settings. (proof) For an older version that toggles the color of the entire terminal, check revision 10 of this answer. Thanks to @ais523 for suggesting xterm, which saves 4 bytes! ### How it works :(...) creates a function named : that executes .... The read command does the actual magic. • -p specifies an input prompt, which is printed to STDOUT. • $[i^=1] is an arithmetic expansion which XORs the variable i with 1. i may initially be unset; when this occurs, it will be treated as 0.

• The carriage return places the cursor back at the beginning of the line.

• ›?9h captures the mouse in supported terminals. Each click will send six characters to the terminal, namely ←[Mbxy, where ← represents the ESC byte (0x1b). ←[ indicates an escape sequence, M the mouse, b the button (0x20 + the button number), x the x coordinate of the click (0x20 + coordinate), and y the y coordinate.

• -sn6 makes read silent (the mouse input won't be echoed to STDERR) and stops after reading exactly 6 bytes. It saves the input in the REPLY variable, but we're not interested in the output it produces.

Finally, once read finishes (after exactly one mouse click), : recursively calls itself, entering an infinite loop.

### Creation and invocation

$echo$':()(read -p$[i^=1]\r\x9b?9h -sn6\n:);:' > checkbox.sh$ xxd -c 17 -g 1 checkbox.sh
0000000: 3a 28 29 28 72 65 61 64 20 2d 70 24 5b 69 5e 3d 31  :()(read -p$[i^=1 0000011: 5d 0d 9b 3f 39 68 20 2d 73 6e 36 0a 3a 29 3b 3a 0a ]..?9h -sn6.:);:.$ LANG=en_US xterm -e bash checkbox.sh


### Output

• I was working on a similar solution to this myself (although in a different language, forcing me to give up because I couldn't find a way to take input without a newline). A likely improvement: change 1000h to 9h (the difference is that 1000h handles both mouse press and release, and 9h handles only mouse release). This might or might not need changes elsewhere in the code. – user62131 Feb 5 '17 at 21:26
• @ais523 I tried that, but at least my terminal emulator (Konsole) doesn't seem to support it. Do you know one that does? – Dennis Feb 5 '17 at 21:28
• gnome-terminal seems to work, that's what I was using for testing (edit: but I don't think it supports a 1-byte CSI). xterm should also work and might be easier to install if you have a KDE system. (I just tested this myself; it works with \x1b[ but not with \x9b for some reason, possibly related to my stty settings rather than to the terminal itself.) – user62131 Feb 5 '17 at 21:29
• @ais523 I do have xterm. I'll check when I'm back at my PC. – Dennis Feb 5 '17 at 21:30
• I love how it becomes :) from :( by the end – Andras Deak Feb 6 '17 at 23:08

# GitHub Flavored Markdown - 6 bytes

- [ ]


(There is a trailing space)

In a gist :

• Sure this matches the 2nd half of the 1st sentence, “Write a program that creates a two-state checkbox that people can interact with using a mouse.”? – manatwork Feb 7 '17 at 19:58
• Yes, if you paste it in a gist and create the gist (for "compilation") you will be able to interact with it. – Axel Feb 7 '17 at 20:18
• Interesting. Thanks @Ax31. I never used gists. – manatwork Feb 7 '17 at 20:36
• I would not have expected "Github Flavoured Markdown". – Jonas Schäfer Feb 8 '17 at 20:41

# HTML + JavaScript, 3230 25 chars

<p onclick=innerHTML^=1>0

• this is implicit and can be removed. Also, innerHTML is shorter. – Dennis Feb 6 '17 at 17:41
• @Dennis, strange with this... Thank you. – Qwertiy Feb 6 '17 at 17:59
• +1 for not using the <input> element – RedClover Nov 3 '17 at 15:38

# Processing, 78666563 61 bytes

2 bytes saved thanks to @TuukkaX by using -a%2 instead of a%2*-1

2 bytes saved thanks to @TuukkaX by using a=-a

int a=1;void draw(){background(a);}void mousePressed(){a=-a;}


The checkbox alternates between being black and white.

### Explanation

int a=1;                   //the variable that contains the state of the checkbox
void mousePressed(){a=-a;} //if the mouse is pressed, change the sign of a


Now there are many other alternatives like using an if-statement to process this, but then it gets weird and constantly changes the background while the mouse is being pressed. I first tried mouseButton, but then I would need more conditions and more code that will just end up much more verbose.

Now for mousePressed() to be called forever (otherwise it would just stop after the program has just started), we need a draw() function.

void draw(){               //loop infinitely
background(a);           //set the sketch's background to -a%2
//if a ==  1, the background colour is set to almost black
//if a == -1, the background colour is set to white
}


A smaller checkbox would be 90 bytes (the checkbox is in the top left corner, so we can remove some mouse conditions):

int a=1;void draw(){fill(a);rect(0,0,8,8);}void mousePressed(){if(mouseX<9&mouseY<9)a=-1;}

• Clever use of how Processing accept single integers as grayscale colours! – FlipTack Feb 5 '17 at 11:58
• @FlipTack It seems that white can also be expressed as fill(-1) – user41805 Feb 5 '17 at 12:25
• I have an idea. Initialize a to 1 instead of 0. Change a++ to a=-a, which makes -a%2 just a. This will toggle a between 1 and -1. I don't know what color 1 produces though. – Yytsi Feb 5 '17 at 13:40
• @TuukkaX Yup it works. color(1) produces #010101 which is very close to black – user41805 Feb 5 '17 at 13:54

# Unix Shell (+x11-apps), 3 bytes

Disclaimer

The answer below is boring, borderline and "feels cheating" (at least to me).

Yet, it does not seem to violate any of the challenge rules "as written", or "default loopholes", so I'm posting it.

(If you can point a specific rule it breaks, please comment on !)

Golfed

xgc


The xgc program demonstrates various features of the X graphics primitives.

The xgc screen is actually filled with various checkboxes:

and "sticky buttons" (which qualify as checkboxes, under this challenge rules):

# AHK, 25 bytes

Gui,Add,Checkbox
Gui,Show


Output -

# Scratch, 2 blocks

Put this script in the default sprite (which comes with 2 costumes)

## Python REPL, 45 bytes

from tkinter import*
Checkbutton(Tk()).pack()

• I don't participate in CG nor do I often read these posts. However it really surprises me that you are allowed to use external modules. Isn't that cheating? I don't know how many bytes the Tk source code is, but really shouldn't these bytes be added to your byte count? – FMaz Feb 11 '17 at 9:09
• @Krazor tkinter is a standard library for Python (but even if it wasn't I'd only have to declare Python REPL + tkinter). This means that I can use it's features by simply importing it. The penalty you suggest is similar to asking users to include in the byte count the number of bytes in the source of the language you're writing in. Here we allow any language or module to compete as long as it was written and published publicly before the challenge was posted. – Blue Feb 11 '17 at 9:27
• Okay, thank you for the clarification. – FMaz Feb 11 '17 at 9:41

# GeoGebra, 10 bytes

Checkbox[]


Entered into the input bar.

Here is a gif of the execution:

• Whoah, GeoGebra. I remember that. It's been a while. – Fund Monica's Lawsuit Feb 5 '17 at 21:18
• I know this is off-topic but do you go to Waterloo Collegiate Institute? Just out of curiosity, based on your name. I'm not a stalker don't worry :) – HyperNeutrino May 23 '17 at 23:34

# Tcl/Tk, 21 byte

Golfed

grid [checkbutton .c]


# HTML with JavaScript - 136124120115113111109 79 bytes

<p style=height:20;border:solid onClick=t=this;t.innerHTML=(t.e=!t.e)?'x':''>


-2 with thanks to @KritixiLithos

Reduced to 79 after some fantastic golfing from @Jan. Although the new version fits the requirements I have kept the old version for professional pride reasons.

While it is perfectly valid to use built-ins, I thought it was more fun to create my own from scratch. Tested with Chrome and Firefox. border:solid is there for IE compatibility but I don't know if it is actually needed in newer IE versions - I don't have IE available to test.

The px in the height is there for the benefit of "Run code snippet" so is not included in the "real" byte count. It works fine in the browser without it.

<p style=height:20px;border:solid onClick=t=this;t.innerHTML=(t.e=!t.e)?'x':''>

Previous version:

<p id=d style="width:20px;height:20px;border:solid 1px"onClick="d.innerHTML=d.innerHTML=='x'?'':'x'"align=center>

• Can you do id=d to remove d=this? – user41805 Feb 5 '17 at 14:15
• @KritixiLithos - Indeed I can. Thanks and well spotted :) – ElPedro Feb 5 '17 at 14:23
• You don't need to set the width, the rules say it can be any dimensions. If you store the state on a property on this you'll save setting the id. If you store this in a property you'll save a few bytes. The align is unnecessary. Since there are no spaces in the attribute strings, you don't need the quotes. <p style=height:20px;border:solid onClick=t=this;t.innerHTML=(t.e=!t.e)?'x':''> 79 bytes – Jan Feb 5 '17 at 19:19
• @Jan - Thanks! The width bit is my own professional pride. If I don't set it it looks ugly and since this answer is never going to win and was just posted as an alternative I'll probably leave it there. Other than that some great hints. Many thanks. Will update tomorrow. – ElPedro Feb 5 '17 at 20:26
• Thanks @Easterly. Updated the code but forgot the other bits. It's getting late. – ElPedro Feb 5 '17 at 20:44

# Minecraft 1.0.0, 1 byte

A lever in Minecraft meets all the criteria for a check box. This answer is only valid for older versions of the game where punching a lever still toggles it.

Scored using @Connor O'Brien's suggested byte count.

• A difference of 3 between two answers hardly makes or breaks a consensus, but considering that Conor's answer is quite controversial (currently at +24/-10) and that the accepted answer is overwhelmingly well received (+17/-0), I think the latter should be used to score Minecraft answers. – Dennis Feb 7 '17 at 3:02
• However there are no structure blocks in Minecraft 1.0.0 – ev3commander Feb 8 '17 at 12:37
• It's one n in Conor, btw :) – Conor O'Brien Mar 28 '17 at 17:38
• Or you could rebind the left and right mouse buttons in any newer version to make it valid ;D – seadoggie01 Jun 30 '17 at 12:27
• @ConorO'Brien Isn't that 1 block? Why 1 byte? I don't think mc stores every block as one byte... – RedClover Nov 3 '17 at 15:45

## Any version of Windows command line, 3 bytes

(cmd.exe, batch, powershell, start->run, whatever)

osk


Opens the on-screen-keyboard which has several "checkboxes" such as shift, ctrl, alt, capslock keys Similar to the xgc answer, and inspired by the SmileBASIC answer screenshot.

# TI-Basic, 15 bytes

While 1:Shade(0,9:Input :ClrDraw:Input :End


Fairly straightforward. The checkbox covers approximately 40% of the screen and alternates between black and white. When checked, the screen will look something like this:

# Octave, 36 20 bytes

uicontrol('sty','c')


Thanks to @LuisMendo saved 16 bytes!

• uicontrol('sty','c') also works – Luis Mendo Feb 5 '17 at 14:03
• @LuisMendo Thanks! 1/2 byte counts saved! – rahnema1 Feb 5 '17 at 15:07

# KV Lang, 8 bytes

CheckBox


assuming a really basic Python environment for kv lang to even run:

from kivy.app import runTouchApp
from kivy.lang import Builder


This works basically because CheckBox is a Kivy widget included in a kivy.Factory as each widget from the standard library.

That simple string creates an instance of CheckBox and because of runTouchApp expecting a widget to run I can use Builder.load_string.

The background of load_string handles basically every kv string and if there is a single instance of a widget defined (e.g. CheckBox), then it is elevated to a root widget position, for example:

Application
openGL Window
root widget(mostly layout)
main tree
and some widgets
...


# SmileBASIC, 49 bytes

@L
O=T
TOUCH OUT T,,
X=T<O!=X
KEY 1,""[X]GOTO@L


 and  are an empty box and a checked box in SB's font.
Toggle the checkbox by touching the screen (the closest thing to clicking with a mouse)

### 0 bytes:

(the on-screen keyboard has buttons that act like checkboxes, such as the caps lock and insert keys)

### 14 bytes:

EXEC"SYS/SBGED


Opens up the built in graphics editor, which has multiple checkbox-like buttons

• This is just brilliant, though I don't really understand what the 4th line is doing. Could you explain? – snail_ Feb 8 '17 at 1:06
• T<O is true when you stop touching the screen, and != is used as a logical XOR. X=X XOR (O && !T) – 12Me21 Feb 8 '17 at 1:31

## C#, 124 120 bytes

saved 4 bytes thanks to grabthefish.

note: because of edits, the picture doesn't exactly represent what the code makes, the "checkBox1" isn't displayed with the current code.

using System.Windows.Forms;class P{static void Main(){var a=new Form();a.Controls.Add(new CheckBox());a.ShowDialog();}}


ungolfed:  using System.Windows.Forms; class P{ static void Main(){ var a=new Form(); a.Controls.Add(new CheckBox()); Application.Run(a); a.ShowDialog(); } } 

• You can get rid of the spaces in var a = new Form();. – clismique Feb 6 '17 at 9:39
• @Qwerp-Derp I removed them for counting, I just pasted the wrong thing, thanks. – satibel Feb 6 '17 at 9:57
• you could use a.ShowDialog(); to save a few bytes – grabthefish Feb 9 '17 at 12:44
• thanks @grabthefish, though c# still loses to java :( – satibel Feb 9 '17 at 13:09

# Excel VBA, 38 32 31 29 Bytes

Immediates Window function that inserts a checkbox of height=9 and width=9, at the cell A1 on the first sheet of the active Excel VBA project

Sheet1.CheckBoxes.Add 0,0,9,9


-6 Thanks to pajonk for replacing [A1],[A1],9,9 with 0,0,9,9

-1 for replacing Sheets(1) with [Sheet1]

-2 for realizing the above was stupid and using Sheet1 instead

• Seems that 1,1,9,9 as arguments works as well. – pajonk Feb 5 '17 at 18:14
• You dont need the Sheet(1)., you can run this quickly enough in Excel but CheckBoxes is inherint to the active sheet – Mr.Burns Feb 6 '17 at 10:56
• @Mr.Burns I have checked into this, but without directly referencing any Worksheet object, the CheckBoxes.Add method throws an error stating "Object Required" – Taylor Scott Feb 6 '17 at 22:27
• @TaylorScott You are correct, I put the code in a sheet module rather than a normal module .. My mistake xD – Mr.Burns Feb 7 '17 at 9:36

# Ruby with Shoes, 16 characters

Shoes.app{check}


Sample output:

## HTML with JavaScript, 4633 28 bytes

<body onclick=innerHTML^=1>0


v2

<body onclick=this.innerHTML^=1>0


v1

<body onclick=t=this;t.innerHTML=t.e=!t.e||''>


This is a variant on @ElPedro's answer: Create a Checkbox . Got down to 28 bytes with the help of @Albert Renshaw It could be further reduced, but that would make it identical to Create a Checkbox

The whole application area is clickable. It will display 0 in the off state and 1 in the on state. Try it out at https://jsbin.com/nuhetiyocu/1/edit

• Here's a neat variation at 39 bytes. <body onclick=t=this;t.innerHTML^=t?1:0 The 16 pixel rule between state change is up for debate though. – Albert Renshaw Feb 7 '17 at 9:28
• 38 <body onclick=this.innerHTML^=this?1:0 – Albert Renshaw Feb 7 '17 at 9:30
• Oh no with your help I'm down on 33 already :) – Jan Feb 7 '17 at 9:32
• 28 <body onclick=innerHTML^=1>0 – Albert Renshaw Feb 7 '17 at 9:36
• Now that there's always a value inside the container, it could be changed from the body to a different element. But I just noticed that would make it identical to another answer codegolf.stackexchange.com/questions/109155/create-a-checkbox/… so I'm just leaving it as is – Jan Feb 7 '17 at 9:45

# Powershell v5+, 94 Bytes

($a=[Windows.Forms.Form]::new()).Controls.Add([Windows.Forms.Checkbox]::new());$a.ShowDialog()


This is pretty terrible, but I can't get the statements any shorter with either Add-Type or using namespace - and the variable is required, since I need to reuse the object to show the form, and Controls.Add() returns nothing usable.

ShowDialog is required on my system to have the box be interactive after running this command, otherwise the form is frozen.

also System.Windows.Forms.Form can only be shortened to Windows.Forms.Form before (at least my own) system stops auto completing it in a fresh session.

• Nice! Might want to add that this requires version 5+. – briantist Feb 7 '17 at 0:56
• @briantist updated, thanks. – colsw Feb 7 '17 at 2:25

# Operation Flashpoint scripting language, 273 bytes

To show the checkbox:

createDialog"b"


But first it must be defined:

Save the following to a file named description.ext in the mission folder:

class b{idd=999;movingEnable=1;class controls{class c{idc=457;x=0.1;y=0.1;w=0.1;h=0.1;text="";action="if(ctrlText 457=={})then{ctrlSetText[457,{V}]}else{ctrlSetText[457,{}]}";type=1;style=2;colorText[]={1,1,1,1};font="tahomaB36";sizeEx=0.1;}}}


The checkbox in action:

## VBA (Word), 74 57 bytes

-17 thanks to Taylor Scott

Sub a()
End Sub


Filename of the document should be a.

• You can replace the wdFieldFormCheckBox with 71 (the integer value of the wdFieldFormCheckBox constant) for a savings of 17 bytes – Taylor Scott Feb 5 '17 at 17:27
• I think you can remove the newlines for -2 bytes. – devRicher Feb 5 '17 at 23:08

# Pug, 20 bytes

input(type=checkbox)

• Besides which I count is as 23. If you remove the quotes it still works on Firefox and Chrome (can't test on IE) and would come in at 21 in which case I would consider it an improvement on the example and therefore valid. – ElPedro Feb 5 '17 at 12:37
• @heonlygusti - indeed but without the quotes I would have upvoted :-) btw, the downvote wasn't me. – ElPedro Feb 5 '17 at 12:40
• I would have up-voted if it wasn't for those quotes, which are not needed. – NightSkyCode Feb 6 '17 at 19:34
• @theonlygusti not at all. Give it a try. – NightSkyCode Feb 6 '17 at 20:27

# Clojure, 201195145 127 bytes

(ns c(:require[quil.core :as q]))(def a(atom nil))(q/defsketch b :draw #(q/background(if@a 0 99)):mouse-clicked #(swap! a not))


-6 bytes by getting rid of the need for m/fun-mode.

-50 bytes by removing the :setup and :size options, since they are defaultable and unnecessary in non-fun-mode. Also removed the unnecessary import for middleware.

-18 bytes thanks to @ASCII-only. Changed to "smaller" colors, and removed an unnecessary space before the dereference operator (@).

Creates a Quil sketch (a Clojure library that provides a layer over Processing), therefore, this requires the Quil library to run.

(ns bits.golf.checkbox
(:require [quil.core :as q]))

; Mutable global variable to hold the toggle state
(def a (atom nil))

(q/defsketch b
; Draw the background color to be either black or red depending on the toggle state.
:draw #(apply q/background (if @a [0 0 0] [255 0 0]))

; Negate the state on mouse click
:mouse-clicked #(swap! a not))


• Can't you replace 255 with 99? Also I'd try removing spaces before/after symbols and seeing if it still works – ASCII-only Mar 28 '17 at 12:45
• @ASCII-only yes, I could. It made a rant ugly color though iirc, and for some reason I prioritized that at the time. And no, this is as much space as I can remove unfortunately. – Carcigenicate Mar 28 '17 at 13:35
• @ASCII-only The problem is symbols can contain almost any character, so really the only "safe neighbours" that you can remove spaces around are any kind of bracket, or quotes. Luckily this is a lisp to the former is pretty prevalent. – Carcigenicate Mar 28 '17 at 13:42
• Hmm maybe [0 0 99] then? (some kind of dark blue) – ASCII-only Mar 28 '17 at 21:52
• @ASCII-only Actually, I think I can drop the 0s now that I think about it. I think Quil auto pads the front with 0s if the vector is to short. If I remember latest I'll fix it up. Thanks for getting me thinking. – Carcigenicate Mar 29 '17 at 13:27

# AutoIt, 78 Bytes

GUICreate(0)
GUISetState(GUICtrlCreateCheckbox(0,0,0))
Do
Until GUIGetMsg()=-3


Opens a maximized window that can be closed like any other windows window. The maximization and ... on-top-ness is a side effect of the golfing.

• How would I run this on Linux? – dkudriavtsev Feb 7 '17 at 18:24
• @wat wine AutoIt3.exe script.au3, where the script.au3 file contains this code. – mınxomaτ Feb 7 '17 at 19:13

## Python, 62 bytes

from tkinter import*
a=Tk()
Checkbutton(a).pack()
a.mainloop()