Re: [wxhaskell-users] wxhaskell 0.10.2 on hackage (experimental)

2008-02-17 Thread Mads Lindstrøm
Hi Conal

 Hi Eric,
 
 Thanks for the progress update.  Your remark about 2.6 only raises a
 question for me: What's the deal on wxhaskell and ghci-friendliness?
 Do we still have to use wxWindows/wxWidgets 2.4.2 in order to run more
 than one GUI per ghci session?  Will it be possible at all any more?

I am currently working on a GUI version of GHCi (called GhciGui), which
may solve your problem. The GhciGui uses two processes. One for the GUI
and one for executing the Haskell code the user inputs. You can also ask
GhciGui to spawn a new process, each time you press execute. In this
way you can keep executing WxHaskell programs, even if you are running
wxWidgets 2.6.

After spawning a new process all your targets and modules are also
reloaded.

However, you do not get this for nothing. When GhciGui spawns a new
process all your let bindings will be lost :( But I am wondering if this
is an acceptable loss?



Greetings,

Mads Lindstrøm


 
   - Conal
 
 On Feb 16, 2008 5:24 AM, Eric Y. Kow [EMAIL PROTECTED] wrote:
 Hi everyone,
 
 I have uploaded an unofficial pre-release of wxhaskell on
 hackage.  It is
 available as two packages, wxcore and wx.
 
  
 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/wxcore-0.10.2
  http://hackage.haskell.org/cgi-bin/hackage-scripts/package/wx-0.10.2
 
 Let me stress that this is only experimental; it is NOT an
 official release.
 
 Summary
 ---
 I think this works under Linux and MacOS X, but not under
 Windows.
 
 It seems to work best under MacOS X (10.4 on Intel).  If you
 have any trouble,
 you are likely going to have to install wxcore by hand
 (passing in configure
 flags, etc) and then install wx automatically:
 
  cabal install wx
 
 General notes
 -
 This only works with wxWidgets 2.6.
 
 Windows and maybe MacOS X
 --
 The wxcore cabal script is merely a wrapper around the
 makefile and the
 configure script.  So you'll still need to have make and the
 ability to run
 shell scripts.  As shelarcy pointed out, this probably does
 not work for
 Windows, and you'll have to go the old-fashioned route (using
 the darcs
 repository as well).
 
 MacOS X
 ---
 The configure options that worked for me (wxWidgets) are
  ./configure --enable-display --enable-unicode --with-opengl
 --with-mac --without-odbc --enable-mediactrl
 --disable-monolithic
 
 Note that I also had to do
  sudo mkdir -p /usr/local/wxhaskell/bin
  sudo ln -s /usr/local/bin/wx-config /usr/local/wxhaskell/bin
 
 This makes the wxcore package use your version of wxWidgets
 and not the one that came with the
 system.
 
 Linux
 -
 On Linux, I had to supply --with-opengl to the configure
 script:
 
  runhaskell Setup --configure-opt=--with-opengl
 
 I noticed also that on Ubuntu Gutsy Gibbon, I had some trouble
 running sample applications with wxGTK 2.8, so I aptitude
 installed
 libwxgtk2.6-dev and specified to wxhaskell to use it instead
 of the
 newer version:
 
  mkdir -p /usr/local/wxhaskell/bin
  ln
 -s /usr/lib/wx/config/gtk2-unicode-release-2.6 
 /usr/local/wxhaskell/bin/wx-config
  runhaskell Setup --configure-opt=--with-opengl
 
 Where to next?
 --
 I hope that this makes life a little easier, and that the
 being
 on hackage either attracts more users/contributors to
 wxhaskell.
 
 Here are some key questions we need to answer for 0.10.3:
 * Can we make it possible to run wxhaskell programs under
 Linux
  without the --with-opengl flag? Seems to be fine under MacOS
 X.
 
 * Why are people having build trouble lately?
  * You have to obliterate a patch for wxhaskell on PowerPC,
 why?
  * What about the issue that Malcolm pointed out with not
 linking to
   the -gl version of wxWidgets [odd; doesn't wx-config tell
 the right thing?]
  * What about Gwern's too many symbolic links problem?
 
 * Why doesn't wxhaskell work with wxGTK 2.8?  I thought we had
  worked out some compatibility fixes?
 
 * What do we need for Windows users to be able to cabal
 install wx?
 
 ... and many more.  Please help!
 
 --
 Eric Kow http://www.nltg.brighton.ac.uk/home/Eric.Kow
 PGP Key ID: 08AC04F9
   

[wxhaskell-users] wxhaskell-devel list is now available

2008-02-17 Thread Eric Y. Kow
Hi,

I have created a mailing list for wxhaskell development.

I am also reconfiguring the darcs repository on darcs.haskell.org so
that all patches are sent to that list instead of the users list.
Also tracker requests on sourceforge will now go on that list.

Subscription is open to all.

Thanks!

-- 
Eric Kow http://www.nltg.brighton.ac.uk/home/Eric.Kow
PGP Key ID: 08AC04F9


pgpCiVoJeaTnc.pgp
Description: PGP signature
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


[wxhaskell-users] darcs patch: Fix typo pointed out on bugtracker. (and 4 more)

2008-02-17 Thread Eric Kow
Sun Feb 17 11:43:03 GMT 2008  Eric Kow [EMAIL PROTECTED]
  * Fix typo pointed out on bugtracker.

Sun Feb 17 13:05:53 GMT 2008  Eric Kow [EMAIL PROTECTED]
  * Fix UTF8Sampler test case.

