[wxhaskell-users] textCtrlGetSelection: type variable vs. CInt

2018-01-04 Thread Henning Thielemann


wxcore documentation [1] says:

   textCtrlGetSelection :: TextCtrl a -> Ptr b -> Ptr c -> IO ()

Is this correct? I assume b and c should be CInt.


[1] 
https://hackage.haskell.org/package/wxcore-0.92.3.0/docs/Graphics-UI-WXCore-WxcClassesMZ.html#v:textCtrlGetSelection

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] Error using FFI with wxHaskell

2014-09-14 Thread Henning Thielemann
Am 02.09.2014 um 09:25 schrieb Vivian McPhail:

> I've tried using pointers (Ptr a) but (DC a) and (Gtk.DrawWindow) aren't
> members of `Storable`.

I don't think there is any restriction to the type of the pointer 
target. Does GHC expect, that DC is Storable when you use an argument of 
type Ptr (DC a)?


--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] Error using FFI with wxHaskell

2014-08-31 Thread Henning Thielemann
Am 31.08.2014 um 06:48 schrieb Vivian McPhail:

> foreign import ccall unsafe "plot.cc gdk_get_drawable"
>  c_gdkGetDrawable :: DC a -> IO Gtk.DrawWindow

> How do I fix these errors?

You certainly need to use pointers, e.g. Ptr (DC a).


--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] Fwd: UI updates from non-UI threads: an addition to wx?

2013-01-12 Thread Henning Thielemann

On Sun, 30 Sep 2012, maciek.makow...@gmail.com wrote:

> I have now updated the module to use event-based notifications instead
> of polling: 
> https://github.com/mmakowski/habaz/blob/master/src/Graphics/UI/WX/Async.hs.
> The original question still stands: is it worth exposing this sort of
> abstraction as a part of wxHaskell?


Since no other one seems to answer ... I would like to see this 
functionality in a package, either a separate package or integrated in wx. 
In any case I think that the wx/wxcore package bundle must contain a 
function for providing us with free(!) event ids. This cannot be done 
reliably in a third party package.

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] monospace font in TextCtrl

2012-10-28 Thread Henning Thielemann

On Sat, 29 Sep 2012, Heinrich Apfelmus wrote:

> Henning Thielemann wrote:
>
>> It may be related to my observation that the textCtrl sometimes chooses a
>> variable-space font if I enter text at the end of a text Ctrl in an
>> otherwise mono-spaced text. That is, it seems to be important _how_ a text
>> is inserted.
>>
>> Maybe this is even a Wx bug?
>
> Most likely.
>
> It seems that in order to support monospace font, the text entry control
> is converted to Rich Text Formatting, and then you have font control
> commands as part of the input data.

I have added a 'case' that chooses the old code for GTK and apfelmus' one 
for other systems:
http://code.haskell.org/~thielema/wxhaskell/

Can someone check my change on Windows and eventually add the patch to the 
main repo? Shall this patch be added to the wxwidgets-2.9 branch, too?

--
WINDOWS 8 is here. 
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] Fwd: UI updates from non-UI threads: an addition to wx?

2012-09-26 Thread Henning Thielemann

On Wed, 26 Sep 2012, Henning Thielemann wrote:

> However, it seems to be essential what eventId you use. The value in the
> above example (wxID_HIGHEST+1) was already used in my system and this lead
> to strange behavior. I think wxhaskell should provide support for finding
> free event ids.


If you want to see this technique in action:
http://code.haskell.org/alsa/gui/src/controller.hs
http://code.haskell.org/alsa/gui/src/Common.hs

I have implemented both the busy wait (reactOnEventTimer) and the 
event-driven method (reactOnEvent).

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] Fwd: UI updates from non-UI threads: an addition to wx?

2012-09-26 Thread Henning Thielemann

On Wed, 26 Sep 2012, maciek.makow...@gmail.com wrote:

> Including wxhaskell-users. Anyone interested in async UI update functionality?

Am I right that the solution on StackOverflow uses a busy-wait using the 
Wx Timer? I think this is a bad idea and I found a better solution at:
http://snipplr.com/view/17538/

