Skip to content

Instantly share code, notes, and snippets.

@alabamenhu
Created May 26, 2021 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alabamenhu/0b02c9339079ef5eb857e544729765a9 to your computer and use it in GitHub Desktop.
Save alabamenhu/0b02c9339079ef5eb857e544729765a9 to your computer and use it in GitHub Desktop.
GTK test
use Test;
use GUI::GTK;
application Calculator {
window Main {
constant default-size = 100, 500;
constant default-title = 'Calculator';
v-box Container {
text-view Display {
constant text = '0'
}
h-box RowA {
button Clear { constant label = 'AC' }
button PlusMinus { constant label = '⁺⧸₋' }
button Percent { constant label = '%' }
button Divide { constant label = '÷' }
}
h-box RowB {
button Seven { constant label = '7' }
button Eight { constant label = '8' }
button Nine { constant label = '9' }
button Times { constant label = '×' }
}
h-box RowC {
button Four { constant label = '4' }
button Five { constant label = '5' }
button Six { constant label = '6' }
button Minus { constant label = '–' }
}
h-box RowD {
button One {
constant label = '1';
}
button Two { constant label = '2' }
button Three { constant label = '3' }
button Plus { constant label = '+' }
}
h-box RowE {
h-box Foo {
button Zero { constant label = '0' }
}
h-box Other {
button Dot { constant label = '.' }
button Equals { constant label = '=' }
}
}
}
}
}
Calculator.run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment