wxHaskell not in scope

Hello, I'm trying to create a GUI by using wxHaskell. However I get the weird error message of "Not in scope "dt"", well so I sorted them so that my so called "dt" was in scope, however it failed. Can someone please tell me how I can solve this error? ... A lot of code that is not relevant in my opinion, if I'm wrong please correct me and I will post my full code --Debug text -- dt <- staticText f [text := "Hello world!"] imagePanel <- panel f [position := Point 2 2, clientSize := Size 100 100, tooltip := "This is a drawPanel", bgcolor := rgb 255 255 255] set f [ clientSize := Size 700 500, menuBar := [mFile, mHelp], visible := True, on (menu exit) := close f, on (menu open) := onOpen f vFile ] return () where onOpen :: Frame a -> Var b -> IO () onOpen frame var = do file <- fileOpenDialog frame False True "Open File" [("PGM bestanden (*.pgm)",["*.pgm"]),("Alle bestanden (*.*)",["*.*"])] "" "" case file of Nothing -> return () Just file -> set dt [text := "HELLO"] return () Thank you for your help, I really owe haskell-cafe. Greetings Tsunkiet Man

Variables bound in the do block are not in scope in the where.
Use a let inside the do for onOpen instead.
On Thu, Apr 16, 2009 at 11:53 PM, Tsunkiet Man
Hello,
I'm trying to create a GUI by using wxHaskell. However I get the weird error message of "Not in scope "dt"", well so I sorted them so that my so called "dt" was in scope, however it failed. Can someone please tell me how I can solve this error?
... A lot of code that is not relevant in my opinion, if I'm wrong please correct me and I will post my full code
--Debug text -- dt <- staticText f [text := "Hello world!"]
imagePanel <- panel f [position := Point 2 2, clientSize := Size 100 100, tooltip := "This is a drawPanel", bgcolor := rgb 255 255 255] set f [ clientSize := Size 700 500, menuBar := [mFile, mHelp], visible := True, on (menu exit) := close f, on (menu open) := onOpen f vFile ]
return ()
where onOpen :: Frame a -> Var b -> IO () onOpen frame var = do file <- fileOpenDialog frame False True "Open File" [("PGM bestanden (*.pgm)",["*.pgm"]),("Alle bestanden (*.*)",["*.*"])] "" "" case file of Nothing -> return () Just file -> set dt [text := "HELLO"] return ()
Thank you for your help, I really owe haskell-cafe.
Greetings Tsunkiet Man _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Thank you for your response, however if I can't do that, why can the example
of wxHaskell do that?
I refer to the following code inside
http://darcs.haskell.org/wxhaskell/samples/wx/ (ImageViewer.hs)
Line 99 untill 110
openImage sw vbitmap mclose status fname
= do -- load the new bitmap
bm <- bitmapCreateFromFile fname -- can fail with exception
closeImage vbitmap
set vbitmap [value := Just bm]
set mclose [enabled := True]
set status [text := fname]
-- reset the scrollbars
bmsize <- get bm size
set sw [virtualSize := bmsize]
repaint sw
`catch` \err -> repaint sw
if I'm correct the openImage is also defined in the where clause. Therefor
by what I think it should not be possible, but it is.
Thanks for everything.
2009/4/17 Lennart Augustsson
Variables bound in the do block are not in scope in the where. Use a let inside the do for onOpen instead.
On Thu, Apr 16, 2009 at 11:53 PM, Tsunkiet Man
wrote: Hello,
I'm trying to create a GUI by using wxHaskell. However I get the weird error message of "Not in scope "dt"", well so I sorted them so that my so called "dt" was in scope, however it failed. Can someone please tell me how I can solve this error?
... A lot of code that is not relevant in my opinion, if I'm wrong please correct me and I will post my full code
--Debug text -- dt <- staticText f [text := "Hello world!"]
imagePanel <- panel f [position := Point 2 2, clientSize := Size 100 100, tooltip := "This is a drawPanel", bgcolor := rgb 255 255 255] set f [ clientSize := Size 700 500, menuBar := [mFile, mHelp], visible := True, on (menu exit) := close f, on (menu open) := onOpen f vFile ]
return ()
where onOpen :: Frame a -> Var b -> IO () onOpen frame var = do file <- fileOpenDialog frame False True "Open File" [("PGM bestanden (*.pgm)",["*.pgm"]),("Alle bestanden (*.*)",["*.*"])] "" "" case file of Nothing -> return () Just file -> set dt [text := "HELLO"] return ()
Thank you for your help, I really owe haskell-cafe.
Greetings Tsunkiet Man _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

