On 10 October 2011 19:25, Henning Thielemann
wrote:
>
> From: Johannes Waldmann waldmann at imn.htwk-leipzig.de
> Mon Oct 10 14:42:52 CEST 2011
>
>
> Dear all,
>
> in wxHaskell (core) I can set and get event handlers
> http://hackage.haskell.org/packages/archive/wxcore/0.12.1.7/doc/html/Graphics-UI-WXCore-Events.html
> but how is it possible to create events (programmatically)
> and somehow feed them into the "main event handling loop"?
Well, the closest I've come to writing an event handler is wrapping an
additional one from wxWidgets (for wxPropertyGrid). You can see the
changes where I added it in darcsden[1]. If you look at the second
hunk there (wx/src/Graphics/UI/WX/Controls.hs :: line 1231) you can
see how I provide a "propertyGridEvent" function to create a new
event. I then use this function in the sample code I added (in
samples/wx/PropertyGrid.hs) like this:
"pg <- propertyGrid p [on propertyGridEvent := onPropertyGridEvent]".
>
> I think I need this in an application that needs to handle
> concurrently events that arrive via the GUI (like mouse clicks)
> and events from an external source (specifically, alsa-midi input).
>
> Of course I could handle those "extra events" separately from wxcore,
> but they should ultimately result in changes to the GUI state,
> and it feels dangerous to do this without synchronisation.
I concur, the thought of handling synchronisation separately does
'smell bad' doesn't it.
There must be some way to thread events through the wxWidgets library.
Hopefully using the information above as a starting point, along with
the wxWidgets documentation, you can find something.
Thanks,
Dave
>
> Any hints welcome. Thanks - J.W.
>
> --
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2dcopy1
> ___
> wxhaskell-users mailing list
> wxhaskell-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wxhaskell-users
>
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users