However, it seems to be essential what eventId you use. The value in the 
above example (wxID_HIGHEST+1) was already used in my system and this lead 
to strange behavior. I think wxhaskell should provide support for finding 
free event ids.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] monospace font in TextCtrl

2012-09-25 Thread Henning Thielemann

On Tue, 25 Sep 2012, Heinrich Apfelmus wrote:

> Henning Thielemann wrote:
>> When switching from wxcore-0.13.2 to GIT HEAD from
>> https://github.com/jodonoghue/wxHaskell the TextCtrl does no longer use a
>> monospaced font. This may be caused by the recent patch commented with
>>
>>"Fix for unexpected TextCtrl behaviour on OS X. This is the equivalent
>> of patch f225d0c on master."
>>
>> I create the text field this way:
>> WX.textCtrl panel [ font := fontFixed, wrap := WrapNone ]
>>
>> In the past TextCtrl always used a monospaced font, but when I entered
>> text at the end of a text field it happened sometimes that the font had no
>> longer fixed width characters. This might be a wxwidgets bug or even a gtk
>> bug. However, now the TextCtrl does not use the monospace font anymore.
>
> You can use the  textCtrlEx  function and pass additional style flags to
> it to create text controls with the old behavior. I think the previous
> source code was
>
>   textCtrlEx parent (wxTE_MULTILINE .+. wxTE_RICH2) props

I see. It sounds reasonable, too. Unfortunately switching back to this 
line does not work. Even if it would, it would bypass the improvement that 
was introduced with the last patch.

There were not many lines that changed, so I tried to revert them one by 
one and found that this change caused the problem:

-(\tc -> (textCtrlGetValue tc, \s -> do textCtrlClear tc; 
textCtrlWriteText tc s)) $
+(\tc -> (textCtrlGetValue tc, \s -> do textCtrlChangeValue tc s)) $


It may be related to my observation that the textCtrl sometimes chooses a 
variable-space font if I enter text at the end of a text Ctrl in an 
otherwise mono-spaced text. That is, it seems to be important _how_ a text 
is inserted.

Maybe this is even a Wx bug?

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


[wxhaskell-users] type safe handling of flags

2012-09-25 Thread Henning Thielemann

I don't know whether I proposed it already ...

I wrote a package called enumset. It provides low-level bitsets like they 
are used by wxWidget. The definition is essentially:

newtype EnumSet storage index = EnumSet storage

E.g. with

data Style = Bold | Italic | Underlined  deriving (Enum)

the type (EnumSet Word32 Style) represents a subset of {Bold, Italic, 
Underlined} stored as a bitfield in a Word32.

http://hackage.haskell.org/packages/archive/enumset/0.0.4/doc/html/Data-EnumSet.html


The other modules can be used to manage bitfields where not individual 
bits must be processed, but there are groups of bits, where each group 
represents a value.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


[wxhaskell-users] monospace in TextCtrl

2012-09-24 Thread Henning Thielemann

When switching from wxcore-0.13.2 to GIT HEAD from 
https://github.com/jodonoghue/wxHaskell the TextCtrl does no longer use a
monospaced font. This may be caused by the recent patch commented with

   "Fix for unexpected TextCtrl behaviour on OS X. This is the equivalent 
of patch f225d0c on master."

I create the text field this way:
WX.textCtrl panel [ font := fontFixed, wrap := WrapNone ]

In the past TextCtrl always used a monospaced font, but when I entered 
text at the end of a text field it happened sometimes that the font had no 
longer fixed width characters. This might be a wxwidgets bug or even a gtk 
bug. However, now the TextCtrl does not use the monospace font anymore.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


[wxhaskell-users] Setup failed

2012-06-14 Thread Henning Thielemann

On a Linux machine that I do not administrate the configuration of 
wxcore-0.13.2 stopped with a simple "Setup failed" and also the verbose 
mode did not show more information.

Then I found out that the package wx2.8-headers was installed but the 
package libwxgtk2.8-dev was missing. After libwxgtk2.8-dev was installed 
the package could be compiled and installed.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


[wxhaskell-users] missing wx_gtk2u_media-2.8 for wxhaskell-0.13

2012-04-09 Thread Henning Thielemann

