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.v...@gmail.com>:
> 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
>

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users

Reply via email to