# Bug in notebook.tcl v1.8
# This is a regression.

##  -#  $Id: notebook.tcl,v 1.23 2005/01/26 01:01:26 hobbs Exp $
##  +#  $Id: notebook.tcl,v 1.25 2009/07/01 14:41:30 oehhar Exp $

# Create a simple NoteBook

package require BWidget
NoteBook .nb
pack .nb -fill both -expand 1

.nb insert 0 page1 -text "Page 1"
.nb insert 1 page2 -text "Page 2"

.nb compute_size
.nb raise [.nb pages 1]


# Now try removing and restoring a page.
# If $destroyframe is 1 (the default), the page is destroyed
# If $destroyframe is 0, the page is unmapped but not destroyed

set destroyframe 0
.nb delete page1 $destroyframe
# At this point the internal data($page,realized) has been deleted -
# incorrectly if $destroyframe is 0
.nb insert 0 page1 -text "Page 1"

# Now when you click on page1 a bgerror occurs and the tab is not raised

