GBUI problem - no clicks

Hey, timo,



First, let me say thanks for all the great work you've done on GBUI and the tutorials, as well as all the help you've given here in the forum.



I read with interest your article on 'A Technique' and on one of your wiki pages on google I found atechnique_src_0.1.0.zip and gave it a try. Everything seems to be working very nicely BUT click events aren't making their way up to the view listeners. I've got GBUI built and running in eclipse just fine.


  1. Any thoughts?


  2. Should I even be monkeying around with ATechnique code? If so, then what's the license for ATechnique?



    Thanks very much!



    K
Kropotkin said:

Hey, timo,

First, let me say thanks for all the great work you've done on GBUI and the tutorials, as well as all the help you've given here in the forum.


Thank you, you're welcome and I can't take all of the credit for all of the tutorials.

Kropotkin said:

I read with interest your article on 'A Technique' and on one of your wiki pages on google I found atechnique_src_0.1.0.zip and gave it a try. Everything seems to be working very nicely BUT click events aren't making their way up to the view listeners. I've got GBUI built and running in eclipse just fine.


I am not sure about this, I've pulled down the code, I believe mj wrote it, so I've not used it.  I'll check it out and let you know.  I don't know that the events actually do anything.  I'll look and let you know in a short-bit.

Kropotkin said:

1) Any thoughts?


Kropotkin said:

2) Should I even be monkeying around with ATechnique code? If so, then what's the license for ATechnique?


Twofold answer: 1) the code is yours to use how you wish.  You can sell it, modify it, whatever you want with it.  It has the same licensing as the original BUI code the GNU Lesser General Public License.

Kropotkin said:

Thanks very much!

K


You're welcome

timo
standtrooper said:
I am not sure about this, I've pulled down the code, I believe mj wrote it, so I've not used it. 

Oops! Thanks, mj!

I'm coming back late to the party, but you're welcome!  It's great to hear that people are actually using what I wrote! :smiley:

mjsimpson said:

I'm coming back late to the party, but you're welcome!  It's great to hear that people are actually using what I wrote! :D

Well, I'd like to use it but the reason for the original post hasn't changed and I haven't heard anything back from timo. Is ther version I dl'd from the gbui (google) wiki the latest rev?

Thanks!

It's been a couple of months since I've had the time to work on this, so I apologize if you have to remind me how my own code works.  :stuck_out_tongue:



Anyway, I'm not sure exactly what problem you're seeing.  In my views (say, MainMenuView), when a button is clicked, it calls a method on an interface of that view.  For instance, in MainMenuView, pressing the "Play Campaign" button calls the "playCampaignPressed" method of the IMainMenuListener interface, which is implemented by MainMenuPresenter.



When you say that click events aren't making their way up to the view listeners, what events are you expecting, and which classes are you considering the view listeners?  I know that GBUI also uses "named" events, I believe that are defined in the constructor of the various widgets, but I haven't committed the time to actually figuring out how those work, so if you've modified the code to use those, I'm afraid I can't help; I'm just looking for the "click".



Hopefully I can help you, because I'm very impressed with GBUI (and the work that continues to be done with it), and I'd like to see more people use it as well.



BTW, it looks like I'm currently using revision 192 of the GBUI source.  I'm sure there's a later version but I've been burned before with unexpected incompatibilities so I'm trying not to update unless I have a specific reason for doing so.

mjsimpson said:

It's been a couple of months since I've had the time to work on this, so I apologize if you have to remind me how my own code works.  :P


MJ, I understand. I've been in the same boat. I got pulled off development of this app due to lack of progress but I'm back now.

mjsimpson said:
When you say that click events aren't making their way up to the view listeners, what events are you expecting, and which classes are you considering the view listeners? 


Well. Where to start... I have to tell the whole story otherwise it's just too embarrassing!

I spent the last hour poring over every line of code in your InGameState, the ClassFactory, your InGamePauseView and your InGamePausePresenter as well as MY InGameState and the LoginPresenter and LoginView - based on your InGamePausePresenter/InGamePauseView. I wanted to make sure I hadn't made some dumb mistake. But no, I had copied everything perfectly. And that was the problem (no, there's nothing wrong with your code).

I stepped thru this code I don't know how many times before I tried something... simple.

I copied your InGamePauseView to use in my LoginView but removed the code for the last three buttons since my LoginView only has two buttons.

I HAD noticed that you have this line of code for each of the first two buttons:

_btnSaveAs.setEnabled(false);

Like, I say, I HAD noticed it and thought it was odd but when I ran your code your buttons didn't look disabled and both the pause button and the exit button both worked (they were the only buttons I tried since I didn't want to save a game and they just happened to be the three buttons that I didn't need in my code). When I ran MY code I saw that they didn't look disabled - they just didn't 'click'. So I thought there's some code somewhere in the bowels of atechnique or GBUI that enables it at the appropriate time and my problem lay elsewhere. Silly me.

Finally, I thought, 'set the button.enabled to true and let's see what happens.'

Like I said, I had to tell the whole story, otherwise it's too embarrassing.

I see that the BSS for a button has a disabled state and I will make good use of it in the future!

I hope you had a good laugh - I certainly did. I'm just happy that it all works and that I can get going again.

Tx,

K

PS In future, I will try to remember the adage used by doctors: When you hear hooves, think horses, not zebras.

Glad to hear you got it going!  It sounds like once again, taking a break helped break the logjam.

mjsimpson said:

Glad to hear you got it going!  It sounds like once again, taking a break helped break the logjam.

Logjam? You're just being kind ;)

BTW - I really like the pattern and it's implementation. Cheers!