anyone using wxHaskell

Dear haskell cafe, I have a problem with scrolledWindow inside notebook, when running with the latest version of wxHaskell. See the minimal example below, where the scrollbar is not shown (the same sample is OK on the wxHaskell version from few years ago). I would appreciate a suggestion how to make the scrollbar work again (a workaround if possible). I have also filed the issue on the wxHaskell project page. But the project does not look like being super actively maintained. https://codeberg.org/wxHaskell/wxHaskell/issues/48 Minimal example: module Main where import Graphics.UI.WXCore import Graphics.UI.WX gui :: IO () gui = do f <- frame [text := "Frame"] p <- panel f [] nb <- notebook p [] p1 <- scrolledWindow nb [ scrollRate := sz 20 20 ] texts <- mapM (\n -> staticText p1 [text := ("test" <> show n) ]) [1::Int ..20] set f [ layout := fill $ widget p , clientSize := sz 400 200 ] set p [ layout := fill $ tabs nb [ tab "tab1" $ container p1 $ column 5 (fmap widget texts) ] ] main :: IO () main = start gui regards, Zoran

Hi Zoran,
wxhaskell refuses to compile with GHC 8.6.5 (or a more modern version). I
have not tried anything prior to 8.6.5.
The last update to https://hackage.haskell.org/package/wx was over 7 years
ago. The version of wxc on hackage won't compile with Cabal >= 2.2 because
of a change to the signature of rawSystemStdInOut, which is needed during
the configure step for the package. That's as far as I went; there could be
other issues.
If you are able to create a docker image that compiles everything inside
and reproduces your error with the scrollbar, I can give it a try.
There appears to have been an attempt at reviving the project:
https://sourceforge.net/p/wxhaskell/bugs/, and people at Zurihac were
working on it. I don't know what happened.
Cheers,
Ivan
On Mon, 14 Oct 2024 at 09:31, Zoran Bošnjak
Dear haskell cafe, I have a problem with scrolledWindow inside notebook, when running with the latest version of wxHaskell. See the minimal example below, where the scrollbar is not shown (the same sample is OK on the wxHaskell version from few years ago).
I would appreciate a suggestion how to make the scrollbar work again (a workaround if possible). I have also filed the issue on the wxHaskell project page. But the project does not look like being super actively maintained.
https://codeberg.org/wxHaskell/wxHaskell/issues/48
Minimal example:
module Main where import Graphics.UI.WXCore import Graphics.UI.WX
gui :: IO () gui = do f <- frame [text := "Frame"] p <- panel f [] nb <- notebook p [] p1 <- scrolledWindow nb [ scrollRate := sz 20 20 ] texts <- mapM (\n -> staticText p1 [text := ("test" <> show n) ]) [1::Int ..20] set f [ layout := fill $ widget p , clientSize := sz 400 200 ] set p [ layout := fill $ tabs nb [ tab "tab1" $ container p1 $ column 5 (fmap widget texts) ] ]
main :: IO () main = start gui
regards, Zoran _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

On Mon, 14 Oct 2024, Ivan Perez wrote:
wxhaskell refuses to compile with GHC 8.6.5 (or a more modern version). I have not tried anything prior to 8.6.5.
It seems, the project has moved there: https://codeberg.org/wxHaskell/wxHaskell/ This code can be compiled with recent GHC versions and for instance with some Nix glue.

