HelloJtalk.st 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Dictionary subclass: #EKind
  2. instanceVariableNames: ''
  3. category: 'HelloJtalk'!
  4. Dictionary subclass: #EComponent
  5. instanceVariableNames: ''
  6. category: 'HelloJtalk'!
  7. EKind subclass: #HelloJtalk
  8. instanceVariableNames: ''
  9. category: 'HelloJtalk'!
  10. !HelloJtalk class methodsFor: 'initializing'!
  11. initialize
  12. | me control button input popup myInput pageHeader arr field children |
  13. pageHeader := EComponent new.
  14. pageHeader at: 'kind' put: 'PageHeader'; at: 'content' put: 'JTalk Live'.
  15. button := EComponent new.
  16. <popup = {kind: "Popup", components: [
  17. {content: "Pick something you like"},
  18. {kind: "ListSelector", value: "Foo", items: ["Foo", "Bar", "Bot"]}]}>.
  19. button at: 'kind' put: 'Button';
  20. at: 'caption' put: 'Click here please';
  21. at: 'onclick' put: 'buttonClick'.
  22. input := EComponent new.
  23. input at: 'kind' put: 'Input'.
  24. me := self new.
  25. arr := Array new.
  26. arr add: pageHeader; add: button; add: input; add: popup.
  27. me at: 'components' put: arr;
  28. at: 'name' put: 'jtalk.HelloJtalk';
  29. at: 'kind' put: 'VFlexBox';
  30. at: 'buttonClick' put: [
  31. children := <this.$>.
  32. field := children input.
  33. "This next line works fine"
  34. <field.setValue('Yo')>.
  35. "But for some reason I can not get this next line to do anything"
  36. field setValue: 'Yowza'.
  37. "But this line works fine, but has no arguments... ?"
  38. children popup openAtCenter].
  39. enyo kind: me.
  40. enyo log: 'Done initializing.'
  41. ! !