Skip to content

Instantly share code, notes, and snippets.

@jnthn
Last active December 20, 2015 16:59
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 jnthn/6e5b82c4b70fd6592841 to your computer and use it in GitHub Desktop.
Save jnthn/6e5b82c4b70fd6592841 to your computer and use it in GitHub Desktop.
constant SWTJAR = 'D:\Program Files\eclipse\plugins\org.eclipse.swt.win32.win32.x86_64_3.100.1.v4234e.jar';
use org::eclipse::swt::SWT:from<java>:jar(SWTJAR);
use org::eclipse::swt::widgets::Display:from<java>:jar(SWTJAR);
use org::eclipse::swt::widgets::Shell:from<java>:jar(SWTJAR);
use org::eclipse::swt::widgets::Text:from<java>:jar(SWTJAR);
my $display := Display.'constructor/new/()V'();
my $shell := Shell.'constructor/new/(Lorg/eclipse/swt/widgets/Display;)V'($display);
my $helloWorldTest := Text.new($shell, SWT.'field/get_NONE/I'());
$helloWorldTest.setText("Hello World SWT");
$helloWorldTest.'method/pack/()V'();
$shell.'method/pack/()V'();
$shell.open();
until $shell.isDisposed() {
$display.sleep unless $display.readAndDispatch();
}
$display.dispose();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment