Comments (7)
That's a tough one. I don't have access to a Windows machine and can't test it.
Chances are that event0
calls the underlying wxWindows library in ways that it can't handle. However, it may also be that I messed up something with observable sharing, which would explain the non-deterministic nature of the crash. Then, the fault would be with reactive-banana.
Does the problem appear on other machines as well? Does a similar example for wxHaskell exhibit the same problem?
from reactive-banana.
Sorry for long reply.
I had no other Win machine, but will try to reproduce the bug on other computers. Some time later I will also test similar scenario with pure wxHaskell. I can provide some more debug output, if I kno, what and how to collect.
from reactive-banana.
I can't reproduce the crash on OS X 10.6. That said, only a single button is shown on my screen. No idea why, but since no layout has been specified, this behavior is not forbidden, at least.
from reactive-banana.
I tested compiled code on another Win-machine, behaviour is the same. Although I am not able to compile from source there.
Speaking of only one button -- that's how it's supposed to be, layout does not affect the issue.
I still haven't tried pure wxHaskell example, as I'm not sure it will be very informative if that code is supposed to create responses on command
for all buttons and do nothing more.
from reactive-banana.
The pure wxHaskell version allows us to distinguish between problems in reactive-banana (which I could fix) and wxHaskell (which I can't fix). If the issue persists in a version that only uses wx
and not reactive-banana
, then we have the latter situation.
from reactive-banana.
I have compiled under windows without reactive-banana completely.
When line with (:=)
, marked as (*) is used, everything is perfectly fine,
but when I use (:~)
as in reactive-banana-wx event1ToAddHandler
,
random crashes occur frequently.
I guess, that it might be an issue with incorrect version of wx on my machine,
nevertheless, I believe this is better be reported to maintainers of wxHaskell.
I'll post an issue to wxHaskell.
> import Control.Monad (replicateM, mapM_)
> import Graphics.UI.WX
> main = start $ do
> pad <- frame [ ]
> buttons <- replicateM 2
> $ button pad []
> mapM_ (flip set [on command := return ()]) buttons -- (*) fine
> mapM_ (flip set [on command :~ const (return ())]) buttons
from reactive-banana.
Looks like it's an issue with wxHaskell, then, so I can't do much about it. I'll close the issue here, but feel free to to reopen!
If wxHaskell is giving you too much trouble, you may want to have a look at my other project threepenny-gui. It's a small GUI framework that uses the web browser and has FRP built in.
from reactive-banana.
Related Issues (20)
- Add `Monoid a => Monoid (MomentIO a)` (and `Moment`)
- Add `@>` HOT 3
- Successful evaluation for an undefined network HOT 5
- `reactive-banana` can't be compiled on GHC 9.2 HOT 2
- I created a Matrix channel HOT 8
- An interesting `Applicative`-ish way of combining `Event`s HOT 4
- Add `MonadMoment` instances for all monad transformers in `transformers` HOT 1
- Release 1.3.0.0 HOT 3
- Join Stackage HOT 4
- `Behavior` constantly re-evaluating when caching is expected HOT 4
- Unexpected memory growth HOT 6
- Event handler not seeing early events. HOT 12
- `Behavior`s can hold onto more memory than they need to HOT 2
- Memory leak with dynamic behavior switching HOT 16
- Gloss GUI events not responding HOT 5
- Idea: add a combinator to track when a behavior is a different value HOT 14
- Call `unregister` for garbage collected events made by `AddHandler`. HOT 9
- Discrepancy in model and implementation HOT 15
- Optimize representation of Latch HOT 1
- Not compatible with these-1.2 (disallowed) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactive-banana.