Hi all

If I run the following program:

{-# OPTIONS -fglasgow-exts #-}

module Main where

import Graphics.UI.WX

main = start $
    do w  <- frame [text := "ListBox Event Handling"]
       p  <- panel w []
       listBox  <- multiListBox p [ items := [ "Foobar" ] ]
       set listBox [ on select := do set listBox [ items := [ "foo", "Bar"] ]
                                     propagateEvent
                   ]
       set w [ layout := container p $ widget listBox
             ]

and click on the listbox item "Foobar", the program crashes with:

(L:6279): Gtk-WARNING **: unable to find signal handler for 
object(GtkListItem:0x8425e40) with func((nil)) and data(0x845ac18)

The problem is that I change the listbox items from within a listbox
event handler. Do anybody know if this expected behavior or is it a bug
somewhere in WxHaskell, Wxwindows, or GTK?

Of cause I can use this clumsy workaround:

main2 = start $
    do w  <- frame [text := "ListBox Event Handling"]
       p  <- panel w []
       listBox  <- multiListBox p [ items := [ "Foobar" ] ]
       let setListBoxItems =
                 mdo t <- timer listBox [ interval := 100
                                        , on command := do set listBox [ items 
:= [ "foo", "Bar"] ]
                                                           objectDelete t
                                        ]
                     return()
       set listBox [ on select := do setListBoxItems
                                     propagateEvent
                   ]
       set w [ layout := container p $ widget listBox
             ]

but I would rather not have to.


Greetings,

Mads Lindstrøm



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users

Reply via email to