Is it possible to change the default color of a widget.newButton() ?

I don’t believe so. This was a feature in widgets 1.0 which was dropped from the feature set in widget 2.0 so it is neither a bug nor a new feature. We just would like it back please!  :slight_smile:

Then can you add it at http://feedback.coronalabs.com.

Thanks

Rob

Please read my dialogue above with Brent. Back then I said the following : 

… this was a feature present in widget 1.0 that was dropped for some reason in widget 2.0 yet it was used and valued by your developer community. We should not have to solicit votes for something like this. 

I still stand by this. I will not submit this to http://feedback.coronalabs.com and let it be treated as a new suggestion and ignored for another year.

The fact that we are having this discussion is a shame. Come on… In the age of G2 the glorious, which gives us all sorts of graphical extravaganza yet we can’t have our buttons in any color but gray? Really?

Then you need to cooperate a little bit and be more specific. Color them how? By tinting via :setFillColor()? By applying a pattern/tile fill with scaling and shifting of the pattern too? By creating buttons out of vector objects? If so, which vector objects? Circles? Rounded Rects? Polygons? Lines? Then applying a gradient to those vector objects? And potentially a stroke to those vector objects? Or filling the stroke with an image?

My point is only to show how something as “simple” as “let us color buttons” can be interpreted many different ways.

Brent

Hi Brent, Thanks for chiming in.

IMHO, you’re thinking too deep. All that would be nice (ie vector shaped buttons) but for the time being how about simply restoring the capability in Widget 1.0 which was to have the rectangular buttons defined in any color (+over color). These were simple parameters we included in the newButton setup. From memory, I think they were things like : 

defaultColor = … ,

overColor = …,

strokeColor = …,

strokeWidth = …,

cornerRadius = …,

How does that sound? Please don’t take away features we rely on and make us beg to have them back down the road.

Have a great weekend. Regards,

Kerem

Hi Kerem. 

I’m not sure why you are reluctant to use the feedback site.  We put it in place because people making requests in the forums and doing +1’s get lost.  The feedback site has been very effective in helping Engineering determine what features the community wants.  If Brent and I ask engineering for this feature, they are going to tell us to tell you to put it into http://feedback.coronalabs.com.

Engineering does not monitor the forums, that’s what Brent and I do.  We do take somethings to them but for things like this, the only way it will get consideration is by using the Feedback site and getting people to vote it up.

I understand you feel we took something away from you.  We did.  It’s called a deprecated feature.  We took the old sprite library away from people with Graphics 2.0.  All SDK’s like this change their API over time and some things have to go away so others can move forward.  I wasn’t privy to why this style of button was removed, but it was.  And I know you don’t want to hear this, but because we want you to still be able to use deprecated features, we make those old libraries available as an open source library. 

While you want us to make this feature re-appear for you, you do have multiple avenues to solve this, and if I’m being honest, you could have implemented any of them in the amount of time spent in this forum thread.

