Widget 2.0 Button Touch Event Error

Okay, so before Widget 2.0 came out this worked fine. I had a screen with a button on it and other pictures. They were inserted into a group, and I made a module which made the group into multiple pages (So you could scroll it. And no matter where you pressed on the group, even the button, the touch event for scrolling worked.

Now with Widget 2.0, when you try to scroll while your finger is on the button, the touch event for scrolling does not work. I am guessing it is because in the Widget they made it so when the button is pressed it is set focus.

Is there a workaround in which the touch event would work even if you were pressing the button?

If not, Corona, please add a switch or something! [import]uid: 130035 topic_id: 37033 reply_id: 67033[/import]

check out the setEnabled that they added on widget.newButton - not positive but it might help

http://docs.coronalabs.com/daily/api/type/ButtonWidget/setEnabled.html [import]uid: 32462 topic_id: 37033 reply_id: 145263[/import]

Yeah, I saw that, but it would have to be a bunch of code, because I want both the button and the module to receive “began” events. If the event has moved, than I want to use the module, if it hasn’t then I want to press the button. The problem is that I can’t really “see” the button from the module to enable it when the event has ended. And I also want the module to work regardless of how many buttons there are.

I guess it is possible to write something, but it would be a huge compromise.

If I was going to do it, I would probably dispatch a custom event from the module, and then have the main code listen for it, and then turn on the button. If thats the only way, then that is very wasteful. [import]uid: 130035 topic_id: 37033 reply_id: 145264[/import]

I mentioned this in the forums as soon as widget 2.0 was released. It’s similar to having an image return true.

How I got round the issue for now was to use images rather than buttons and NOT return true.
This was I can pick up the button name on the began phase, yet still scroll normally.

I’m using this due to the omission of takefocus [import]uid: 179960 topic_id: 37033 reply_id: 145280[/import]

I guess I will do that for now, but it would be great if Corona fixed this and you can do the same with buttons (not return true) [import]uid: 130035 topic_id: 37033 reply_id: 145470[/import]

check out the setEnabled that they added on widget.newButton - not positive but it might help

http://docs.coronalabs.com/daily/api/type/ButtonWidget/setEnabled.html [import]uid: 32462 topic_id: 37033 reply_id: 145263[/import]

Yeah, I saw that, but it would have to be a bunch of code, because I want both the button and the module to receive “began” events. If the event has moved, than I want to use the module, if it hasn’t then I want to press the button. The problem is that I can’t really “see” the button from the module to enable it when the event has ended. And I also want the module to work regardless of how many buttons there are.

I guess it is possible to write something, but it would be a huge compromise.

If I was going to do it, I would probably dispatch a custom event from the module, and then have the main code listen for it, and then turn on the button. If thats the only way, then that is very wasteful. [import]uid: 130035 topic_id: 37033 reply_id: 145264[/import]

I mentioned this in the forums as soon as widget 2.0 was released. It’s similar to having an image return true.

How I got round the issue for now was to use images rather than buttons and NOT return true.
This was I can pick up the button name on the began phase, yet still scroll normally.

I’m using this due to the omission of takefocus [import]uid: 179960 topic_id: 37033 reply_id: 145280[/import]

I guess I will do that for now, but it would be great if Corona fixed this and you can do the same with buttons (not return true) [import]uid: 130035 topic_id: 37033 reply_id: 145470[/import]