The names defined in the where clause are in scope in the do block,
but not vice versa.
On Fri, Apr 17, 2009 at 12:43 AM, Tsunkiet Man
Thank you for your response, however if I can't do that, why can the example of wxHaskell do that?
I refer to the following code inside http://darcs.haskell.org/wxhaskell/samples/wx/ (ImageViewer.hs)
Line 99 untill 110
openImage sw vbitmap mclose status fname = do -- load the new bitmap bm <- bitmapCreateFromFile fname -- can fail with exception closeImage vbitmap set vbitmap [value := Just bm] set mclose [enabled := True] set status [text := fname] -- reset the scrollbars bmsize <- get bm size set sw [virtualSize := bmsize] repaint sw `catch` \err -> repaint sw
if I'm correct the openImage is also defined in the where clause. Therefor by what I think it should not be possible, but it is.
Thanks for everything.
2009/4/17 Lennart Augustsson
Variables bound in the do block are not in scope in the where. Use a let inside the do for onOpen instead.
On Thu, Apr 16, 2009 at 11:53 PM, Tsunkiet Man
wrote: Hello,
I'm trying to create a GUI by using wxHaskell. However I get the weird error message of "Not in scope "dt"", well so I sorted them so that my so called "dt" was in scope, however it failed. Can someone please tell me how I can solve this error?
... A lot of code that is not relevant in my opinion, if I'm wrong please correct me and I will post my full code
--Debug text -- dt <- staticText f [text := "Hello world!"]
imagePanel <- panel f [position := Point 2 2, clientSize := Size 100 100, tooltip := "This is a drawPanel", bgcolor := rgb 255 255 255] set f [ clientSize := Size 700 500, menuBar := [mFile, mHelp], visible := True, on (menu exit) := close f, on (menu open) := onOpen f vFile ]
return ()
where onOpen :: Frame a -> Var b -> IO () onOpen frame var = do file <- fileOpenDialog frame False True "Open File" [("PGM bestanden (*.pgm)",["*.pgm"]),("Alle bestanden (*.*)",["*.*"])] "" "" case file of Nothing -> return () Just file -> set dt [text := "HELLO"] return ()
Thank you for your help, I really owe haskell-cafe.
Greetings Tsunkiet Man _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