I have now tried to move from wxhaskell-0.12 to 0.13, but this fails due 
to missing libwx_gtk2u_media-2.8.so like reported by Peter Simons. I have 
not built wxWidgets myself but use the version packaged for OpenSuse 10.3. 
That is, it seems that this dependency on media is new in wx-0.13, right?

Interestingly I found 'mmedia' instead of 'media'. That is, on Suse I have 
a file named libwx_gtk2u_mmedia-2.8.so but no libwx_gtk2u_media-2.8.so, 
and on Ubuntu 10.4 I have libwx_gtk2u_media-2.8.so but no 
libwx_gtk2u_mmedia-2.8.so. Are these two files the same?

--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] Major changes to repo at code.haskell.org

2012-04-05 Thread Henning Thielemann

On Wed, 4 Apr 2012, Jeremy O'Donoghue wrote:

> I'm not quite comfortable moving to 1.0 - sounds a bit 'finished' to me.

Somehow yes. But wxhaskell is already very good and usable for my taste. 
So 1.0 would be justified even for the current version. Even more we have 
packages like HTTP with version 4000. :-)

> How about a compromise: I'll bump the new version to 0.20.

Sure, this would be a compromise, but psychologically it puts pressure on 
us to not release too often to Hackage, since every release reduces the 
available number of major bumps.

Nonetheless I would feel more comfortable if other wxhaskell users would 
vote in favor of branching to version 1.0 or against it.


Best,
Henning

--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] Major changes to repo at code.haskell.org

2012-04-04 Thread Henning Thielemann

on a second thought ...

On Tue, 3 Apr 2012, Jeremy O'Donoghue wrote:

>  *  The mainline will have the patches needed to update to support wxWidgets 
> 2.9.x, based on the work
> by Dave Tapley and others, and sourced from the development repositories 
> on Darcsden, Readers of
> the wxhaskell-devel list will be familiar with these.
...
>  +  The new codeline starts as version 0.15. Users will find that this is 
> contained in the
> directories:

If the new version is such a big change, how about calling it version 1.0?

This would also give us a larger range of versions for the wxWidgets-2.8 
compatibility branch. You know, sometimes even small changes require a 
major version bump, such as adding an instance to Selection, etc.

--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] Major changes to repo at code.haskell.org

2012-04-03 Thread Henning Thielemann

On Tue, 3 Apr 2012, Jeremy O'Donoghue wrote:

> Please shout loudly and soon if you have any problem with what I am planning 
> to do, as I am planning
> to make these changes within the next week. The wxWidgets 2.9 support has 
> been waiting in limbo for
> too long now (my fault, I accept).

Your plans sound great. Please go ahead!


Best,
Henning

--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] splitterWindow

2012-04-02 Thread Henning Thielemann


On Mon, 2 Apr 2012, Jeremy O'Donoghue wrote:


This is a very good idea, but I was thinking of doing almost exactly the 
opposite: before I apply the
changes to the main repo, I was planning to create a wxHaskell-0.13 (wxWidgets 
2.8.x) branch on
code.haskell.org, probably by creating wxdirect-0.13, wxcore-0.13 and wx-0.13 
branches as separate
directories. The other option would be to move 0.13 support to Darcsden.


For the repositories of my projects I tend to use one repository per Cabal 
package, because I use darcs tags for tagging versions that I uploaded to 
Hackage and the versions, especially the minor versions, of the packages 
of one project are not always in sync. Translated to wxhaskell this means, 
current wxcore might have version 0.13.2.1 whereas wx might have version 
0.13.3.7.



I think it makes sense to have a 'central' repo for changes. It is easy 
for private repositories to be lost over time.


Does this work for you? 


This would be perfect. What is the advantage of darcsden compared to 
code.haskell.org? Currently I am very happy with code.haskell.org.



Best,
Henning

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] splitterWindow

2012-03-30 Thread Henning Thielemann

On Tue, 27 Mar 2012, Henning Thielemann wrote:

> I want to use a splitterWindow. For instance I wanted to change the 'gravity' 
> because the default value is not appropriate for my application. 
> Unfortunately there is no splitterWindowSetSashGravity function.

