Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // Create a button
  2. var button1 = new qx.ui.form.Button("First Button", "icon/22/apps/internet-web-browser.png");
  3.  
  4. // Document is the application root
  5. var doc = this.getRoot();
  6.  
  7. var decorator= new qx.ui.decoration.Single().set({
  8.    backgroundColor : "white",
  9.    style: "solid",
  10.    width: 2,
  11.    color: "red"
  12. });
  13.  
  14. // Add button to document at fixed coordinates
  15. doc.add(button1,
  16. {
  17.   left : 100,
  18.   top  : 50
  19. });
  20.  
  21. // Add an event listener
  22. button1.addListener("execute", function(e) {
  23.   alert("Hello World!");
  24. });
  25.  
  26. button1.setDecorator(decorator);
  27.  
  28. this.debug("Finished");