You are here

The Tree Widget 8.0.3

admin의 아바타
첨부 파일파일 크기
Binary Data tree-8.0.3.tar.gz173.29 KB
Image icon tcl.tree.5.gif5.19 KB

홈페이지 :

홈페이지를 방문하시면 다른 트리 위젯과 틀리다는것을 확인 하실수 있습니다.

Much of the information that computers deal with is hierarchical, or can be viewed as a hierarchy. A UNIX file system is one of the most common examples. The Tk widget hierarchy is another. One of the best ways to display an overview of this kind of data is in the form of a tree.

This chapter describes a widget for displaying trees in Tk. The tree widget really has two interfaces. The first is to the basic Tk widget, which is implemented in C++. This is the most flexible and is the one we will look at first. The second interface is implemented as an [incr Tcl] class built on top of the tree widget. The [incr Tcl] class offers a simpler, but less flexible interface that displays trees where each node is made up of a label and an optional bitmap. We will come to that later on.

The tree widget differs from most other Tk widgets in that it doesn't display its own window and does not need to be packed in the window hierarchy. What the tree widget does is manage items that you create in a Tk canvas. You create the tree as a child of a canvas widget and then tell it which canvas items make up each tree node and line. The tree widget calculates the layout and repositions the canvas items to make the tree. Using canvas items for the tree nodes and lines has some great advantages. The tree nodes can be made up of any combination of canvas items, including text, bitmaps, images and other graphics. You design the lines connecting the tree nodes, so you can make them in any color, style or thickness you like.