I have added splitterWindowSetSashGravity to WxcClassesMZ of my working 
copy of wxcore. I have also some other small additions like 'selection' 
attribute for notebooks. Since not everybody wants to move to the new 
wxwidgets immediately, how about updating wx-0.13 with small additions for 
a while? I could simply apply the patches myself and upload new wxhaskell 
packages to Hackage myself if the main maintainers want to concentrate on 
new wx versions.

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


[wxhaskell-users] splitterWindow

2012-03-27 Thread Henning Thielemann

I want to use a splitterWindow. For instance I wanted to change the 
'gravity' because the default value is not appropriate for my application. 
Unfortunately there is no splitterWindowSetSashGravity function.

Then I like to react to a moved sash of the splitter window. I did not 
find an Event for this purpose. How can I define my own one?

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] ListCtrl scroll state or Virtual ListCtrl, and I'd appreciate some mentoring

2012-03-26 Thread Henning Thielemann

On Sun, 25 Mar 2012, Aur Saraf wrote:

> I need a ListCtrl that I can edit and not only append to. That means
> either a version of appendItem that takes an index that I've missed, a
> way to get and later set the scroll-state of a ListCtrl (and then I
> can just reset all items on every edit) or a way to use the
> wxLC_VIRTUAL style available in C++ wxWidgets.

Note that the 'wx' package provides the high-level interface, but not 
everything can be handled through this interface. A richer set of 
functions is provided by the 'wxcore' package. There you find the modules 
Graphics.UI.WXCore.WxcClassesAL and Graphics.UI.WXCore.WxcClassesMZ that 
provide low-level interfaces to the methods of the classes starting with 
letters A-L and M-Z, respectively.

So if I want to find out about additional functions of listCtrl I first 
look into the wxWidgets documentation, i.e.
   /usr/share/doc/wx2.8-doc/wx-manual.html/wx_wxlistctrl.html

There I find a method named wxListCtrl::InsertItem in various flavors, 
also a variant with an explicit index. Now I can lookup listCtrlInsertItem 
in WxcClassesAL and find according functions.


> Also, as I said in the title, I'd really appreciate if someone could
> take some time to be available for a few beginner questions on some
> chat or email platform. I find that wxHaskell has too much lore for me
> to learn without an experienced hand guiding me. I promise to research
> every question before I resort to asking my mentor.

I think this mailing is a good place because all answers can be seen 
publically and thus may help other people with the same problems.

What I also use frequently in order to find the correct widget class are 
the example collections. There are some Haskell examples in the 'samples' 
folder of the wxhaskell repository and there are even more C++ examples in 
the wxwidgets documentation:
   /usr/share/doc/wx2.8-doc/wx-manual.html/wx_samples.html
  What I am really missing are screenshots of the widgets because often I 
cannot imagine the GUI elements from their literal description.

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] Working guide for wxWidgets and wxHaskell on Mac OS X Lion 64 bit

2012-02-27 Thread Henning Thielemann


On Mon, 27 Feb 2012, Eric Kow wrote:


On 27 Feb 2012, at 15:38, Eric Kow wrote:


darcs get --lazy http://code.haskell.org/wxhaskell 
the-patch-you-downloaded.dpatch
cd wxhaskell
darcs apply -i ~/foo/the-patch-you-downloaded.dpatch


Oops, that's darcs get --lazy  --context 

The idea is that darcs will then grab  and then unapply patches until 
it's wound its way back to the context that the patch was expecting.  This way you 
avoid thinking about merging or conflicts.


Btw. I hope you do not have problems with latest GHC-7.4.1. I did some 
patches to wxcore-0.12.1.7 in order to let wxhaskell work with GHC-7.4.1. 
Where shall I send them, since wxhaskell moved to wxWidgets-3.0?


I have attached a diff.
diff -rN -u old-wxhaskell-0.12/wxcore/src/haskell/Graphics/UI/WXCore/WxcTypes.hs new-wxhaskell-0.12/wxcore/src/haskell/Graphics/UI/WXCore/WxcTypes.hs
--- old-wxhaskell-0.12/wxcore/src/haskell/Graphics/UI/WXCore/WxcTypes.hs	2012-02-27 21:40:16.0 +0100
+++ new-wxhaskell-0.12/wxcore/src/haskell/Graphics/UI/WXCore/WxcTypes.hs	2012-02-27 21:40:16.0 +0100
@@ -568,7 +568,7 @@
 rectFromSize (Size w h)
   = Rect 0 0 w h
 