Hi Ivan, if you have nix, you could get the nix-shell environment from the actual project and copy over the sample file: git clone https://github.com/zoranbosnjak/vcr.git cd vcr nix-shell # wait for half of the internet to compile :) # create test.hs sample either by copy-paste from the email below # or from https://codeberg.org/wxHaskell/wxHaskell/issues/48 # once inside the nix shell, run the sample runhaskell test.hs I've never used docker for that purpose, but I will try to create it if you have any issues with the procedure above. Let me know. regards, Zoran On 2024-10-15 03:20, Ivan Perez wrote:
Hi Zoran,
wxhaskell refuses to compile with GHC 8.6.5 (or a more modern version). I have not tried anything prior to 8.6.5.
The last update to https://hackage.haskell.org/package/wx was over 7 years ago. The version of wxc on hackage won't compile with Cabal >= 2.2 because of a change to the signature of rawSystemStdInOut, which is needed during the configure step for the package. That's as far as I went; there could be other issues.
If you are able to create a docker image that compiles everything inside and reproduces your error with the scrollbar, I can give it a try.
There appears to have been an attempt at reviving the project: https://sourceforge.net/p/wxhaskell/bugs/, and people at Zurihac were working on it. I don't know what happened.
Cheers,
Ivan
On Mon, 14 Oct 2024 at 09:31, Zoran Bošnjak
wrote: Dear haskell cafe, I have a problem with scrolledWindow inside notebook, when running with the latest version of wxHaskell. See the minimal example below, where the scrollbar is not shown (the same sample is OK on the wxHaskell version from few years ago).
I would appreciate a suggestion how to make the scrollbar work again (a workaround if possible). I have also filed the issue on the wxHaskell project page. But the project does not look like being super actively maintained.
https://codeberg.org/wxHaskell/wxHaskell/issues/48
Minimal example:
module Main where import Graphics.UI.WXCore import Graphics.UI.WX
gui :: IO () gui = do f <- frame [text := "Frame"] p <- panel f [] nb <- notebook p [] p1 <- scrolledWindow nb [ scrollRate := sz 20 20 ] texts <- mapM (\n -> staticText p1 [text := ("test" <> show n) ]) [1::Int ..20] set f [ layout := fill $ widget p , clientSize := sz 400 200 ] set p [ layout := fill $ tabs nb [ tab "tab1" $ container p1 $ column 5 (fmap widget texts) ] ]
main :: IO () main = start gui
regards, Zoran _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

On Mon, 14 Oct 2024, Zoran Bošnjak wrote:
I have a problem with scrolledWindow inside notebook, when running with the latest version of wxHaskell. See the minimal example below, where the scrollbar is not shown (the same sample is OK on the wxHaskell version from few years ago).
I can reproduce your example, see attached screenshot. Running on libwxgtk3.2. Is scrolledWindow intended to have the scrollbar included? I would simply add a scrollbar and connect it with the scrolledWindow.

Yes, the scrollbar is intended, but it's not there. Your sample shows exactly the problem. I am attaching the intended result (from the old wxHaskell version) and the actual result (from the latest wxHaskell version, the actual result is the same as yours). Do you have an idea how to modify the sample to show the scrollbar? regards, Zoran On 2024-10-15 10:05, Henning Thielemann wrote:
On Mon, 14 Oct 2024, Zoran Bošnjak wrote:
I have a problem with scrolledWindow inside notebook, when running with the latest version of wxHaskell. See the minimal example below, where the scrollbar is not shown (the same sample is OK on the wxHaskell version from few years ago).
I can reproduce your example, see attached screenshot. Running on libwxgtk3.2.
Is scrolledWindow intended to have the scrollbar included? I would simply add a scrollbar and connect it with the scrolledWindow.

On Tue, 15 Oct 2024, Zoran Bošnjak wrote:
Yes, the scrollbar is intended, but it's not there. Your sample shows exactly the problem. I am attaching the intended result (from the old wxHaskell version) and the actual result (from the latest wxHaskell version, the actual result is the same as yours).
Do the two wxHaskell versions use the same wxwidgets version? There might be differences in wxwidgets releases.
Do you have an idea how to modify the sample to show the scrollbar?
Either there is a flag to make it visible again, or it was intentionally removed and then I would add a scrollbar myself and connect it to the scrolledWindow.

Do the two wxHaskell versions use the same wxwidgets version? There might be differences in wxwidgets releases.
Indeed, there might be something related to the version. Not sure how to check exactly what is included, but the wxhaskell README says: - old wxhaskell: against: wxWidgets (http://www.wxwidgets.org/) 2.9.3 up to and including 3.0.3 - new wxhaskell: Builds against: [wxWidgets](https://www.wxwidgets.org/) 3.2
Either there is a flag to make it visible again, or it was intentionally removed and then I would add a scrollbar myself and connect it to the scrolledWindow.
I would appreciate a code snippet, to show exactly how.
participants (3)
-
Henning Thielemann
-
Ivan Perez
-
Zoran Bošnjak