You can use the widget 1 library (https://github.com/coronalabs/widget-v1) and just pull that one widget out.  You could do something like this in your main.lua:

local widget = require("widgets") local widgetv1 = require("widgets-v1") widget.newButton = widgetv1.newButton

Now when you require widgets in a module, your widget.newButton will be the old button.  Lets say you want both:

local widget = require("widgets") local widgetv1 = require("widgets-v1") widget.newVectorButton = widgetv1.newButton

Rob

Hi Rob,

I also need a rectangular button but am somewhat reluctant of using an unsupported v1 library or using my own version of widgets v2 .and not getting your fixes to other components. What are your policies of adding code to the main widgets - lets say we do add a shaped button will it make it into the official code source so we can keep getting the latest builds?

As for your suggestion - are groups in v2 compatible with groups in v1 and what will be the implications of inserting a v1 button into a v2 group?

I am new to those forums and dont know the polcies yet, sorry if my questions have been answered already

Thanks

Rob, 

First off, this feature was not announced as a deprecated feature. It simply dropped off the face of the earth. Secondly, in all SDKs depreciated features are supported for a release or two after announcement of being depreciated, allowing developers transition to alternatives offered. See G1 compatibility mode for example… 

Regarding why I don’t wish to submit a feature request for this one… Reasons are twofold : 

  1. It is not a new feature. It existed once and we want it back unless there is an absolute reason as to why we can’t have it. So far I have not heard any reasonable explanation as to why it was taken away and why it can’t be brought back.

  2. I do not have a very high confidence in “voice of developers” being heard through the feedback system. Refer to my thread titled “Widget for text input” for instance… http://forums.coronalabs.com/topic/41661-widget-for-text-input/ - This feature is the highest voted feature if you count the 2 related feature suggestions… It has been sitting there for nearly a year. When is Corona Labs planning to “hear” this one and deliver? IMHO, Feature Suggestions are a simple black hole you like to send people whenever they get too bothersome. Corona Labs makes feature decisions based on what it deems critical and priority. What we want and need has very little impact. At least that’s how it looks and feels like on this end. 

At the end of the day this is a minor issue. I will stop harping on about this and move on. Worst case, I know there are workarounds. There are bigger issues out there that need to be sorted out. 

Have a nice weekend.

Hi @atanasster,

Our policies for adding code are pretty simple, add them, submit it,  and if it passes review we should add it.  I can’t say with certainty that it will pass muster, but engineering has said they will  consider submissions.

Thanks Rob,

I made the changes to widget_button - can you point me where to submit?

If anyone is interested in testing it out , let me know

Thanks
Atanas

I don’t fully understand github, but my understanding is that you make a pull request to get the repository make your changes, then push the changes back to online.  We will get notified and then check out the changes.

Let me get a better step-by-step from Engineering on how to get the changes back to us for review.

Rob

Hi Rob,

I think I figured it out and posted submitted a pull request for widget_button.lua. Also added a widgetext.lua that can be used for creating shaped buttons while the code is not in the main widget.lua files

Here is the usage :

       local button = widgetExt:newButton(

        {

          x = xButton,

          y = yButton,

          width = buttonsWidth,

          height = buttonsHeight,

          labelAlign = “center”, --optional, default is “center”

          labelAlignY = “center”, --optional, values are “top”, “bottom” and “center”

          labelYOffset = 0, --optional, default is 0

          shape = {

              cornerRadius = 10, --optional - default is 0 for a sharp corners rectangle

              strokeWidth = 2,  --optional, default is 1 pixel

              strokeColor = {default = {0.5,0.5,0.5,1}, over = {0,0,0,1}}, – optional, default is black

              fillColor = {default = {0.8,0.9,0.8,1}, over = {0.6,0.7,0.6,1}}, – optional, default is grey

                },

               

          onRelease = onRelease,

          label = “Shaped Button”,

          onRelease = onRelease,

              });

Was a bug report on this every filed or was it added to the feedback site?  Can I get the bug number or the link from the feedback site?

Thanks

Rob

I don’t believe so. This was a feature in widgets 1.0 which was dropped from the feature set in widget 2.0 so it is neither a bug nor a new feature. We just would like it back please!  :slight_smile:

Then can you add it at http://feedback.coronalabs.com.

Thanks

Rob

Please read my dialogue above with Brent. Back then I said the following : 

… this was a feature present in widget 1.0 that was dropped for some reason in widget 2.0 yet it was used and valued by your developer community. We should not have to solicit votes for something like this. 

I still stand by this. I will not submit this to http://feedback.coronalabs.com and let it be treated as a new suggestion and ignored for another year.

The fact that we are having this discussion is a shame. Come on… In the age of G2 the glorious, which gives us all sorts of graphical extravaganza yet we can’t have our buttons in any color but gray? Really?

Then you need to cooperate a little bit and be more specific. Color them how? By tinting via :setFillColor()? By applying a pattern/tile fill with scaling and shifting of the pattern too? By creating buttons out of vector objects? If so, which vector objects? Circles? Rounded Rects? Polygons? Lines? Then applying a gradient to those vector objects? And potentially a stroke to those vector objects? Or filling the stroke with an image?

My point is only to show how something as “simple” as “let us color buttons” can be interpreted many different ways.

Brent

Hi Brent, Thanks for chiming in.

IMHO, you’re thinking too deep. All that would be nice (ie vector shaped buttons) but for the time being how about simply restoring the capability in Widget 1.0 which was to have the rectangular buttons defined in any color (+over color). These were simple parameters we included in the newButton setup. From memory, I think they were things like : 

defaultColor = … ,

overColor = …,

strokeColor = …,

strokeWidth = …,

cornerRadius = …,

How does that sound? Please don’t take away features we rely on and make us beg to have them back down the road.

Have a great weekend. Regards,

Kerem

Hi Kerem. 

I’m not sure why you are reluctant to use the feedback site.  We put it in place because people making requests in the forums and doing +1’s get lost.  The feedback site has been very effective in helping Engineering determine what features the community wants.  If Brent and I ask engineering for this feature, they are going to tell us to tell you to put it into http://feedback.coronalabs.com.

Engineering does not monitor the forums, that’s what Brent and I do.  We do take somethings to them but for things like this, the only way it will get consideration is by using the Feedback site and getting people to vote it up.

I understand you feel we took something away from you.  We did.  It’s called a deprecated feature.  We took the old sprite library away from people with Graphics 2.0.  All SDK’s like this change their API over time and some things have to go away so others can move forward.  I wasn’t privy to why this style of button was removed, but it was.  And I know you don’t want to hear this, but because we want you to still be able to use deprecated features, we make those old libraries available as an open source library. 

While you want us to make this feature re-appear for you, you do have multiple avenues to solve this, and if I’m being honest, you could have implemented any of them in the amount of time spent in this forum thread.

You can use the widget 1 library (https://github.com/coronalabs/widget-v1) and just pull that one widget out.  You could do something like this in your main.lua:

local widget = require("widgets") local widgetv1 = require("widgets-v1") widget.newButton = widgetv1.newButton

Now when you require widgets in a module, your widget.newButton will be the old button.  Lets say you want both:

local widget = require("widgets") local widgetv1 = require("widgets-v1") widget.newVectorButton = widgetv1.newButton

Rob

Hi Rob,

I also need a rectangular button but am somewhat reluctant of using an unsupported v1 library or using my own version of widgets v2 .and not getting your fixes to other components. What are your policies of adding code to the main widgets - lets say we do add a shaped button will it make it into the official code source so we can keep getting the latest builds?

As for your suggestion - are groups in v2 compatible with groups in v1 and what will be the implications of inserting a v1 button into a v2 group?

I am new to those forums and dont know the polcies yet, sorry if my questions have been answered already

Thanks