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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bindtabs Bwidget question

Status
Not open for further replies.

fabien

Technical User
Sep 25, 2001
299
AU
Hi there!

I have created a notebook like this
set nbk [NoteBook .fmtype.body.nb -background $ftcol]
# Add 4 tabs to it
set tabID 0
foreach tabText {Horizon Fault Mapping} {

# Keep a running "tabID"
incr tabID

# Insert a page into the Notebook named "$tabID"
set pageID [$nbk insert end $tabID -text $tabText -background $ftcol -foreground black]
puts $pageID

...
}

Then I created a binding like
#notebook bindings
$nbk bindtabs <ButtonPress-1> pageEnter

where
proc pageEnter {pageID} {
puts "Just entered page $pageID"
}

The only thing I get output is
"Just entered page text"

although I would like to get
.fmtype.body.nb.f1 OR
.fmtype.body.nb.f2 OR
.fmtype.body.nb.f3
depending on which tab I click on

 
After a glance at the Notebook man page, appears you need to add $::nbk raise $pageID in front of your pageEnter proc.

(not tested)

HTH

ulis
 
Thanks Ulis in fact I loaded a later version of Bwidget and now the function works fine. I read there was a bug in bintags..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top