PS: a small note, sorry for multiple mails.
After doing the let ... in function it did not work. =( It gave the error
that 'do' has to end with some result. I did:
do let <the function> in <all the code that was behind the do>
and it still didn't work =(. I'm doing something wrong I think.
Thanks for your help.
2009/4/17 Tsunkiet Man
Thank you for your response, however if I can't do that, why can the example of wxHaskell do that?
I refer to the following code inside http://darcs.haskell.org/wxhaskell/samples/wx/ (ImageViewer.hs)
Line 99 untill 110
openImage sw vbitmap mclose status fname = do -- load the new bitmap bm <- bitmapCreateFromFile fname -- can fail with exception closeImage vbitmap set vbitmap [value := Just bm] set mclose [enabled := True] set status [text := fname] -- reset the scrollbars bmsize <- get bm size set sw [virtualSize := bmsize] repaint sw `catch` \err -> repaint sw
if I'm correct the openImage is also defined in the where clause. Therefor by what I think it should not be possible, but it is.
Thanks for everything.
2009/4/17 Lennart Augustsson
Variables bound in the do block are not in scope in the where.
Use a let inside the do for onOpen instead.
On Thu, Apr 16, 2009 at 11:53 PM, Tsunkiet Man
wrote: Hello,
I'm trying to create a GUI by using wxHaskell. However I get the weird error message of "Not in scope "dt"", well so I sorted them so that my so called "dt" was in scope, however it failed. Can someone please tell me how I can solve this error?
... A lot of code that is not relevant in my opinion, if I'm wrong please correct me and I will post my full code
--Debug text -- dt <- staticText f [text := "Hello world!"]
imagePanel <- panel f [position := Point 2 2, clientSize := Size 100 100, tooltip := "This is a drawPanel", bgcolor := rgb 255 255 255] set f [ clientSize := Size 700 500, menuBar := [mFile, mHelp], visible := True, on (menu exit) := close f, on (menu open) := onOpen f vFile ]
return ()
where onOpen :: Frame a -> Var b -> IO () onOpen frame var = do file <- fileOpenDialog frame False True "Open File" [("PGM bestanden (*.pgm)",["*.pgm"]),("Alle bestanden (*.*)",["*.*"])] "" "" case file of Nothing -> return () Just file -> set dt [text := "HELLO"] return ()
Thank you for your help, I really owe haskell-cafe.
Greetings Tsunkiet Man _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Take a look at the syntax for 'let' inside a 'do'.
On Fri, Apr 17, 2009 at 12:57 AM, Tsunkiet Man
PS: a small note, sorry for multiple mails.
After doing the let ... in function it did not work. =( It gave the error that 'do' has to end with some result. I did:
do let <the function> in <all the code that was behind the do>
and it still didn't work =(. I'm doing something wrong I think.
Thanks for your help.
2009/4/17 Tsunkiet Man
Thank you for your response, however if I can't do that, why can the example of wxHaskell do that?
I refer to the following code inside http://darcs.haskell.org/wxhaskell/samples/wx/ (ImageViewer.hs)
Line 99 untill 110
openImage sw vbitmap mclose status fname = do -- load the new bitmap bm <- bitmapCreateFromFile fname -- can fail with exception closeImage vbitmap set vbitmap [value := Just bm] set mclose [enabled := True] set status [text := fname] -- reset the scrollbars bmsize <- get bm size set sw [virtualSize := bmsize] repaint sw `catch` \err -> repaint sw
if I'm correct the openImage is also defined in the where clause. Therefor by what I think it should not be possible, but it is.
Thanks for everything.
2009/4/17 Lennart Augustsson
Variables bound in the do block are not in scope in the where. Use a let inside the do for onOpen instead.
On Thu, Apr 16, 2009 at 11:53 PM, Tsunkiet Man
wrote: Hello,
I'm trying to create a GUI by using wxHaskell. However I get the weird error message of "Not in scope "dt"", well so I sorted them so that my so called "dt" was in scope, however it failed. Can someone please tell me how I can solve this error?
... A lot of code that is not relevant in my opinion, if I'm wrong please correct me and I will post my full code
--Debug text -- dt <- staticText f [text := "Hello world!"]
imagePanel <- panel f [position := Point 2 2, clientSize := Size 100 100, tooltip := "This is a drawPanel", bgcolor := rgb 255 255 255] set f [ clientSize := Size 700 500, menuBar := [mFile, mHelp], visible := True, on (menu exit) := close f, on (menu open) := onOpen f vFile ]
return ()
where onOpen :: Frame a -> Var b -> IO () onOpen frame var = do file <- fileOpenDialog frame False True "Open File" [("PGM bestanden (*.pgm)",["*.pgm"]),("Alle bestanden (*.*)",["*.*"])] "" "" case file of Nothing -> return () Just file -> set dt [text := "HELLO"] return ()
Thank you for your help, I really owe haskell-cafe.
Greetings Tsunkiet Man _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hello,
what you suggested worked! Im very happy with it. However another error
suddenly came up. It sais the last statement in a 'do' must be an
expression, he is refering to line 41:45
I change my code to this:
on (menu exit) := close f,
on (menu open) := onOpen f dt vFile ]
return ()
where
onOpen :: Frame a -> staticText c -> Var b -> IO ()
onOpen frame stat var = do file <- fileOpenDialog frame
False True "Open File" [("PGM bestanden (*.pgm)",["*.pgm"]),("Alle bestanden
(*.*)",["*.*"])] "" ""
case file of
Nothing -> return ()
Just file -> set stat [text
:= "HELLO"]
return ()
As far as I can tell, if the file is nothing it will return something of IO
() and if the file is something it will return something of IO (). So that
error is kind of strange in my opinion. Do you know what caused it?
Thanks for your help!
2009/4/17 Lennart Augustsson
Take a look at the syntax for 'let' inside a 'do'.
On Fri, Apr 17, 2009 at 12:57 AM, Tsunkiet Man
wrote: PS: a small note, sorry for multiple mails.
After doing the let ... in function it did not work. =( It gave the error that 'do' has to end with some result. I did:
do let <the function> in <all the code that was behind the do>
and it still didn't work =(. I'm doing something wrong I think.
Thanks for your help.
2009/4/17 Tsunkiet Man
Thank you for your response, however if I can't do that, why can the example of wxHaskell do that?
I refer to the following code inside http://darcs.haskell.org/wxhaskell/samples/wx/ (ImageViewer.hs)
Line 99 untill 110
openImage sw vbitmap mclose status fname = do -- load the new bitmap bm <- bitmapCreateFromFile fname -- can fail with exception closeImage vbitmap set vbitmap [value := Just bm] set mclose [enabled := True] set status [text := fname] -- reset the scrollbars bmsize <- get bm size set sw [virtualSize := bmsize] repaint sw `catch` \err -> repaint sw
if I'm correct the openImage is also defined in the where clause.
Therefor
by what I think it should not be possible, but it is.
Thanks for everything.
2009/4/17 Lennart Augustsson
Variables bound in the do block are not in scope in the where. Use a let inside the do for onOpen instead.
On Thu, Apr 16, 2009 at 11:53 PM, Tsunkiet Man
wrote: Hello,
I'm trying to create a GUI by using wxHaskell. However I get the
weird
error message of "Not in scope "dt"", well so I sorted them so that my so called "dt" was in scope, however it failed. Can someone please tell me how I can solve this error?
... A lot of code that is not relevant in my opinion, if I'm wrong please correct me and I will post my full code
--Debug text -- dt <- staticText f [text := "Hello world!"]
imagePanel <- panel f [position := Point 2 2, clientSize := Size 100 100, tooltip := "This is a drawPanel", bgcolor := rgb 255 255 255] set f [ clientSize := Size 700 500, menuBar := [mFile, mHelp], visible := True, on (menu exit) := close f, on (menu open) := onOpen f vFile ]
return ()
where onOpen :: Frame a -> Var b -> IO () onOpen frame var = do file <- fileOpenDialog frame False True "Open File" [("PGM bestanden (*.pgm)",["*.pgm"]),("Alle bestanden (*.*)",["*.*"])] "" "" case file of Nothing -> return () Just file -> set dt [text := "HELLO"] return ()
Thank you for your help, I really owe haskell-cafe.
Greetings Tsunkiet Man _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

PS: if the indents are wrong, that's because of gmail copy and past, Im so
sorry.
2009/4/17 Tsunkiet Man
Hello,
what you suggested worked! Im very happy with it. However another error suddenly came up. It sais the last statement in a 'do' must be an expression, he is refering to line 41:45
I change my code to this:
on (menu exit) := close f, on (menu open) := onOpen f dt vFile ]
return ()
where onOpen :: Frame a -> staticText c -> Var b -> IO () onOpen frame stat var = do file <- fileOpenDialog frame False True "Open File" [("PGM bestanden (*.pgm)",["*.pgm"]),("Alle bestanden (*.*)",["*.*"])] "" "" case file of Nothing -> return () Just file -> set stat [text := "HELLO"] return ()
As far as I can tell, if the file is nothing it will return something of IO () and if the file is something it will return something of IO (). So that error is kind of strange in my opinion. Do you know what caused it?
Thanks for your help!
2009/4/17 Lennart Augustsson
Take a look at the syntax for 'let' inside a 'do'.
On Fri, Apr 17, 2009 at 12:57 AM, Tsunkiet Man
wrote: PS: a small note, sorry for multiple mails.
After doing the let ... in function it did not work. =( It gave the error that 'do' has to end with some result. I did:
do let <the function> in <all the code that was behind the do>
and it still didn't work =(. I'm doing something wrong I think.
Thanks for your help.
2009/4/17 Tsunkiet Man
Thank you for your response, however if I can't do that, why can the example of wxHaskell do that?
I refer to the following code inside http://darcs.haskell.org/wxhaskell/samples/wx/ (ImageViewer.hs)
Line 99 untill 110
openImage sw vbitmap mclose status fname = do -- load the new bitmap bm <- bitmapCreateFromFile fname -- can fail with exception closeImage vbitmap set vbitmap [value := Just bm] set mclose [enabled := True] set status [text := fname] -- reset the scrollbars bmsize <- get bm size set sw [virtualSize := bmsize] repaint sw `catch` \err -> repaint sw
if I'm correct the openImage is also defined in the where clause.
Therefor
by what I think it should not be possible, but it is.
Thanks for everything.
2009/4/17 Lennart Augustsson
Variables bound in the do block are not in scope in the where. Use a let inside the do for onOpen instead.
On Thu, Apr 16, 2009 at 11:53 PM, Tsunkiet Man
wrote: Hello,
I'm trying to create a GUI by using wxHaskell. However I get the
weird
error message of "Not in scope "dt"", well so I sorted them so that my so called "dt" was in scope, however it failed. Can someone please tell me how I can solve this error?
... A lot of code that is not relevant in my opinion, if I'm wrong please correct me and I will post my full code
--Debug text -- dt <- staticText f [text := "Hello world!"]
imagePanel <- panel f [position := Point 2 2, clientSize := Size 100 100, tooltip := "This is a drawPanel", bgcolor := rgb 255 255 255] set f [ clientSize := Size 700 500, menuBar := [mFile, mHelp], visible := True, on (menu exit) := close f, on (menu open) := onOpen f vFile ]
return ()
where onOpen :: Frame a -> Var b -> IO () onOpen frame var = do file <- fileOpenDialog frame False True "Open File" [("PGM bestanden (*.pgm)",["*.pgm"]),("Alle bestanden (*.*)",["*.*"])] "" "" case file of Nothing -> return () Just file -> set dt [text := "HELLO"] return ()
Thank you for your help, I really owe haskell-cafe.
Greetings Tsunkiet Man _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hi,
you can use http://hpaste.org/ to overcome this problem.
Cheers,
Thu
2009/4/17 Tsunkiet Man
PS: if the indents are wrong, that's because of gmail copy and past, Im so sorry.
2009/4/17 Tsunkiet Man
Hello,
what you suggested worked! Im very happy with it. However another error suddenly came up. It sais the last statement in a 'do' must be an expression, he is refering to line 41:45
I change my code to this:
on (menu exit) := close f, on (menu open) := onOpen f dt vFile ]
return ()
where onOpen :: Frame a -> staticText c -> Var b -> IO () onOpen frame stat var = do file <- fileOpenDialog frame False True "Open File" [("PGM bestanden (*.pgm)",["*.pgm"]),("Alle bestanden (*.*)",["*.*"])] "" "" case file of Nothing -> return () Just file -> set stat [text := "HELLO"] return ()
As far as I can tell, if the file is nothing it will return something of IO () and if the file is something it will return something of IO (). So that error is kind of strange in my opinion. Do you know what caused it?
Thanks for your help!
2009/4/17 Lennart Augustsson
Take a look at the syntax for 'let' inside a 'do'.
On Fri, Apr 17, 2009 at 12:57 AM, Tsunkiet Man
wrote: PS: a small note, sorry for multiple mails.
After doing the let ... in function it did not work. =( It gave the error that 'do' has to end with some result. I did:
do let <the function> in <all the code that was behind the do>
and it still didn't work =(. I'm doing something wrong I think.
Thanks for your help.
2009/4/17 Tsunkiet Man
Thank you for your response, however if I can't do that, why can the example of wxHaskell do that?
I refer to the following code inside http://darcs.haskell.org/wxhaskell/samples/wx/ (ImageViewer.hs)
Line 99 untill 110
openImage sw vbitmap mclose status fname = do -- load the new bitmap bm <- bitmapCreateFromFile fname -- can fail with exception closeImage vbitmap set vbitmap [value := Just bm] set mclose [enabled := True] set status [text := fname] -- reset the scrollbars bmsize <- get bm size set sw [virtualSize := bmsize] repaint sw `catch` \err -> repaint sw
if I'm correct the openImage is also defined in the where clause. Therefor by what I think it should not be possible, but it is.
Thanks for everything.
2009/4/17 Lennart Augustsson
Variables bound in the do block are not in scope in the where. Use a let inside the do for onOpen instead.
On Thu, Apr 16, 2009 at 11:53 PM, Tsunkiet Man
wrote: > Hello, > > I'm trying to create a GUI by using wxHaskell. However I get the > weird > error > message of "Not in scope "dt"", well so I sorted them so that my so > called > "dt" was in scope, however it failed. Can someone please tell me > how I > can > solve this error? > > ... A lot of code that is not relevant in my opinion, if > I'm > wrong please correct me and I will post my full code > > --Debug text -- > dt <- staticText f [text := "Hello world!"] > > imagePanel <- panel f [position := Point 2 2, > clientSize := > Size > 100 100, tooltip := "This is a drawPanel", bgcolor := rgb 255 255 > 255] > set f [ clientSize := Size 700 500, > menuBar := [mFile, mHelp], > visible := True, > on (menu exit) := close f, > on (menu open) := onOpen f vFile ] > > > return () > > where > onOpen :: Frame a -> Var b -> IO () > onOpen frame var = do file <- fileOpenDialog > frame > False > True "Open File" [("PGM bestanden (*.pgm)",["*.pgm"]),("Alle > bestanden > (*.*)",["*.*"])] "" "" > case file of > Nothing -> return > () > Just file -> set dt > [text := > "HELLO"] > return > () > > Thank you for your help, I really owe haskell-cafe. > > Greetings Tsunkiet Man > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Am Freitag 17 April 2009 01:37:25 schrieb Tsunkiet Man:
Hello,
what you suggested worked! Im very happy with it. However another error suddenly came up. It sais the last statement in a 'do' must be an expression, he is refering to line 41:45
I change my code to this:
on (menu exit) := close f, on (menu open) := onOpen f dt vFile ]
return ()
where onOpen :: Frame a -> staticText c -> Var b -> IO () onOpen frame stat var = do file <- fileOpenDialog frame False True "Open File" [("PGM bestanden (*.pgm)",["*.pgm"]),("Alle bestanden (*.*)",["*.*"])] "" "" case file of Nothing -> return () Just file -> set stat [text
:= "HELLO"]
return ()
In the "Just file" case, you want to have two IO-actions. If you don't use (>>=) or (>>) to chain them together, you must put them in a do-block, so case file of Nothing -> return () Just file -> do set stat [text := "HELLO"] return () But I think you can omit the return () in that branch anyway, set foo bar should have the correct type already.
As far as I can tell, if the file is nothing it will return something of IO () and if the file is something it will return something of IO (). So that error is kind of strange in my opinion. Do you know what caused it?
Thanks for your help!

Am Freitag 17 April 2009 00:43:18 schrieb Tsunkiet Man:
Thank you for your response, however if I can't do that, why can the example of wxHaskell do that?
I refer to the following code inside http://darcs.haskell.org/wxhaskell/samples/wx/ (ImageViewer.hs)
Line 99 untill 110
openImage sw vbitmap mclose status fname = do -- load the new bitmap bm <- bitmapCreateFromFile fname -- can fail with exception closeImage vbitmap set vbitmap [value := Just bm] set mclose [enabled := True] set status [text := fname] -- reset the scrollbars bmsize <- get bm size set sw [virtualSize := bmsize] repaint sw `catch` \err -> repaint sw
if I'm correct the openImage is also defined in the where clause. Therefor by what I think it should not be possible, but it is.
Thanks for everything.
In your code, the variable dt was bound in the do-block, and you tried to reference it in the definition of onOpen in the where clause, where it is not in scope. The definition of openImage in ImageViewer.hs does not reference any variables bound in the do-block of imageViewer, only its parameters and the bitmap bm bound in its own body. As an alternative to defining onOpen in your main do-block, you could also pass the debug- text dt as a parameter.
participants (4)
-
Daniel Fischer
-
Lennart Augustsson
-
minh thu
-
Tsunkiet Man