Sun Feb 17 17:41:42 GMT 2008  Eric Kow [EMAIL PROTECTED]
  * Add a bugs directory for test cases.

Sun Feb 17 17:42:03 GMT 2008  Eric Kow [EMAIL PROTECTED]
  * Add NonModalDialog test case (bug #1372529)

Sun Feb 17 17:43:26 GMT 2008  Eric Kow [EMAIL PROTECTED]
  * Add the submenu bug.


New patches:

[Fix typo pointed out on bugtracker.
Eric Kow [EMAIL PROTECTED]**20080217114303] {
hunk ./homepage/quickstart.html 248
span class=comment-- react on user input/span
set p [on clicknbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; := dropBall vballs pnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; span class=comment-- drop ball/span
  ,on clickRightnbsp;nbsp;nbsp; := (\pt - ballsFrame)nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; span class=comment-- new window/span
- ,on (charKey 'p') := set t [enablenbsp;nbsp; :~ not]nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; span class=comment-- pause/span
+ ,on (charKey 'p') := set t [enablednbsp;nbsp; :~ not]nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; span class=comment-- pause/span
  ,on (charKey '-') := set t [interval :~ \i - i*2]nbsp; span class=comment-- increase interval/span
  ,on (charKey '+') := set t [interval :~ \i - max 1 (i `div` 2)]
  ]
hunk ./homepage/quickstart.html 277
 click causes a new ball to drop, a right click opens another frame (!), a codep/code-key pauses the
 balls, and code+/-/code increase/decrease the speed of the balls. Note how the operator
 code(:~)/code applies a function to an attribute value instead of assigning one. Thus, the
-expression code(set t [enable :~ not])/code flips the enabled state of the timer./p
+expression code(set t [enabled :~ not])/code flips the enabled state of the timer./p
 
 pFinally, we specify the layout of the frame, using codeminsize/code to specifiy the minimal size
 of the panel and thus the size of the frame as it is not resizeable./p
}
[Fix UTF8Sampler test case.
Eric Kow [EMAIL PROTECTED]**20080217130553] hunk ./samples/test/UTF8Sampler.hs 83
 readTestFile :: IO String
 readTestFile =
  do h  - openBinaryFile testFile ReadMode
-ws - hGetBytes h $ hFileSize testFile
+hsize - hFileSize h
+ws - hGetBytes h $ fromIntegral hsize
 return . fst . decode $ ws
 
 testFile :: FilePath
[Add a bugs directory for test cases.
Eric Kow [EMAIL PROTECTED]**20080217174142] {
adddir ./bugs
addfile ./bugs/makefile
hunk ./bugs/makefile 1
+COMPILE=ghc -package wx
+ifeq ($(shell uname),Darwin)
+PREP=macosx-app
+else
+PREP=#
+endif
+
+APPS= \
+
+.PHONY: clean
+
+all: $(APPS)
+
+%: %.hs
+	$(COMPILE) --make -o $@ $
+	$(PREP) $@
+
+clean:
+	rm -rf $(APPS) *.o *.hi *.app
}
[Add NonModalDialog test case (bug #1372529)
Eric Kow [EMAIL PROTECTED]**20080217174203] {
addfile ./bugs/NonModalDialog.hs
hunk ./bugs/NonModalDialog.hs 1
+-- Compile with ghc -fglasgow-exts
+-- --make NonModalDialogTest.hs -o
+-- NonModalDialogTest
+
+module Main where
+import Graphics.UI.WX
+main = start $ do
+ f - frame [ text := program ]
+ w - get f parent-- added line
+ d - dialog w [ text := Some dialog ]
+ let bugtext = unlines [ Bug: closing these two windows should exit the
+   , program, but it does not ]
+ set d [ visible := True, layout := margin 10 $ label bugtext ]
hunk ./bugs/makefile 9
 endif
 
 APPS= \
+  NonModalDialog\
 
 .PHONY: clean
 
}
[Add the submenu bug.
Eric Kow [EMAIL PROTECTED]**20080217174326] {
addfile ./bugs/SubMenu.hs
hunk ./bugs/SubMenu.hs 1
+{- From Maarten maarten at snowlion.nl
+-
+The following code doesn't seem to work properly. Either the main entry
+(m1/mp1) or it's sub menu entry (ms1/mps1) do not seem to propagate the
+event when pressed. It is possible to make it working by uncomments the
+lines where the menu commands are registered in the frame.
+-}
+
+module Main where
+
+import Graphics.UI.WX
+
+main :: IO ()
+main = start gui
+
+gui :: IO ()
+gui = do
+  f - frame [ text := Hello world! ]
+
+  m   - menuPane [ text := Menu ]
+  m1 - menuItem m [ text := Menu m1
+   , on command := putStrLn menu m1]
+  --  set f [ on (menu m1) := putStrLn menu m1 ]
+  menuLine m
+  sub - menuPane [text := Sub menu]
+  ms1 - menuItem sub [ text := submenu ms1
+  , on command := putStrLn submenu ms1 ]
+  --  set f [ on (menu ms1) := putStrLn submenu ms1 ]
+  menuSub m sub [ text := Sub ]
+  menuItem m [text := Exit, on command := close f]
+
+  set f [menuBar := [m], on mouse := mouseEvent f, clientSize := sz 200 200 ]
+  return ()
+
+mouseEvent f eventMouse = do
+  case eventMouse of
+MouseRightDown mousePoint _ - doPopup f mousePoint
+_ - return ()
+
+doPopup f mousePoint = do
+  m - makePopupMenu f Popup Doesnt' work...
+