Ticket #1194 (closed defect: fixed)
null passed to makeNewGObject in handler for setFocusChild
| Reported by: | guest | Owned by: | somebody |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11.0 |
| Component: | general (Gtk+, Glib) | Version: | 0.11.0 |
| Keywords: | null setFocusChild | Cc: |
Description
The following code crashes with
Crash: user error (makeNewGObject: object is NULL)
This happens with gtk-0.11.0 and the latest code from the darcs repository. There is a similar error with Window.onSetFocus/afterSetFocus.
import Graphics.UI.Gtk as Gtk
main = do
initGUI window <- windowNew nb <- notebookNew entry1 <- entryNew entry2 <- entryNew
set nb [ containerChild := entry1,
containerChild := entry2 ]
set window [ containerBorderWidth := 8,
windowTitle := "Crash Me", containerChild := nb ]
-- apparently the widget in this signal can be null on nb setFocusChild $ \w -> widgetGetName w >>= putStrLn >> return ()
widgetGrabFocus entry1 notebookNextPage nb -- CRASH!
widgetShowAll window mainGUI