2 Replies Latest reply on Sep 21, 2012 7:10 AM by DBarranca

    IconButton via Resource String

    DBarranca Level 4

      Hello,

      while this way I'm able to define the icon for an IconButton:

       

      var f = new File("~/desktop/res/ZoomIn.png")
      var w = new Window('dialog', undefined, undefined)
      w.add('iconbutton', undefined,f)
      w.show()
      

       

      I've not found a way to define the icon via Resource Strings - the following is my try but alas it doesn't work:

       

      var f = new File("~/desktop/res/ZoomIn.png")
      var winRes = "dialog { zoomInButton: IconButton { properties: { image:f } } }" // using icon:f doesn't work either
      var w = new Window(winRes)
      w.show();
      

       

      Resource strings are nicer, but a bit less documented imho.

      One option is to add the property later:

       

      w.zoomInButton.image = f;
      

       

      But I'd like to keep everything in the res string.

      Thanks in advance

       

      Davide