From: Daniel F. <dan...@on...> - 2004-11-08 08:09:00
|
Hello Daan, I haven't heard from you. So have you made any progress or could you reproduce the problem? Thanks again for you help. Daniel > Daniel Fischer wrote: > >>Hello! >> >>I have a strange problem when using splitter windows with a spin >>control inside. I reduced my problem to the sample code below. When I >>running it on Windows I"m unable to resize the top left area by moving >>the vertical splitter bar left or right. But the horizontal splitter >>bar works fine. It seems to be a problem with the spin control. When >>replacing the spin control by a simple text entry (changing the line >>"spin <- spinCtrl panelLeft 0 100 []" to "spin <- textEntry panelLeft []") >>both splitter bars work fine. Strangly this problem does not occur >>when running it on Linux. >> >>Is it my fault or is there a bug in wxHaskell or in wxWidgets? >>I"m using Windows XP prof SP2, ghc 6.2.1 and wxHaskell 0.8. >> >> > It seems a wxWidgets problem. I will try this out on monday on my > windowsXP system. > (it also seems that spin controls don"t propagate their events > correctly, so it might be > related to that bug) > > -- Daan. > >>And just another related question: how can I make the splitter windows >>respect the minimum size needed for the controls in the splitter >>panes? >> >>Many thanks in advance for your help >>Daniel Fischer >> >>---8<---------- sample code ----------8<--- >> >>module Main where >> >>import Graphics.UI.WX >>import Graphics.UI.WXCore >> >>main :: IO () >>main >> = start gui >> >>gui :: IO () >>gui >> = do f <- frame [ text := "error?" ] >> >> hSplit <- splitterWindow f [ style := wxSP_3DSASH ] >> vSplit <- splitterWindow hSplit [ style := wxSP_3DSASH ] >> panelLeft <- panel vSplit [] >> >> spin <- spinCtrl panelLeft 0 100 [] >> entry <- textEntry panelLeft [] >> btn1 <- button panelLeft [ text := "Ok" ] >> btn2 <- button panelLeft [ text := "Ok" ] >> list1 <- listCtrl panelLeft [ columns := [("foo",AlignLeft,100)] ] >> list2 <- listCtrl vSplit [ columns := [("bar",AlignLeft,100)] ] >> list3 <- listCtrl hSplit [ columns := [("baz",AlignLeft,100)] ] >> >> subLayoutLeft <- return $ vfill $ column 5 >> [ boxed "box 1" $ row 5 [ fill $ widget spin, widget btn1 ] >> , boxed "box 2" $ row 5 [ fill $ widget entry, widget btn2 ] >> ] >> >> layoutLeft <- return $ fill $ row 5 [ fill $ widget list1, subLayoutLeft ] >> set panelLeft [ layout := layoutLeft ] >> >> layoutTop <- return $ vsplit vSplit 5 300 (widget panelLeft) (widget list2) >> layoutAll <- return $ hsplit hSplit 5 300 layoutTop (widget list3) >> >> set f [ layout := minsize (sz 640 400) $ fill layoutAll ] >> >> >> >> >>------------------------------------------------------- >>This SF.net email is sponsored by: IT Product Guide on ITManagersJournal >>Use IT products in your business? Tell us what you think of them. Give us >>Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more >>http://productguide.itmanagersjournal.com/guidepromo.tmpl >>_______________________________________________ >>wxhaskell-users mailing list >>wxhaskell-users@li... >>https://lists.sourceforge.net/lists/listinfo/wxhaskell-users >> >> >> >> |
From: Daan L. <da...@cs...> - 2004-11-09 14:32:30
|
Daniel Fischer wrote: >Hello Daan, > >I haven't heard from you. So have you made any progress or could you >reproduce the problem? Thanks again for you help. > > Sorry Daniel, I haven't looked into this yet as I have been so busy lately. I'll try to look into it later this week -- but don't get your hopes up too much: to me, it seems like a wxWidgets problem. -- Daan >Daniel > > > >> Daniel Fischer wrote: >> >> >> > >>Hello! > >> > >>I have a strange problem when using splitter windows with a spin > >>control inside. I reduced my problem to the sample code below. When I > >>running it on Windows I"m unable to resize the top left area by moving > >>the vertical splitter bar left or right. But the horizontal splitter > >>bar works fine. It seems to be a problem with the spin control. When > >>replacing the spin control by a simple text entry (changing the line > >>"spin <- spinCtrl panelLeft 0 100 []" to "spin <- textEntry panelLeft []") > >>both splitter bars work fine. Strangly this problem does not occur > >>when running it on Linux. > >> > >>Is it my fault or is there a bug in wxHaskell or in wxWidgets? > >>I"m using Windows XP prof SP2, ghc 6.2.1 and wxHaskell 0.8. > >> > >> > > >> It seems a wxWidgets problem. I will try this out on monday on my >> windowsXP system. >> (it also seems that spin controls don"t propagate their events >> correctly, so it might be >> related to that bug) >> >> -- Daan. >> >> >> > >>And just another related question: how can I make the splitter windows > >>respect the minimum size needed for the controls in the splitter > >>panes? > >> > >>Many thanks in advance for your help > >>Daniel Fischer > >> > >>---8<---------- sample code ----------8<--- > >> > >>module Main where > >> > >>import Graphics.UI.WX > >>import Graphics.UI.WXCore > >> > >>main :: IO () > >>main > >> = start gui > >> > >>gui :: IO () > >>gui > >> = do f <- frame [ text := "error?" ] > >> > >> hSplit <- splitterWindow f [ style := wxSP_3DSASH ] > >> vSplit <- splitterWindow hSplit [ style := wxSP_3DSASH ] > >> panelLeft <- panel vSplit [] > >> > >> spin <- spinCtrl panelLeft 0 100 [] > >> entry <- textEntry panelLeft [] > >> btn1 <- button panelLeft [ text := "Ok" ] > >> btn2 <- button panelLeft [ text := "Ok" ] > >> list1 <- listCtrl panelLeft [ columns := [("foo",AlignLeft,100)] ] > >> list2 <- listCtrl vSplit [ columns := [("bar",AlignLeft,100)] ] > >> list3 <- listCtrl hSplit [ columns := [("baz",AlignLeft,100)] ] > >> > >> subLayoutLeft <- return $ vfill $ column 5 > >> [ boxed "box 1" $ row 5 [ fill $ widget spin, widget btn1 ] > >> , boxed "box 2" $ row 5 [ fill $ widget entry, widget btn2 ] > >> ] > >> > >> layoutLeft <- return $ fill $ row 5 [ fill $ widget list1, subLayoutLeft ] > >> set panelLeft [ layout := layoutLeft ] > >> > >> layoutTop <- return $ vsplit vSplit 5 300 (widget panelLeft) (widget list2) > >> layoutAll <- return $ hsplit hSplit 5 300 layoutTop (widget list3) > >> > >> set f [ layout := minsize (sz 640 400) $ fill layoutAll ] > >> > >> > >> > >> > >>------------------------------------------------------- > >>This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > >>Use IT products in your business? Tell us what you think of them. Give us > >>Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > >>http://productguide.itmanagersjournal.com/guidepromo.tmpl > >>_______________________________________________ > >>wxhaskell-users mailing list > >>wxhaskell-users@li... > >>https://lists.sourceforge.net/lists/listinfo/wxhaskell-users > >> > >> > >> > >> > > > > >------------------------------------------------------- >This SF.Net email is sponsored by: >Sybase ASE Linux Express Edition - download now for FREE >LinuxWorld Reader's Choice Award Winner for best database on Linux. >http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click >_______________________________________________ >wxhaskell-users mailing list >wxh...@li... >https://lists.sourceforge.net/lists/listinfo/wxhaskell-users > > > > |
From: Benedikt G. <Ben...@we...> - 2004-11-09 17:37:44
|
Hello List, I just tried the Process example on my debian gnu linux (testing) laptop (intel centrino). Linux kernel version 2.6.7. wxgtk-2.4-config --version reports 2.4.2 (debian package) ghc --version reports 6.2.1 I'm using wxhaskell-0.8 compiled using --with-opengl. I get segmentation faults most of the time: - when trying to use a not existing command (cmd for example) - bash works and after bash is started all cmds executed inside bash do not cause sigsevs as well - ls (without bash) causes sigsev - cat (without bash) works - cat Process.hs (without bash) causes sigsev - cat fooo (without bash fooo being a non existant file) causes sigsev What's going on? On a side note how is one supposed to use the inputStreamRead* collection of functions (see Graphics.UI.WXCore.Process) there does not seem to be a function to get an InputStream given a Process. Cheers and Thanks for your help, Bene -- Benedikt Grundmann For animals, the entire universe has been neatly divided into things to (a) mate with, (b) eat, (c) run away from, and (d) rocks. --- (Terry Pratchett, Equal Rites) --- |
From: Daan L. <da...@cs...> - 2004-11-10 15:00:28
|
Benedikt Grundmann wrote: >Hello List, > >I just tried the Process example on my debian gnu linux (testing) laptop >(intel centrino). Linux kernel version 2.6.7. > >wxgtk-2.4-config --version reports 2.4.2 (debian package) >ghc --version reports 6.2.1 > >I'm using wxhaskell-0.8 compiled using --with-opengl. I get segmentation >faults most of the time: > > Hi Benedikt, The asynchronous process seemed to work well on windows, but since we use it intensively with Helium, we noticed that it sometimes crashes too :-( We still try to debug this but it is a hard one to solve due to the asynchronous nature. We have not tested it on debian, but maybe we should as it seems to occur at least at well-defined moments! Bottom line: the process feature has bugs.. and it won't get solved soon as I am currently working on other features (like printing). However, I would like to see it debugged as it is a tremendously useful feature and because we need to run Helium. >What's going on? On a side note how is one supposed to use the >inputStreamRead* collection of functions (see Graphics.UI.WXCore.Process) >there does not seem to be a function to get an InputStream given a Process. > > These are just convenience functions on streams. There are used internally to provide the "OnReceive" functions for processes and you can't use them directly on processes. I hope this helps, -- Daan. > >Cheers and Thanks for your help, > > >Bene > > > > |
From: Benedikt G. <Ben...@we...> - 2004-11-10 22:01:24
|
Hi Daan, On Wednesday 10 November 2004 16:00, you wrote: DL> Benedikt Grundmann wrote: DL> DL> >Hello List, DL> > DL> >I just tried the Process example on my debian gnu linux (testing) laptop DL> >(intel centrino). Linux kernel version 2.6.7. DL> > DL> >wxgtk-2.4-config --version reports 2.4.2 (debian package) DL> >ghc --version reports 6.2.1 DL> > DL> >I'm using wxhaskell-0.8 compiled using --with-opengl. I get segmentation DL> >faults most of the time: DL> > DL> > DL> Hi Benedikt, DL> DL> The asynchronous process seemed to work well on windows, but since we DL> use it intensively DL> with Helium, we noticed that it sometimes crashes too :-( We still try DL> to debug this but it is DL> a hard one to solve due to the asynchronous nature. We have not tested DL> it on debian, but maybe DL> we should as it seems to occur at least at well-defined moments! DL> I did some more testing today: I could reproduce the same behaviour on my desktop machine (a 2.6 ghz pentium 4) running Debian GNU Linux (unstable bleeding edge). On both machines I could "sometimes" see it actually work roughly once every 20 tries. DL> Bottom line: the process feature has bugs.. and it won't get solved soon DL> as I am currently working DL> on other features (like printing). However, I would like to see it DL> debugged as it is a tremendously DL> useful feature and because we need to run Helium. DL> Well it's a *critical* part of an application I'm currently writing together with a colleque (part of my bachelor thesis in computer science). Implementation is still in it's infancy so I could switch to another programming language even though I *really* want to use haskell :-). Do you know wether it is a wxhaskell or a wxWidgets or wxGTK Problem? I'm willing to give it some more work / testing but not much as my time constraints to not permit that. Thanks again for your work, Cheers, Bene -- Benedikt Grundmann For animals, the entire universe has been neatly divided into things to (a) mate with, (b) eat, (c) run away from, and (d) rocks. --- (Terry Pratchett, Equal Rites) --- |
From: Daan L. <da...@cs...> - 2004-11-11 11:19:44
|
Benedikt Grundmann wrote: >Well it's a *critical* part of an application I'm currently writing together >with a colleque (part of my bachelor thesis in computer science). Implementation >is still in it's infancy so I could switch to another programming language >even though I *really* want to use haskell :-). Do you know wether it is a >wxhaskell or a wxWidgets or wxGTK Problem? I'm willing to give it some more >work / testing but not much as my time constraints to not permit that. > > Ok, first of all try to compile wxHaskell with an experimental wxWidgets, like 2.5.2 (I haven't tried 2.5.3 yet). Secondly, if you have a nice debugger, you could look into the wxHaskell process code. I have just done so, and couldn't find any glaring errors, but maybe you'll find the problem with the right mix of trace statements :-) How does it work: first, I create a Process object that runs asynchronously and redirects input/output. (See WXCore/Process.hs) The process objects sends events to a parent which catches them. The "OnInput" events are the important ones. To implement non-blocking IO, those event handlers (See WXCore/Events.hs) create "InputSink" objects to deal with that. The "inputSink" objects are implemented by me in C code (See wxc/src/extra.cpp, a bit of a mess here, but you'll find the relevant section :-) The InputSink class derives from the wxThread class and starts a seperate thread that reads from the input stream. While the thread is not destroyed, it reads from the stream. When something is read, it creates a "InputEvent" that contains the data and "posts" it to the main GUI loop where it can be processed by the main GUI/Haskell event thread. How does the event know which object should get the event? well, it has a special "id" that identifies it. However, now that I think about it, I take the input stream pointer as the value which seems kind of wrong -- maybe it should be the "id" of the parent object for the process, or even the id from the process object -- try to play with that a bit. Well, I hope this helps a bit with debugging -- I couldn't reproduce your problems (yet), but I'll try later this week. -- Daan. >Thanks again for your work, > >Cheers, > >Bene > > > |
From: Benedikt G. <Ben...@we...> - 2004-11-13 12:52:21
|
Hello Daan, Hello List, I have some free time this weekend which I want to use to track down this sigsev bug. Interestingly the bug does not appear that often when running the Process.hs in a debugger. But most of the time it does crash when I try to execute the unknown cmd `cmd' to times in a row. I compiled process using ghc -debug -package wx --make Process.hs gdb says: Starting program: /home/dreamer/programming/wxhaskell/wxhaskell-0.8/samples/wx/a.out [Thread debugging using libthread_db enabled] [New Thread 1090297408 (LWP 1826)] Detaching after fork from child process 1829. [New Thread 1100573616 (LWP 1830)] [New Thread 1108962224 (LWP 1831)] [Thread 1108962224 (zombie) exited] [Thread 1100573616 (zombie) exited] Detaching after fork from child process 1832. [New Thread 1100573616 (LWP 1833)] [New Thread 1108962224 (LWP 1834)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1108962224 (LWP 1834)] 0x40221dd4 in wxInputSinkEvent::Read () from /usr/local/lib/libwxc-gtk2.4.2-0.8.so (gdb) bt #0 0x40221dd4 in wxInputSinkEvent::Read () from /usr/local/lib/libwxc-gtk2.4.2-0.8.so #1 0x402219c9 in wxInputSink::Entry () from /usr/local/lib/libwxc-gtk2.4.2-0.8.so #2 0x403fc446 in wxThreadInternal::PthreadStart () from /usr/local/lib/libwxc-gtk2.4.2-0.8.so #3 0x405cb9b4 in start_thread () from /lib/tls/libpthread.so.0 #4 0x00000000 in ?? () (gdb) I don't know wether that is already helpfull to you or not. How do I compile wxhaskell with full debugging information? I noticed that there is something like wxcd in makefile.lib but there does not seem to be an accompanying parameter in the configure script. Cheers, Bene PS: I originally intented not to write this email to the wxhaskell mailing list, as I wasn't sure wether this email was interesting to it. And I had it only cc'ed to Daniel Fischer (who happened to post another one of our problems yesterday evening and is that colleque of mine I mentioned before). But I just had to realize that your spam filter blocked my email. -- Benedikt Grundmann For animals, the entire universe has been neatly divided into things to (a) mate with, (b) eat, (c) run away from, and (d) rocks. --- (Terry Pratchett, Equal Rites) --- |
From: Daan L. <da...@cs...> - 2004-11-13 13:26:08
|
Hi Benedikt, Thanks for your report, I'll have to read it more carefully tosee if it helps or not, but it is good to know where it goes wrong. Maybe I'll find it now. Anyway, you can easily compile with debugging information by editing the makefile. On line 637 you just add the gcc debug flags to the given flags in WXC-CXXFLAGS. Maybe you have to add some HCFLAGS too? (write HCFLAGS += ... somewhere after the include's in the makefile. The "wxcd" thing is just when you are using MS visual studio. -- Daan. ps. Let's take this discussion offline, I reconfigured my spam filter so I guess you can safely send me mail now :-) Benedikt Grundmann wrote: >Hello Daan, Hello List, > >I have some free time this weekend which I want to use to track down >this sigsev bug. Interestingly the bug does not appear that often >when running the Process.hs in a debugger. But most of the time it >does crash when I try to execute the unknown cmd `cmd' to times in a >row. I compiled process using ghc -debug -package wx --make Process.hs >gdb says: > >Starting program: /home/dreamer/programming/wxhaskell/wxhaskell-0.8/samples/wx/a.out >[Thread debugging using libthread_db enabled] >[New Thread 1090297408 (LWP 1826)] >Detaching after fork from child process 1829. >[New Thread 1100573616 (LWP 1830)] >[New Thread 1108962224 (LWP 1831)] >[Thread 1108962224 (zombie) exited] >[Thread 1100573616 (zombie) exited] >Detaching after fork from child process 1832. >[New Thread 1100573616 (LWP 1833)] >[New Thread 1108962224 (LWP 1834)] > >Program received signal SIGSEGV, Segmentation fault. >[Switching to Thread 1108962224 (LWP 1834)] >0x40221dd4 in wxInputSinkEvent::Read () from /usr/local/lib/libwxc-gtk2.4.2-0.8.so >(gdb) bt >#0 0x40221dd4 in wxInputSinkEvent::Read () from /usr/local/lib/libwxc-gtk2.4.2-0.8.so >#1 0x402219c9 in wxInputSink::Entry () from /usr/local/lib/libwxc-gtk2.4.2-0.8.so >#2 0x403fc446 in wxThreadInternal::PthreadStart () > from /usr/local/lib/libwxc-gtk2.4.2-0.8.so >#3 0x405cb9b4 in start_thread () from /lib/tls/libpthread.so.0 >#4 0x00000000 in ?? () >(gdb) > > >I don't know wether that is already helpfull to you or not. How do I compile >wxhaskell with full debugging information? I noticed that there is something >like wxcd in makefile.lib but there does not seem to be an accompanying >parameter in the configure script. > > >Cheers, > >Bene > > >PS: > >I originally intented not to write this email to the wxhaskell mailing list, as >I wasn't sure wether this email was interesting to it. And I had it only cc'ed to >Daniel Fischer (who happened to post another one of our problems yesterday evening >and is that colleque of mine I mentioned before). But I just had to realize that >your spam filter blocked my email. > > > > |