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!

Bwidget tree example

Status
Not open for further replies.

fabien

Technical User
Sep 25, 2001
299
AU
Hi!

Does someone have a simple Bwidget tree example source code. I find the one given in the Bwidget install demo quite complicated.

Many thanks!
 
Hi fabien,

here is a very simple example to get you started (it looks ugly, but to study the docs for more options is left to you as an exercise :)

package require BWidget

set w .t
Tree $w
pack $w

# create root-node
$w insert end root 1 -text "Rootnode"
$w insert end 1 1.1 -text "1.1"
$w insert end 1 1.2 -text "1.2"
$w insert end 1.1 1.1.1 -text "1.1.1"
$w insert end 1.1 1.1.2 -text "1.1.2"

When I wanted to adapt the BWidget-Tree to something similar as the "Windows"-Explorer-Tree I had some problems but it works (though I had to use some internals of the Tree).
Nowadays I would rather use TreeCtrl ( which is in many ways nicer and has many more options.

Best regards
Stefan
--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top