Ticket #1194: Crash.hs

File Crash.hs, 0.5 kB (added by guest, 4 years ago)
Line 
1import Graphics.UI.Gtk as Gtk
2
3main = do
4  initGUI
5  window <- windowNew
6  nb <- notebookNew
7  entry1 <- entryNew
8  entry2 <- entryNew
9
10
11  set nb [ containerChild := entry1,
12           containerChild := entry2 ]
13
14  set window [ containerBorderWidth := 8,
15               windowTitle := "Crash Me",
16               containerChild := nb ]
17
18  -- apparently the widget in this signal can be null
19  on nb setFocusChild $ \w -> widgetGetName w >>= putStrLn >> return ()
20
21  widgetGrabFocus entry1
22  notebookNextPage nb -- CRASH!
23
24  widgetShowAll window
25  mainGUI