-rectIsEmpty :: (Num a) => Rect2D a -> Bool
+rectIsEmpty :: (Num a, Eq a) => Rect2D a -> Bool
 rectIsEmpty (Rect l t w h)
   = (w==0 && h==0)
 
@@ -850,7 +850,7 @@
 toCChar = castCharToCChar
 
 -- generalised to work with Char and CChar
-withCharResult :: (Num a, Integral a) => IO a -> IO Char
+withCharResult :: (Num a, Integral a, Show a) => IO a -> IO Char
 withCharResult io
   = do x <- io
if (x < 0)
diff -rN -u old-wxhaskell-0.12/wxcore/wxcore.cabal new-wxhaskell-0.12/wxcore/wxcore.cabal
--- old-wxhaskell-0.12/wxcore/wxcore.cabal	2012-02-27 21:40:16.0 +0100
+++ new-wxhaskell-0.12/wxcore/wxcore.cabal	2012-02-27 21:40:16.0 +0100
@@ -1,5 +1,5 @@
 name: wxcore
-version:  0.12.1.7
+version:  0.12.1.7.1
 license:  LGPL
 license-file: LICENSE
 author:   Daan Leijen
@@ -203,7 +203,7 @@
 
   if flag(splitBase)
 build-depends:
-  array >= 0.2 && < 0.4,
+  array >= 0.2 && < 0.5,
   base >= 4 && < 5,
   containers >= 0.2 && < 0.5
   else
diff -rN -u old-wxhaskell-0.12/wxdirect/wxdirect.cabal new-wxhaskell-0.12/wxdirect/wxdirect.cabal
--- old-wxhaskell-0.12/wxdirect/wxdirect.cabal	2012-02-27 21:40:16.0 +0100
+++ new-wxhaskell-0.12/wxdirect/wxdirect.cabal	2012-02-27 21:40:16.0 +0100
@@ -60,7 +60,7 @@
 
   build-depends:
 parsec >= 2.1.0 && < 4,
-time   >= 1.0   && < 1.3
+time   >= 1.0   && < 1.5
 
   if flag(splitBase)
 build-depends:
--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] ANN: wxHaskell 0.13.2

2012-01-08 Thread Henning Thielemann

On Sat, 7 Jan 2012, Peter Simons wrote:

> Hi guys,
>
> > I am please to announce that wxHaskell 0.13.2 has just been uploaded
> > to Hackage.
>
> when I try to build the latest version on Linux/x86_64 running NixOS, I
> get the following error at configure time:
>
>Setup: Missing dependency on a foreign library:
>* Missing C library: wx_gtk2u_media-2.8
>
> I searched my hard disk for that library, and apparently my installed
> copy of wxGTK-2.8.12 doesn't have it. There are plenty of libwx_gtk2u_*
> libraries, but none of them is called "media".

Is it the only missing header? Once when I tried to install wxhaskell I 
got a lot of missing header errors although all dev packages were 
installed. They went away when I installed 'g++'. It was a plain Haskell 
development machine before :-)

--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] adapt layout after changing 'visible' state

2011-12-08 Thread Henning Thielemann

On Thu, 8 Dec 2011, Henning Thielemann wrote:

> I think the best place for documenting the solution is not the FAQ but the 
> documentation of the Visible class.

Here is my proposed patch:

wxhaskell/wx$ darcs2 diff --unified src/Graphics/UI/WX/Classes.hs
--- old-wxhaskell/wx/src/Graphics/UI/WX/Classes.hs  2011-12-08 
19:45:56.0 +0100
+++ new-wxhaskell/wx/src/Graphics/UI/WX/Classes.hs  2011-12-08 
19:45:56.0 +0100
@@ -173,6 +173,19 @@
  -- | Visible widgets.
  class Visible w where
