CRESS-Surrey / eXtraWidgets

An extension for creating additional interface tabs in the NetLogo GUI and putting custom widgets on them.
MIT License
13 stars 4 forks source link

Buttons should use "ownsPrimaryJobs" JobOwners #145

Closed qiemem closed 9 years ago

qiemem commented 9 years ago

Currently, xw buttons can have their jobs run concurrently with NetLogo buttons. This can give rise to some very unexpected and bizarre behavior. I believe their JobOwners should be initialized with:

  val owner = new SimpleJobOwner(key, ws.world.mainRNG, classOf[Observer]) {
    override def isButton = true
    override def ownsPrimaryJobs = true
  }
nicolaspayette commented 9 years ago

Thanks for the report, @qiemem! (And for the other ones as well!)

Do you have any examples of "unexpected and bizarre behavior" that I could try to reproduce to test the fix?

qiemem commented 9 years ago

The case in which it arose is fairly complex, though it was consistent, and it no longer occurred after the above change.

Naturally, when I try to create a small example for testing, I can't get the problem to occur (I did indeed revert to an unmodified xw)...

I'll keep trying to come up with a case. Sorry :( I know how frustrating it is to have bug report without a simple reproducible case.

nicolaspayette commented 9 years ago

You've found a subtle bug in fairly untested code and proposed a fix that makes sense and seems to have solved the problem in the context you found it. I can't really ask for more! If you can come up with a test case, that will be awesome, but if not, don't sweat it; I'll just merge as is. Thanks again!