Thank you for your answer and your time thinking about that!
The “next problem” was directly related to the first one since I may have found out how to adress/reference the stroke for the default state but actually I need to reference both states. Because with my current solution it works fine but when I click the button the stroke will stay at the color, that I defined, for instance the default color(?!).
And unfortunately I have to set the stroke that way. This is because I am setting up a collection of customized widgets for. I have come so far that you can set the Design of the widgets via newButton({layout = 11}) for example, and the Button will be fully styled in a pre defined way. I store this definition in ja json-File. Those widgets should be furthermore be customizable later on, therefore the json-File. So and this customization process has to be easy later on, otherwise no one in my team wants to use it And using the “shape”-Version of the ButtonWidget, makes it a lot easier to maintain compared to the image or imageSheet versions.
What I have done so far is perfectly working without any problems but I was just not very satisfied by the outcome of the widget.newButton() when you use the “shape” version. the Edges of roundedRects do not look very nicely.
See this example App:
The two Blue Buttons (without label) are both my Widgets with customized Features. the right one looks as if it has smooth edges and the left one has some aliasing. You can see the difference on some of the objects above too (red ones without smoothing function, black with)
You see, why I try to do it that way? I do not want to code a whole new Button Widget because that would mean all those work around Focus and lose of Focus while touching and all those other things coronalabs thankfully already provided.
EDIT: I forgot to add the Buttons in pressed State.
Figure 1.
Figure 1:The one without my function (with aliasing but no different strokeColor when clicked)
Figure 2.
Figure 2: The one with my “Fake”-Anti-Aliasing function (nearly without alisasing but with another strokeColor when in pressed state). I have to admit that the stroke can just barely be seen, but the effect is actually there and a little more concise on Phone and Simulator than on JPG