You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(12) |
Aug
(34) |
Sep
(14) |
Oct
(36) |
Nov
(32) |
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
(9) |
Mar
(31) |
Apr
(36) |
May
(17) |
Jun
(21) |
Jul
(13) |
Aug
(18) |
Sep
(2) |
Oct
(10) |
Nov
(18) |
Dec
(28) |
2005 |
Jan
(26) |
Feb
(15) |
Mar
(26) |
Apr
(11) |
May
(60) |
Jun
(3) |
Jul
(12) |
Aug
(4) |
Sep
(12) |
Oct
(19) |
Nov
(36) |
Dec
(10) |
2006 |
Jan
(6) |
Feb
(13) |
Mar
(6) |
Apr
(2) |
May
(9) |
Jun
(3) |
Jul
(6) |
Aug
(13) |
Sep
(1) |
Oct
(24) |
Nov
(33) |
Dec
(47) |
2007 |
Jan
(21) |
Feb
(41) |
Mar
(17) |
Apr
(9) |
May
(4) |
Jun
(20) |
Jul
(24) |
Aug
(71) |
Sep
(35) |
Oct
(10) |
Nov
(39) |
Dec
(39) |
2008 |
Jan
(24) |
Feb
(42) |
Mar
(61) |
Apr
(12) |
May
(11) |
Jun
(4) |
Jul
(9) |
Aug
(6) |
Sep
(6) |
Oct
(4) |
Nov
(3) |
Dec
(14) |
2009 |
Jan
(25) |
Feb
(18) |
Mar
(19) |
Apr
(24) |
May
(14) |
Jun
(7) |
Jul
(14) |
Aug
(25) |
Sep
(40) |
Oct
(20) |
Nov
(22) |
Dec
(4) |
2010 |
Jan
(55) |
Feb
(11) |
Mar
(9) |
Apr
(10) |
May
(10) |
Jun
(9) |
Jul
(7) |
Aug
(4) |
Sep
(15) |
Oct
(7) |
Nov
(2) |
Dec
(3) |
2011 |
Jan
(2) |
Feb
(1) |
Mar
(4) |
Apr
(6) |
May
(20) |
Jun
(30) |
Jul
(15) |
Aug
(4) |
Sep
(23) |
Oct
(24) |
Nov
(3) |
Dec
(8) |
2012 |
Jan
(23) |
Feb
(7) |
Mar
(19) |
Apr
(48) |
May
(8) |
Jun
(27) |
Jul
(10) |
Aug
(1) |
Sep
(11) |
Oct
(1) |
Nov
|
Dec
(3) |
2013 |
Jan
(1) |
Feb
|
Mar
(17) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(12) |
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
2015 |
Jan
|
Feb
|
Mar
(14) |
Apr
(5) |
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
(5) |
Oct
(1) |
Nov
(2) |
Dec
(1) |
2016 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Paulo P. <po...@gm...> - 2011-10-19 13:04:46
|
Hello. The official documentation for version 2.8 of wxWidgets [1] presents a function called GetCurrentPage that does just that. However, that function is not directly translated into wxHaskell. Instead, you must use notebookGetSelection [2]. This function returns an index of the currently selected tab, starting at zero. Example: -- basic frame f <- frame [] p <- panel f [] -- a notebook n <- notebook p [] -- some tabs tab1 <- panel n [text := Tab 1] tab2 <- panel n [text := Tab 2] tab3 <- panel n [text := Tab 3] -- example function to get selected tab: let selected = do index <- notebookGetSelection n -- do something with index In this example, if tab2 is the currently active tab, notebookGetSelection n should return the value 1. Let me know how it worked out for you. Regards, Paulo M. Pocinho -- [1] http://docs.wxwidgets.org/2.8/wx_wxnotebook.html#wxnotebookgetcurrentpage [2] http://wxhaskell.sourceforge.net/doc/Graphics-UI-WXCore-WxcClassesMZ.html#v%3AnotebookGetSelection On 19 October 2011 12:26, Johannes Waldmann <wal...@im...> wrote: > Dear all, > > I am using a "notebook" that has several tabs, > each one with a panel. > > How could I check whether a tab (panel) > is currently visible (selected)? > Is there some attribute or selection event? > > Because I want to avoid updating the invisible tabs. > > 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-d2d-oct > _______________________________________________ > wxhaskell-users mailing list > wxh...@li... > https://lists.sourceforge.net/lists/listinfo/wxhaskell-users > > |
From: Johannes W. <wal...@im...> - 2011-10-19 11:26:52
|
Dear all, I am using a "notebook" that has several tabs, each one with a panel. How could I check whether a tab (panel) is currently visible (selected)? Is there some attribute or selection event? Because I want to avoid updating the invisible tabs. Thanks - J.W. |
From: Paulo P. <po...@gm...> - 2011-10-17 20:17:31
|
On 17 October 2011 15:58, Van Nguyen <ngu...@gm...> wrote: > I try to implement an Combo Box that Suggests Options. > Eg: if I enters "ES" in the symbol box, only those items that have ES somewhere > in their name will show > up, like ESCAPE, TEST. > But the implemented ComboBox doesn't show dropdow list, > show user must click on button of ComboBox to show it. > > Source: > > import Graphics.UI.WX > import Graphics.UI.WXCore > import Graphics.UI.WX.Events > import Data.List > symbols = > ["ESH11","VIETTEL","METFONE","VIETNET","MENFONE","HUNET"] > > --filter item in the symbols list > searchString :: String -> String -> String > searchString strInput strRaw = do > if strInput `isInfixOf` strRaw then > strRaw > else > "" > > dataManager :: IO () > dataManager = do > frmDataManager <- frame [text:= "Data Manager"] > cbbSymbols <- comboBoxEx frmDataManager wxCB_DROPDOWN [visible := True] The style you are using is "wxCB_DROPDOWN". >From [1], there is another style called "wxCB_SIMPLE", maybe that is what you want. Image example of both is show at [2]. -- [1] http://docs.wxwidgets.org/trunk/classwx_combo_box.html [2] http://www.java2s.com/Tutorial/Python/0380__wxPython/Twocomboboxes.htm |
From: Van N. <ngu...@gm...> - 2011-10-17 15:50:23
|
I try to implement an Combo Box that Suggests Options. Eg: if I enters "ES" in the symbol box, only those items that have ES somewhere in their name will show up, like ESCAPE, TEST. But the implemented ComboBox doesn't show dropdow list, show user must click on button of ComboBox to show it. Source: import Graphics.UI.WX import Graphics.UI.WXCore import Graphics.UI.WX.Events import Data.List symbols = ["ESH11","VIETTEL","METFONE","VIETNET","MENFONE","HUNET"] --filter item in the symbols list searchString :: String -> String -> String searchString strInput strRaw = do if strInput `isInfixOf` strRaw then strRaw else "" dataManager :: IO () dataManager = do frmDataManager <- frame [text:= "Data Manager"] cbbSymbols <- comboBoxEx frmDataManager wxCB_DROPDOWN [visible := True] set cbbSymbols [items := symbols, on keyboard:= cbbKeypresss cbbSymbols] where cbbKeypresss cbb keyEvent = do --filter text when user enter text on comboBox case (keyKey keyEvent) of KeyUp -> propagateEvent KeyDown -> propagateEvent KeyBack -> do propagateEvent other -> do showText cbb (showKey (keyKey keyEvent)) where showText cbb nextText = do txt <- (get cbb text) numItem <-(get cbb itemCount) comboBoxRemove cbb 0 (numItem -1); set cbb [text := ""] set cbb [text :=txt ++ nextText] txt <- (get cbb text) let notNull x = not (null x) in mapM_ (comboBoxAppend cbb) ( filter notNull (map (searchString txt) symbols)) Could anyone help me a document about this? |
From: Paulo P. <po...@gm...> - 2011-10-16 14:07:11
|
Forgot to include the link to wxTextCtrl page. Here it is: http://wiki.wxwidgets.org/WxTextCtrl On 16 October 2011 15:04, Paulo Pocinho <po...@gm...> wrote: > Hello. I want to know how to make the textCtrl widget scroll only one > line at a time instead the default one page at a time. > > The usage is the same as the one given by the examples. Text is > appended to a textCtrl that serves as a logging window. > > However, once the appended line reaches the bottom of the scrolled > text, the textCtrl automatically "jumps" one page. There is an > attribute in wxWidgets called ScrollLine () that makes it only scroll > the number of lines we want [1] but I can't find it in wxHaskell. > > How can I make text scroll one line instead of jumping a screen at a time? > |
From: Paulo P. <po...@gm...> - 2011-10-16 14:04:57
|
Hello. I want to know how to make the textCtrl widget scroll only one line at a time instead the default one page at a time. The usage is the same as the one given by the examples. Text is appended to a textCtrl that serves as a logging window. However, once the appended line reaches the bottom of the scrolled text, the textCtrl automatically "jumps" one page. There is an attribute in wxWidgets called ScrollLine () that makes it only scroll the number of lines we want [1] but I can't find it in wxHaskell. How can I make text scroll one line instead of jumping a screen at a time? |
From: Johannes W. <wal...@im...> - 2011-10-14 15:58:33
|
Dear all, I am looking for some example code for text highlighting. (E.g., for marking parsing/typing errors, in a program text that is being edited.) It seems I need textCtrlRich - does this work on Linux? Thanks, J.W. |
From: Dave T. <duk...@gm...> - 2011-10-11 18:36:33
|
For the benefit of the list: ---------- Forwarded message ---------- From: Johannes Waldmann <wal...@im...> Date: 11 October 2011 19:21 Subject: Re: [wxhaskell-users] how to generate an event? To: Dave Tapley <duk...@gm...> Cc: Henning Thielemann <le...@he...> Thanks Dave. Meanwhile, this seems to work for me: http://article.gmane.org/gmane.comp.lang.haskell.cafe/92998 http://snipplr.com/view/17538/ Best regards, Johannes. |
From: S D S. <do...@uu...> - 2011-10-11 15:25:36
|
has anyone been able to run and install wxHaskell on OS X Lion. I made a kind of half-baked attempt, but somehow get stuck everywhere. I am apparently not such a great "systems guy", thus any help is appreciated. Doaitse |
From: Dave T. <duk...@gm...> - 2011-10-11 14:47:19
|
On 10 October 2011 19:25, Henning Thielemann <le...@he...> wrote: > > 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"? Well, the closest I've come to writing an event handler is wrapping an additional one from wxWidgets (for wxPropertyGrid). You can see the changes where I added it in darcsden[1]. If you look at the second hunk there (wx/src/Graphics/UI/WX/Controls.hs :: line 1231) you can see how I provide a "propertyGridEvent" function to create a new event. I then use this function in the sample code I added (in samples/wx/PropertyGrid.hs) like this: "pg <- propertyGrid p [on propertyGridEvent := onPropertyGridEvent]". > > 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. I concur, the thought of handling synchronisation separately does 'smell bad' doesn't it. There must be some way to thread events through the wxWidgets library. Hopefully using the information above as a starting point, along with the wxWidgets documentation, you can find something. Thanks, Dave > > 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 > wxh...@li... > https://lists.sourceforge.net/lists/listinfo/wxhaskell-users > |
From: Henning T. <le...@he...> - 2011-10-10 20:23:21
|
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 () ? |
From: Henning T. <le...@he...> - 2011-10-10 18:50:08
|
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. |
From: Kevin C. <me...@ke...> - 2011-10-06 06:02:18
|
The key thing I did was make a panel within the frame, and put the important stuff on the panel. I'm still trying to wrap my head around enough layout rules so I can figure out why things are clipped now, though... The area with displayed ship and rocks is 300 by 300. The ship and rocks can go about one ship-width into that clipped area to the right of that (disappearing), and the outer frame is about another extra ship-width wide. Ugh. -- Kevin Cantu Santa Barbara, CA | me...@ke... On Tue, Oct 4, 2011 at 8:18 AM, Dave Tapley <duk...@gm...> wrote: > On 4 October 2011 09:43, Kevin Cantu <me...@ke...> wrote: >> Thanks, that seems to have done the trick. >> >> Now, tomorrow I'm going to have to read up on how to fix some simpler >> layout problems. :) >> https://github.com/killerswan/wxAsteroids/issues/1 >> >> -- >> Kevin Cantu >> Santa Barbara, CA | me...@ke... >> >> >> >> On Mon, Oct 3, 2011 at 11:54 AM, carlos gomez <car...@gm...> wrote: >>> The problem is that the keyboard events are not been listened (I think >>> because of the focus), but I remember I changed the window >>> listenner to another window or panel, and then it worked. > > Ah, interesting. > I had a similar problem under Linux, where keyboard events were not > being detected. > My 'workaround' was to use 'tab' to change the focus within the window > to the panel which had the even listener, only when it had focus were > keyboard events triggered. > > Subsequently someone suggested that "WXCore.windowSetFocus" could be > used, it takes in the panel which needs focus and worked for me. > > Dave, > > >>> >>> On 3 October 2011 05:28, Kevin Cantu <me...@ke...> wrote: >>>> >>>> I was just trying out wxAsteroids (from Hackage) and found that the >>>> controls don't work on my system, although I'm told they work for >>>> someone using OS X. This is baffling to me. >>>> >>>> I'm running Ubuntu 11.10 Oneiric Ocelot and Xfce (xubuntu). Once I >>>> start the wxAsteroids program, I'm able to start a new game with >>>> CTRL-N, pause with CTRL-P, and quit with CTRL-Q, but I can't move the >>>> ship with arrow keys, or speed it up with + or -, at all. >>>> >>>> Any ideas why? >>>> >>>> >>>> -- >>>> Kevin Cantu >>>> Santa Barbara, CA | me...@ke... >>>> >> >> ------------------------------------------------------------------------------ >> 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 >> wxh...@li... >> https://lists.sourceforge.net/lists/listinfo/wxhaskell-users >> > |
From: Dave T. <duk...@gm...> - 2011-10-04 15:19:19
|
On 4 October 2011 09:43, Kevin Cantu <me...@ke...> wrote: > Thanks, that seems to have done the trick. > > Now, tomorrow I'm going to have to read up on how to fix some simpler > layout problems. :) > https://github.com/killerswan/wxAsteroids/issues/1 > > -- > Kevin Cantu > Santa Barbara, CA | me...@ke... > > > > On Mon, Oct 3, 2011 at 11:54 AM, carlos gomez <car...@gm...> wrote: >> The problem is that the keyboard events are not been listened (I think >> because of the focus), but I remember I changed the window >> listenner to another window or panel, and then it worked. Ah, interesting. I had a similar problem under Linux, where keyboard events were not being detected. My 'workaround' was to use 'tab' to change the focus within the window to the panel which had the even listener, only when it had focus were keyboard events triggered. Subsequently someone suggested that "WXCore.windowSetFocus" could be used, it takes in the panel which needs focus and worked for me. Dave, >> >> On 3 October 2011 05:28, Kevin Cantu <me...@ke...> wrote: >>> >>> I was just trying out wxAsteroids (from Hackage) and found that the >>> controls don't work on my system, although I'm told they work for >>> someone using OS X. This is baffling to me. >>> >>> I'm running Ubuntu 11.10 Oneiric Ocelot and Xfce (xubuntu). Once I >>> start the wxAsteroids program, I'm able to start a new game with >>> CTRL-N, pause with CTRL-P, and quit with CTRL-Q, but I can't move the >>> ship with arrow keys, or speed it up with + or -, at all. >>> >>> Any ideas why? >>> >>> >>> -- >>> Kevin Cantu >>> Santa Barbara, CA | me...@ke... >>> > > ------------------------------------------------------------------------------ > 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 > wxh...@li... > https://lists.sourceforge.net/lists/listinfo/wxhaskell-users > |
From: Henk-Jan v. T. <hj...@ch...> - 2011-10-04 14:30:16
|
On Tue, 04 Oct 2011 10:43:22 +0200, Kevin Cantu <me...@ke...> wrote: > Thanks, that seems to have done the trick. If you tell me how you fixed it, I will change the package on Hackage (if it still works on Windows). It might take some time though, as I cannot compile wxAsteroids at the moment. Regards, Henk-Jan van Tuyl -- http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html -- |
From: Kevin C. <me...@ke...> - 2011-10-04 08:43:33
|
Thanks, that seems to have done the trick. Now, tomorrow I'm going to have to read up on how to fix some simpler layout problems. :) https://github.com/killerswan/wxAsteroids/issues/1 -- Kevin Cantu Santa Barbara, CA | me...@ke... On Mon, Oct 3, 2011 at 11:54 AM, carlos gomez <car...@gm...> wrote: > The problem is that the keyboard events are not been listened (I think > because of the focus), but I remember I changed the window > listenner to another window or panel, and then it worked. > > On 3 October 2011 05:28, Kevin Cantu <me...@ke...> wrote: >> >> I was just trying out wxAsteroids (from Hackage) and found that the >> controls don't work on my system, although I'm told they work for >> someone using OS X. This is baffling to me. >> >> I'm running Ubuntu 11.10 Oneiric Ocelot and Xfce (xubuntu). Once I >> start the wxAsteroids program, I'm able to start a new game with >> CTRL-N, pause with CTRL-P, and quit with CTRL-Q, but I can't move the >> ship with arrow keys, or speed it up with + or -, at all. >> >> Any ideas why? >> >> >> -- >> Kevin Cantu >> Santa Barbara, CA | me...@ke... >> |
From: Pedro V. <pb...@dc...> - 2011-10-03 16:15:18
|
On Mon, 3 Oct 2011 02:28:01 -0700 Kevin Cantu <me...@ke...> wrote: > I was just trying out wxAsteroids (from Hackage) and found that the > controls don't work on my system, although I'm told they work for > someone using OS X. This is baffling to me. > > I'm running Ubuntu 11.10 Oneiric Ocelot and Xfce (xubuntu). Once I > start the wxAsteroids program, I'm able to start a new game with > CTRL-N, pause with CTRL-P, and quit with CTRL-Q, but I can't move the > ship with arrow keys, or speed it up with + or -, at all. > > Any ideas why? > I have experienced similar issues (particularly keyboard events not being caugh) and managed to solve them by using a panel inside the main window (in wx terms, the frame). Regards, Pedro |
From: Kevin C. <me...@ke...> - 2011-10-03 09:28:07
|
I was just trying out wxAsteroids (from Hackage) and found that the controls don't work on my system, although I'm told they work for someone using OS X. This is baffling to me. I'm running Ubuntu 11.10 Oneiric Ocelot and Xfce (xubuntu). Once I start the wxAsteroids program, I'm able to start a new game with CTRL-N, pause with CTRL-P, and quit with CTRL-Q, but I can't move the ship with arrow keys, or speed it up with + or -, at all. Any ideas why? -- Kevin Cantu Santa Barbara, CA | me...@ke... |
From: Dave T. <duk...@gm...> - 2011-09-21 20:52:21
|
I'm going to start idling in #wxhaskell on freenode if anyone would like to join me. |
From: Paulo P. <po...@gm...> - 2011-09-17 14:42:20
|
Just used a resource.rc file, pasted the contents of ws/msw/wx.rc with hardcoded paths. Then used windres to create an object and linked it to the app with GHC. Now it worked. There could be a better way to it than harcoding the paths though. On 17 September 2011 12:20, Paulo Pocinho <po...@gm...> wrote: > Hello everyone. > > Every wxhaskell gui widget I use has windows 98 appearance, on windows > 7. How can I have the standard windows 7 "look and feel"? > |
From: Paulo P. <po...@gm...> - 2011-09-17 11:29:24
|
Hi everyone. I have another question. Based on the Filebrowser.hs example, when I click on a folder in the left side, files appear on the right. Suppose I want to mimic the windows explorer. Clicking the "Name" column should order files by name, alternating ascending or descending order. I want to know if there is a standard method to order the files when I click the columns. Do I have to code a mouse event to order the contents, for every column? |
From: Paulo P. <po...@gm...> - 2011-09-17 11:20:38
|
Hello everyone. Every wxhaskell gui widget I use has windows 98 appearance, on windows 7. How can I have the standard windows 7 "look and feel"? |
From: D.V. <dav...@gm...> - 2011-09-14 14:39:58
|
And after seeing a post on the list about this same problem, I've found a way around : -- Bonjour List, -- -- I've got this program which segfaults. If you remove fontSize:=10 it runs, but the widgets completely ignore the size I giv e them -- -- Here's the code: module Main where import Control.Monad import Graphics.UI.WX hiding (when) import Graphics.UI.WXCore hiding (when) import Graphics.UI.WXCore.WxcTypes stats = do dlg <- frame [ text := "Title"] font <- fontCreate 8 6 0 0 False "" wxFONTENCODING_SYSTEM -- wxFONTFAMILY_TELETYPE wxFONTSTYLE_NORMAL wxFONTWEIGHT_NORMAL let zone a = do tz <-textEntry dlg [ text:="", enabled:=False ,alignment := a ] windowSetFont tz font return tz aligns = replicate 14 AlignLeft lzone <- mapM zone aligns let zrow l n s = row 5 $ concat $ zipWith3 labzone l n s -- I could do better by calculing this from the font... it's good enough for now. zsz s = minsize (sz (s*12+8) 20) labzone l n s = if null l then [ zsz s $ widget (lzone !! n) ] else [ label l,zsz s $ widget (lzone !! n) ] form = margin 10 $ column 5 [ label "titletile", zrow ["xxxx:","xxxx:","xxx:","xx:","x:","x:","xxxx.:"] [0..6] [3,15,1,4,1,1,3], zrow ["xxx:","xxx:","xxx:","","xxxxx:","xxx:","xxx:"] [7..13] [3,3,3,10,1,1,5] ] set dlg [layout := form ] main = start stats ================================ Unresolved problem: why did fontSize make the program crash ? |
From: D.V. <dav...@gm...> - 2011-09-14 14:22:51
|
A workaround fort the font problem goes like this: font <- fontCreate 8 0 0 0 False "" wxFONTENCODING_SYSTEM -- SADLY, wxFONTFAMILY_TELETYPE wxFONTSTYLE_NORMAL wxFONTWEIGHT_NORMAL are not defined let zone a s = do tz <-textEntry dlg [ text:="", enabled:=False ,alignment := a, clientSize := sz (s*8) 8 ] windowSetFont tz font return tz I still don't know why either clientSize or outerSize are ignored. Something cool for textentry widgets would be to be able to set the width and height in characters (using X or M for variable width fonts ?) 2011/9/14 D.V. <dav...@gm...>: > Bonjour List, > > I've got this program which segfaults. If you remove fontSize:=8 it > runs, but the widgets completely ignore the size I give them :( > > Help ? > > Here's the code: > ============================ > > module Main where > > import Control.Monad > > import Graphics.UI.WX hiding (when) > import Graphics.UI.WXCore hiding (when) > import Graphics.UI.WXCore.WxcTypes > > stats = do > dlg <- frame [ text := "Title"] > let zone a s = textEntry dlg [ text:="", enabled:=False ,alignment := a, > clientSize := sz (s*8) 8, font := > fontFixed,fontSize:=8] > aligns = replicate 14 AlignLeft > sizes = repeat 8 > lzone <- zipWithM zone aligns sizes > > let zrow l n = row 5 $ concat $ zipWith labzone l n > labzone l n = if null l then [ widget (lzone !! n) ] else [ > label l,widget (lzone !! n) ] > form = margin 10 $ column 5 [ > label "titletile", > zrow ["xxxx:","xxxx:","xxx:","xx:","x:","x:","xxxx.:"] [0..6], > zrow ["xxx:","xxx:","xxx:","","xxxxx:","xxx:","xxx:"] [7..13] > ] > set dlg [layout := form ] > > main = start stats > > ========= > And the crash: > > > *** glibc detected *** ./t: double free or corruption (out): 0x09872cf8 *** > ======= Backtrace: ========= > /lib/tls/i686/cmov/libc.so.6(+0x6b591)[0xa90591] > /lib/tls/i686/cmov/libc.so.6(+0x6cde8)[0xa91de8] > /lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0xa94ecd] > /usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x995741] > ./t[0x808101c] > ======= Memory map: ======== > 00110000-001a5000 r-xp 00000000 08:01 15875 > /usr/lib/libwx_gtk2u_html-2.8.so.0.6.0 > 001a5000-001aa000 r--p 00094000 08:01 15875 > /usr/lib/libwx_gtk2u_html-2.8.so.0.6.0 > 001aa000-001ab000 rw-p 00099000 08:01 15875 > /usr/lib/libwx_gtk2u_html-2.8.so.0.6.0 > 001ab000-001ac000 rw-p 00000000 00:00 0 > 001ac000-001ae000 r-xp 00000000 08:01 2885026 > /lib/tls/i686/cmov/libdl-2.11.1.so > 001ae000-001af000 r--p 00001000 08:01 2885026 > /lib/tls/i686/cmov/libdl-2.11.1.so > 001af000-001b0000 rw-p 00002000 08:01 2885026 > /lib/tls/i686/cmov/libdl-2.11.1.so > 001b0000-0020f000 r-xp 00000000 08:01 10413 /usr/lib/libgmp.so.3.5.2 > 0020f000-00210000 r--p 0005e000 08:01 10413 /usr/lib/libgmp.so.3.5.2 > 00210000-00211000 rw-p 0005f000 08:01 10413 /usr/lib/libgmp.so.3.5.2 > 00211000-00235000 r-xp 00000000 08:01 2885028 > /lib/tls/i686/cmov/libm-2.11.1.so > 00235000-00236000 r--p 00023000 08:01 2885028 > /lib/tls/i686/cmov/libm-2.11.1.so > 00236000-00237000 rw-p 00024000 08:01 2885028 > /lib/tls/i686/cmov/libm-2.11.1.so > 00237000-0023a000 r-xp 00000000 08:01 15895 > /usr/lib/libgmodule-2.0.so.0.2400.1 > 0023a000-0023b000 r--p 00002000 08:01 15895 > /usr/lib/libgmodule-2.0.so.0.2400.1 > 0023b000-0023c000 rw-p 00003000 08:01 15895 > /usr/lib/libgmodule-2.0.so.0.2400.1 > 0023c000-0023d000 rwxp 00000000 00:00 0 > 0023e000-00259000 r-xp 00000000 08:01 20060 /lib/ld-2.11.1.so > 00259000-0025a000 r--p 0001a000 08:01 20060 /lib/ld-2.11.1.so > 0025a000-0025b000 rw-p 0001b000 08:01 20060 /lib/ld-2.11.1.so > 0025b000-0033f000 r-xp 00000000 08:01 17368 > /usr/lib/libwx_gtk2u_richtext-2.8.so.0.6.0 > 0033f000-00345000 r--p 000e4000 08:01 17368 > /usr/lib/libwx_gtk2u_richtext-2.8.so.0.6.0 > 00345000-00346000 rw-p 000ea000 08:01 17368 > /usr/lib/libwx_gtk2u_richtext-2.8.so.0.6.0 > 00346000-00348000 rw-p 00000000 00:00 0 > 00348000-00365000 r-xp 00000000 08:01 410 /lib/libgcc_s.so.1 > 00365000-00366000 r--p 0001c000 08:01 410 /lib/libgcc_s.so.1 > 00366000-00367000 rw-p 0001d000 08:01 410 /lib/libgcc_s.so.1 > 00367000-0036b000 r-xp 00000000 08:01 15899 > /usr/lib/libgthread-2.0.so.0.2400.1 > 0036b000-0036c000 r--p 00003000 08:01 15899 > /usr/lib/libgthread-2.0.so.0.2400.1 > 0036c000-0036d000 rw-p 00004000 08:01 15899 > /usr/lib/libgthread-2.0.so.0.2400.1 > 0036d000-0036f000 r-xp 00000000 08:01 9943 /usr/lib/libXinerama.so.1.0.0 > 0036f000-00370000 r--p 00001000 08:01 9943 /usr/lib/libXinerama.so.1.0.0 > 00370000-00371000 rw-p 00002000 08:01 9943 /usr/lib/libXinerama.so.1.0.0 > 00371000-00373000 r-xp 00000000 08:01 959 /usr/lib/libXcomposite.so.1.0.0 > 00373000-00374000 r--p 00001000 08:01 959 /usr/lib/libXcomposite.so.1.0.0 > 00374000-00375000 rw-p 00002000 08:01 959 /usr/lib/libXcomposite.so.1.0.0 > 00376000-00377000 r-xp 00000000 00:00 0 [vdso] > 00377000-004b5000 r-xp 00000000 08:01 15315 > /usr/lib/libwx_baseu-2.8.so.0.6.0 > 004b5000-004b6000 ---p 0013e000 08:01 15315 > /usr/lib/libwx_baseu-2.8.so.0.6.0 > 004b6000-004ba000 r--p 0013e000 08:01 15315 > /usr/lib/libwx_baseu-2.8.so.0.6.0 > 004ba000-004bc000 rw-p 00142000 08:01 15315 > /usr/lib/libwx_baseu-2.8.so.0.6.0 > 004bc000-004c4000 rw-p 00000000 00:00 0 > 004c4000-004d7000 r-xp 00000000 08:01 15721 /lib/libz.so.1.2.3.3 > 004d7000-004d8000 r--p 00012000 08:01 15721 /lib/libz.so.1.2.3.3 > 004d8000-004d9000 rw-p 00013000 08:01 15721 /lib/libz.so.1.2.3.3 > 004d9000-004fd000 r-xp 00000000 08:01 6106 /lib/libexpat.so.1.5.2 > 004fd000-004ff000 r--p 00024000 08:01 6106 /lib/libexpat.so.1.5.2 > 004ff000-00500000 rw-p 00026000 08:01 6106 /lib/libexpat.so.1.5.2 > 00500000-00519000 r-xp 00000000 08:01 20200 /usr/lib/libatk-1.0.so.0.3009.1 > 00519000-0051a000 ---p 00019000 08:01 20200 /usr/lib/libatk-1.0.so.0.3009.1 > 0051a000-0051b000 r--p 00019000 08:01 20200 /usr/lib/libatk-1.0.so.0.3009.1 > 0051b000-0051c000 rw-p 0001a000 08:01 20200 /usr/lib/libatk-1.0.so.0.3009.1 > 0051c000-00541000 r-xp 00000000 08:01 4491 > /usr/lib/libpangoft2-1.0.so.0.2800.0 > 00541000-00542000 r--p 00024000 08:01 4491 > /usr/lib/libpangoft2-1.0.so.0.2800.0 > 00542000-00543000 rw-p 00025000 08:01 4491 > /usr/lib/libpangoft2-1.0.so.0.2800.0 > 00543000-0054a000 r-xp 00000000 08:01 14747 /usr/lib/libSM.so.6.0.1 > 0054a000-0054b000 r--p 00006000 08:01 14747 /usr/lib/libSM.so.6.0.1 > 0054b000-0054c000 rw-p 00007000 08:01 14747 /usr/lib/libSM.so.6.0.1 > 0054c000-0054d000 r-xp 00000000 08:01 919604 > /usr/lib/gtk-2.0/2.10.0/immodules/im-cedilla.so > 0054d000-0054e000 r--p 00000000 08:01 919604 > /usr/lib/gtk-2.0/2.10.0/immodules/im-cedilla.so > 0054e000-0054f000 rw-p 00001000 08:01 919604 > /usr/lib/gtk-2.0/2.10.0/immodules/im-cedilla.so > 0054f000-00579000 r-xp 00000000 08:01 15320 > /usr/lib/libwx_baseu_net-2.8.so.0.6.0 > 00579000-0057a000 r--p 0002a000 08:01 15320 > /usr/lib/libwx_baseu_net-2.8.so.0.6.0 > 0057a000-0057b000 rw-p 0002b000 08:01 15320 > /usr/lib/libwx_baseu_net-2.8.so.0.6.0 > 0057b000-008a8000 r-xp 00000000 08:01 15473 > /usr/lib/libwx_gtk2u_core-2.8.so.0.6.0 > 008a8000-008cf000 r--p 0032c000 08:01 15473 > /usr/lib/libwx_gtk2u_core-2.8.so.0.6.0 > 008cf000-008d4000 rw-p 00353000 08:01 15473 > /usr/lib/libwx_gtk2u_core-2.8.so.0.6.0 > 008d4000-008da000 rw-p 00000000 00:00 0 > 008da000-009c3000 r-xp 00000000 08:01 14586 /usr/lib/libstdc++.so.6.0.13 > 009c3000-009c4000 ---p 000e9000 08:01 14586 /usr/lib/libstdc++.so.6.0.13 > 009c4000-009c8000 r--p 000e9000 08:01 14586 /usr/lib/libstdc++.so.6.0.13 > 009c8000-009c9000 rw-p 000ed000 08:01 14586 /usr/lib/libstdc++.so.6.0.13 > 009c9000-009d0000 rw-p 00000000 00:00 0 > 009d0000-009e8000 r-xp 00000000 08:01 13959 > /usr/lib/libgdk_pixbuf-2.0.so.0.2000.1 > 009e8000-009e9000 r--p 00017000 08:01 13959 > /usr/lib/libgdk_pixbuf-2.0.so.0.2000.1 > 009e9000-009ea000 rw-p 00018000 08:01 13959 > /usr/lib/libgdk_pixbuf-2.0.so.0.2000.1 > 009ea000-00a18000 r-xp 00000000 08:01 4500 /usr/lib/libfontconfig.so.1.4.4 > 00a18000-00a19000 r--p 0002d000 08:01 4500 /usr/lib/libfontconfig.so.1.4.4 > 00a19000-00a1a000 rw-p 0002e000 08:01 4500 /usr/lib/libfontconfig.so.1.4.4 > 00a1c000-00a23000 r-xp 00000000 08:01 2885051 > /lib/tls/i686/cmov/librt-2.11.1.so > 00a23000-00a24000 r--p 00006000 08:01 2885051 > /lib/tls/i686/cmov/librt-2.11.1.so > 00a24000-00a25000 rw-p 00007000 08:01 2885051 > /lib/tls/i686/cmov/librt-2.11.1.soAbandon > |
From: D.V. <dav...@gm...> - 2011-09-14 13:53:00
|
Bonjour List, I've got this program which segfaults. If you remove fontSize:=8 it runs, but the widgets completely ignore the size I give them :( Help ? Here's the code: ============================ module Main where import Control.Monad import Graphics.UI.WX hiding (when) import Graphics.UI.WXCore hiding (when) import Graphics.UI.WXCore.WxcTypes stats = do dlg <- frame [ text := "Title"] let zone a s = textEntry dlg [ text:="", enabled:=False ,alignment := a, clientSize := sz (s*8) 8, font := fontFixed,fontSize:=8] aligns = replicate 14 AlignLeft sizes = repeat 8 lzone <- zipWithM zone aligns sizes let zrow l n = row 5 $ concat $ zipWith labzone l n labzone l n = if null l then [ widget (lzone !! n) ] else [ label l,widget (lzone !! n) ] form = margin 10 $ column 5 [ label "titletile", zrow ["xxxx:","xxxx:","xxx:","xx:","x:","x:","xxxx.:"] [0..6], zrow ["xxx:","xxx:","xxx:","","xxxxx:","xxx:","xxx:"] [7..13] ] set dlg [layout := form ] main = start stats ========= And the crash: *** glibc detected *** ./t: double free or corruption (out): 0x09872cf8 *** ======= Backtrace: ========= /lib/tls/i686/cmov/libc.so.6(+0x6b591)[0xa90591] /lib/tls/i686/cmov/libc.so.6(+0x6cde8)[0xa91de8] /lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0xa94ecd] /usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x995741] ./t[0x808101c] ======= Memory map: ======== 00110000-001a5000 r-xp 00000000 08:01 15875 /usr/lib/libwx_gtk2u_html-2.8.so.0.6.0 001a5000-001aa000 r--p 00094000 08:01 15875 /usr/lib/libwx_gtk2u_html-2.8.so.0.6.0 001aa000-001ab000 rw-p 00099000 08:01 15875 /usr/lib/libwx_gtk2u_html-2.8.so.0.6.0 001ab000-001ac000 rw-p 00000000 00:00 0 001ac000-001ae000 r-xp 00000000 08:01 2885026 /lib/tls/i686/cmov/libdl-2.11.1.so 001ae000-001af000 r--p 00001000 08:01 2885026 /lib/tls/i686/cmov/libdl-2.11.1.so 001af000-001b0000 rw-p 00002000 08:01 2885026 /lib/tls/i686/cmov/libdl-2.11.1.so 001b0000-0020f000 r-xp 00000000 08:01 10413 /usr/lib/libgmp.so.3.5.2 0020f000-00210000 r--p 0005e000 08:01 10413 /usr/lib/libgmp.so.3.5.2 00210000-00211000 rw-p 0005f000 08:01 10413 /usr/lib/libgmp.so.3.5.2 00211000-00235000 r-xp 00000000 08:01 2885028 /lib/tls/i686/cmov/libm-2.11.1.so 00235000-00236000 r--p 00023000 08:01 2885028 /lib/tls/i686/cmov/libm-2.11.1.so 00236000-00237000 rw-p 00024000 08:01 2885028 /lib/tls/i686/cmov/libm-2.11.1.so 00237000-0023a000 r-xp 00000000 08:01 15895 /usr/lib/libgmodule-2.0.so.0.2400.1 0023a000-0023b000 r--p 00002000 08:01 15895 /usr/lib/libgmodule-2.0.so.0.2400.1 0023b000-0023c000 rw-p 00003000 08:01 15895 /usr/lib/libgmodule-2.0.so.0.2400.1 0023c000-0023d000 rwxp 00000000 00:00 0 0023e000-00259000 r-xp 00000000 08:01 20060 /lib/ld-2.11.1.so 00259000-0025a000 r--p 0001a000 08:01 20060 /lib/ld-2.11.1.so 0025a000-0025b000 rw-p 0001b000 08:01 20060 /lib/ld-2.11.1.so 0025b000-0033f000 r-xp 00000000 08:01 17368 /usr/lib/libwx_gtk2u_richtext-2.8.so.0.6.0 0033f000-00345000 r--p 000e4000 08:01 17368 /usr/lib/libwx_gtk2u_richtext-2.8.so.0.6.0 00345000-00346000 rw-p 000ea000 08:01 17368 /usr/lib/libwx_gtk2u_richtext-2.8.so.0.6.0 00346000-00348000 rw-p 00000000 00:00 0 00348000-00365000 r-xp 00000000 08:01 410 /lib/libgcc_s.so.1 00365000-00366000 r--p 0001c000 08:01 410 /lib/libgcc_s.so.1 00366000-00367000 rw-p 0001d000 08:01 410 /lib/libgcc_s.so.1 00367000-0036b000 r-xp 00000000 08:01 15899 /usr/lib/libgthread-2.0.so.0.2400.1 0036b000-0036c000 r--p 00003000 08:01 15899 /usr/lib/libgthread-2.0.so.0.2400.1 0036c000-0036d000 rw-p 00004000 08:01 15899 /usr/lib/libgthread-2.0.so.0.2400.1 0036d000-0036f000 r-xp 00000000 08:01 9943 /usr/lib/libXinerama.so.1.0.0 0036f000-00370000 r--p 00001000 08:01 9943 /usr/lib/libXinerama.so.1.0.0 00370000-00371000 rw-p 00002000 08:01 9943 /usr/lib/libXinerama.so.1.0.0 00371000-00373000 r-xp 00000000 08:01 959 /usr/lib/libXcomposite.so.1.0.0 00373000-00374000 r--p 00001000 08:01 959 /usr/lib/libXcomposite.so.1.0.0 00374000-00375000 rw-p 00002000 08:01 959 /usr/lib/libXcomposite.so.1.0.0 00376000-00377000 r-xp 00000000 00:00 0 [vdso] 00377000-004b5000 r-xp 00000000 08:01 15315 /usr/lib/libwx_baseu-2.8.so.0.6.0 004b5000-004b6000 ---p 0013e000 08:01 15315 /usr/lib/libwx_baseu-2.8.so.0.6.0 004b6000-004ba000 r--p 0013e000 08:01 15315 /usr/lib/libwx_baseu-2.8.so.0.6.0 004ba000-004bc000 rw-p 00142000 08:01 15315 /usr/lib/libwx_baseu-2.8.so.0.6.0 004bc000-004c4000 rw-p 00000000 00:00 0 004c4000-004d7000 r-xp 00000000 08:01 15721 /lib/libz.so.1.2.3.3 004d7000-004d8000 r--p 00012000 08:01 15721 /lib/libz.so.1.2.3.3 004d8000-004d9000 rw-p 00013000 08:01 15721 /lib/libz.so.1.2.3.3 004d9000-004fd000 r-xp 00000000 08:01 6106 /lib/libexpat.so.1.5.2 004fd000-004ff000 r--p 00024000 08:01 6106 /lib/libexpat.so.1.5.2 004ff000-00500000 rw-p 00026000 08:01 6106 /lib/libexpat.so.1.5.2 00500000-00519000 r-xp 00000000 08:01 20200 /usr/lib/libatk-1.0.so.0.3009.1 00519000-0051a000 ---p 00019000 08:01 20200 /usr/lib/libatk-1.0.so.0.3009.1 0051a000-0051b000 r--p 00019000 08:01 20200 /usr/lib/libatk-1.0.so.0.3009.1 0051b000-0051c000 rw-p 0001a000 08:01 20200 /usr/lib/libatk-1.0.so.0.3009.1 0051c000-00541000 r-xp 00000000 08:01 4491 /usr/lib/libpangoft2-1.0.so.0.2800.0 00541000-00542000 r--p 00024000 08:01 4491 /usr/lib/libpangoft2-1.0.so.0.2800.0 00542000-00543000 rw-p 00025000 08:01 4491 /usr/lib/libpangoft2-1.0.so.0.2800.0 00543000-0054a000 r-xp 00000000 08:01 14747 /usr/lib/libSM.so.6.0.1 0054a000-0054b000 r--p 00006000 08:01 14747 /usr/lib/libSM.so.6.0.1 0054b000-0054c000 rw-p 00007000 08:01 14747 /usr/lib/libSM.so.6.0.1 0054c000-0054d000 r-xp 00000000 08:01 919604 /usr/lib/gtk-2.0/2.10.0/immodules/im-cedilla.so 0054d000-0054e000 r--p 00000000 08:01 919604 /usr/lib/gtk-2.0/2.10.0/immodules/im-cedilla.so 0054e000-0054f000 rw-p 00001000 08:01 919604 /usr/lib/gtk-2.0/2.10.0/immodules/im-cedilla.so 0054f000-00579000 r-xp 00000000 08:01 15320 /usr/lib/libwx_baseu_net-2.8.so.0.6.0 00579000-0057a000 r--p 0002a000 08:01 15320 /usr/lib/libwx_baseu_net-2.8.so.0.6.0 0057a000-0057b000 rw-p 0002b000 08:01 15320 /usr/lib/libwx_baseu_net-2.8.so.0.6.0 0057b000-008a8000 r-xp 00000000 08:01 15473 /usr/lib/libwx_gtk2u_core-2.8.so.0.6.0 008a8000-008cf000 r--p 0032c000 08:01 15473 /usr/lib/libwx_gtk2u_core-2.8.so.0.6.0 008cf000-008d4000 rw-p 00353000 08:01 15473 /usr/lib/libwx_gtk2u_core-2.8.so.0.6.0 008d4000-008da000 rw-p 00000000 00:00 0 008da000-009c3000 r-xp 00000000 08:01 14586 /usr/lib/libstdc++.so.6.0.13 009c3000-009c4000 ---p 000e9000 08:01 14586 /usr/lib/libstdc++.so.6.0.13 009c4000-009c8000 r--p 000e9000 08:01 14586 /usr/lib/libstdc++.so.6.0.13 009c8000-009c9000 rw-p 000ed000 08:01 14586 /usr/lib/libstdc++.so.6.0.13 009c9000-009d0000 rw-p 00000000 00:00 0 009d0000-009e8000 r-xp 00000000 08:01 13959 /usr/lib/libgdk_pixbuf-2.0.so.0.2000.1 009e8000-009e9000 r--p 00017000 08:01 13959 /usr/lib/libgdk_pixbuf-2.0.so.0.2000.1 009e9000-009ea000 rw-p 00018000 08:01 13959 /usr/lib/libgdk_pixbuf-2.0.so.0.2000.1 009ea000-00a18000 r-xp 00000000 08:01 4500 /usr/lib/libfontconfig.so.1.4.4 00a18000-00a19000 r--p 0002d000 08:01 4500 /usr/lib/libfontconfig.so.1.4.4 00a19000-00a1a000 rw-p 0002e000 08:01 4500 /usr/lib/libfontconfig.so.1.4.4 00a1c000-00a23000 r-xp 00000000 08:01 2885051 /lib/tls/i686/cmov/librt-2.11.1.so 00a23000-00a24000 r--p 00006000 08:01 2885051 /lib/tls/i686/cmov/librt-2.11.1.so 00a24000-00a25000 rw-p 00007000 08:01 2885051 /lib/tls/i686/cmov/librt-2.11.1.soAbandon |