-- | Is the widget visible?
+  --
+  -- If you hide a widget, its space will not immediately
+  -- be filled by other widgets.
+  -- Vice versa if you make a widget visible
+  -- it will not have space to be rendered into.
+  -- That is, when changing the visibility state
+  -- it is advised to update the layout
+  -- using 'Graphics.UI.WX.Layout.windowReFit'.
+  --
+  -- Example:
+  --
+  -- > do set w [ visible := False ]
+  -- >windowReFit w
visible:: Attr w Bool
-- | Refresh the widget explicitly.
refresh:: w -> IO ()


--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] adapt layout after changing 'visible' state

2011-12-08 Thread Henning Thielemann


On Wed, 7 Dec 2011, David Virebayre wrote:


2011/12/6 Henning Thielemann 

  I have a textCtrl 'editor' and a menu item 'editorVisible' that controls
  the visibility of the textCtrl.

      set editorVisible
          [ on command := do
               b <- get editorVisible checked
               set editor [ visible := b ] ]


I had the same problem, and I couldn't solve it the way I wanted.
It's old but I think I read that I shouldn't use visible for this, but remove 
the
element from the layout and re-set the modified layout.



 I got it working by adding 'windowReFit editor' or 'windowReLayout frame' 
after 'set editor [ visible := b ]'.


 I do not know, whether this is intended behaviour or an ugly hack. The 
official example controls.cpp uses a BoxSizer object and its Show method. 
I am uncertain how to translate this to wxhaskell. How do I create a 
BoxSizer object? With boxSizerCreate or sizerFromLayout? How do I add the 
BoxSizer object? By converting it to a Layout using 'sizer'?


 I think the best place for documenting the solution is not the FAQ but 
the documentation of the Visible class.


--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


[wxhaskell-users] adapt layout after changing 'visible' state

2011-12-06 Thread Henning Thielemann

I have a textCtrl 'editor' and a menu item 'editorVisible' that controls 
the visibility of the textCtrl.

 set editorVisible
 [ on command := do
  b <- get editorVisible checked
  set editor [ visible := b ] ]

Now when I uncheck the menu item editorVisible, then the editor actually 
disappears, but its space becomes empty and is not occupied by the other 
widgets in the GUI. When I resize the window then all widgets are 
relayouted and the space of the invisible textCtrl is covered by the other 
widgets. That is the result that I want to have, but without resizing the 
window. Vice versa when I make the editor visible via the menu, then it 
cannot be seen immediately but only after window resizing.

How can I achieve immediate relayout of the window when changing the 
showing or hiding the editor? I tried 'refresh editor' and 'refresh panel' 
and 'refresh frame' (where panel and frame are the surrounding widgets) 
but this does not trigger new layout.

I use wxwidgets-2.8 on GTK and Linux.

--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] Custom events

2011-10-30 Thread Henning Thielemann

On Sun, 30 Oct 2011, Henning Thielemann wrote:

> Recently on this list it was suggested to use
>
>   myEventId = wxID_HIGHEST+1
>
> for custom events and register them as menu events.
>
>   http://snipplr.com/view/17538/
>
>
> Now I added menus to my application and I got the strange behaviour that
> selecting a certain menu item (the second one of all items) let my
> application freeze. I found out that this could be solved by choosing a
> different EventId. So is the id wxID_HIGHEST+1 really free for use? How
> can I safely choose an id that is free for custom use? Is it sensible to
> consider custom events as menu events?

I found in Graphics.UI.WXCore.Types:

varTopId :: Var Id
varTopId
   = unsafePerformIO (varCreate (wxID_HIGHEST+1))

It looks like wxID_HIGHEST+1 is alreay used by wxhaskell. How can I make 
sure that I do not clash with id's used by wxhaskell in future?

--
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World™ now supports Android™ Apps 
for the BlackBerry® PlayBook™. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


[wxhaskell-users] Custom events

2011-10-30 Thread Henning Thielemann

Recently on this list it was suggested to use

   myEventId = wxID_HIGHEST+1

for custom events and register them as menu events.

   http://snipplr.com/view/17538/


Now I added menus to my application and I got the strange behaviour that 
selecting a certain menu item (the second one of all items) let my 
application freeze. I found out that this could be solved by choosing a 
different EventId. So is the id wxID_HIGHEST+1 really free for use? How 
can I safely choose an id that is free for custom use? Is it sensible to 
consider custom events as menu events?

