Skip to content

Instantly share code, notes, and snippets.

@sysint64
Created September 2, 2017 14:37
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 sysint64/135c5c60e47ebd4f77bd88a15bdbbac1 to your computer and use it in GitHub Desktop.
Save sysint64/135c5c60e47ebd4f77bd88a15bdbbac1 to your computer and use it in GitHub Desktop.
class MyView : View {
@ViewWidget Button okButton;
@ViewWidget Panel testPanel;
@ViewWidget("cancelButton") Button myButton;
@GroupViewWidgets Button[3] buttons;
int a = 0;
this(Manager manager, in string laytoutFileName, in string shortcutsFileName) {
super(manager, laytoutFileName, shortcutsFileName);
// testPanel.freezeUI(false);
}
@OnClickListener("okButton")
void onOkButtonClick(Widget widget) {
writeln("Hello world! a = ", a);
a += 1;
okButton.caption = "YAY!";
myButton.caption = "WORK!";
buttons[2].caption = "YES!";
}
@Shortcut("TestGroup.cancel")
void someShortcutAction() {
writeln("Wow! shortcut was executed!");
}
@OnClickListener("closeButton")
@OnClickListener("cancelButton")
void onCancelButtonClick(Widget widget) {
writeln("Close!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment