Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to disable/enable a notebook page?

Status
Not open for further replies.

xhuangtx

Programmer
Oct 25, 2013
4
US
Say, I create a page

set notebook [NoteBook $frame]
set pageframe [$notebook insert end page1 -text "Apple"]

How can I disable it?

Thanks.
 
Got it with:)
Widget::configure $path.f$page {-state disabled}
or
Widget::configure $path.f$page {-state normal}

 
Also noted that if the page has been raised, then it cannot be configured to be disabled or normal, even if I called redraw. My workaround is not to raise the page at the creation time, but until after the page is configured to the wanted state (in my case, from disabled to normal), then redraw the page to update the text display, and then raise the page, something like:

Widget::configure $path.f$page {-state normal}
$notebook _redraw

$notebook raise [$notebook page 0] ;# raise the first page by default


I wonder if and hope there is a natural way which is robust and independent of whether the page has been raised or not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top