I don't understand much of these id's. Without these custom events you do 
not have to bother with id's in wxhaskell.

--
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World™ now supports Android™ Apps 
for the BlackBerry® PlayBook™. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


[wxhaskell-users] instance Selection (Notebook a)

2011-10-23 Thread Henning Thielemann

How about adding this instance

instance Selection (Notebook a) where
 selection =
 newAttr "selection"
 WXCMZ.notebookGetSelection
 (\nb -> fmap (const ()) . WXCMZ.notebookSetSelection nb)

?

--
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


[wxhaskell-users] assert that WX.start is run exactly once

2011-10-10 Thread Henning Thielemann

Sometimes I forget to enclose a WX-GUI in WX.start, now I have a case, 
where WX.start was called twice at different places.

How about putting the WX commands in a separate monad and give WX.start 
the signature:

WX.start :: WX a -> IO ()

?

--
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


[wxhaskell-users] how to generate an event?

2011-10-10 Thread Henning Thielemann

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"?

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.

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


Re: [wxhaskell-users] Haskell Platform roadmap?

2011-06-20 Thread Henning Thielemann

On Thu, 16 Jun 2011, Heinrich Apfelmus wrote:

> I'm currently working on the FRP part [1]. It turns out that FRP is
> completely orthogonal to wxHaskell; there is no need to add special
> support for FRP in the GUI library. A handful of convenience wrappers
> [2] are enough to transform wxHaskell into a fully featured FRP-GUI
> library.

+1

> In other words, you can simply focus on the mid-level GUI
> bindings and get that into the platform.

May I advertise my enumset library that allows to handle flag sets as the 
ones in Graphics.UI.WXCore.WxcDefs in a safe and efficient way:
http://hackage.haskell.org/package/enumset


--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] OpenGL support

2011-05-26 Thread Henning Thielemann
Jeremy O'Donoghue schrieb:

> On 25 May 2011 21:04, Joel Shellman  > wrote:
> 
> What would it take to get full support for OpenGL in wxHaskell? My
> understanding is that wxWidgets supports it, we just need the Haskell
> binding for it, right? And I think it used to be there in a previous
> version of wxHaskell.
> 
> 
> Putting support for OpenGL canvas into wxHaskell is very
> straightforward. I could do the code in about an hour.

Would it be possible to implement this in a separate package? wx-opengl
or so? I didn't need OpenGL support so far.


--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


[wxhaskell-users] List Box triggering an event on deconstruction

2011-04-28 Thread Henning Thielemann
I noticed that WX.singleListBox triggers a 'select' event when I quit
the program. This has two bad consequences: The event handler may access
other widgets that are already deconstructed (segmentation fault) and
the (get listBox selection) returns (-1) what is an invalid value in my
application. Is this a bug or a feature?

http://code.haskell.org/alsa/gui/src/program.hs

--
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


[wxhaskell-users] VSlider that supports swapped order of bounds

2011-04-28 Thread Henning Thielemann
I wanted to have a vertical slider with small numbers at the bottom and
large numbers at the top. To this end I implemented a variant of
'vslider' that automatically inverses its direction, if the bottom value
is smaller than the top value. You may like to replace the current
'vslider' implementation by this one (and the hslider accordingly).


wxSL_INVERSE :: Int
wxSL_INVERSE = 0x1000

vslider ::
   WX.Window a -> Bool -> Int -> Int ->
   [WX.Prop (WX.Slider ())] -> IO (WX.Slider ())
vslider parentW showLabels top bottom props =
   let (minV, maxV, dirFlags) =
  if tophttp://p.sf.net/sfu/whatsupgold-sd
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


[wxhaskell-users] reacting on ALSA events in a wxhaskell application

2011-04-15 Thread Henning Thielemann

I managed to write my first Haskell program with a GUI! It shows a window 
of sliders and when you move a slider it sends an according MIDI 
controller message via ALSA.

http://code.haskell.org/~thielema/alsa-gui/

Now I like to provide the reverse direction: If my program receives a MIDI 
controller event via ALSA, then it shall update the slider position. I can 
do this by using WX's timer events and check for incoming ALSA events in 
regular intervals. Is there also a way to wait for ALSA events as they 
come in, without a busy wait?

--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users