亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? gtk_tut-12.html

?? GTK development guide
?? HTML
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.7">
 <TITLE>GTK v1.2 Tutorial: Tree Widget </TITLE>
 <LINK HREF="gtk_tut-13.html" REL=next>
 <LINK HREF="gtk_tut-11.html" REL=previous>
 <LINK HREF="gtk_tut.html#toc12" REL=contents>
</HEAD>
<BODY TEXT="#CCCCCC" BGCOLOR="#000000" LINK="#33cc00" VLINK="#009900" ALINK="#FF0000">
<A HREF="gtk_tut-13.html">Next</A>
<A HREF="gtk_tut-11.html">Previous</A>
<A HREF="gtk_tut.html#toc12">Contents</A>
<HR>
<H2><A NAME="sec_Tree_Widgets"></A> <A NAME="s12">12. Tree Widget </A></H2>

<P>The purpose of tree widgets is to display hierarchically-organized
data. The Tree widget itself is a vertical container for widgets of
type TreeItem. Tree itself is not terribly different from
CList - both are derived directly from Container, and the
Container methods work in the same way on Tree widgets as on
CList widgets. The difference is that Tree widgets can be nested
within other Tree widgets. We'll see how to do this shortly.
<P>The Tree widget has its own window, and defaults to a white
background, as does CList. Also, most of the Tree methods work in
the same way as the corresponding CList ones. However, Tree is
not derived from CList, so you cannot use them interchangeably.
<P>
<P>
<H2><A NAME="ss12.1">12.1 Creating a Tree</A>
</H2>

<P>A Tree is created in the usual way, using:
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkWidget *gtk_tree_new( void );
</PRE>
</CODE></BLOCKQUOTE>
<P>Like the CList widget, a Tree will simply keep growing as more
items are added to it, as well as when subtrees are expanded.  For
this reason, they are almost always packed into a
ScrolledWindow. You might want to use gtk_widget_set_usize() on the
scrolled window to ensure that it is big enough to see the tree's
items, as the default size for ScrolledWindow is quite small.
<P>Now that you have a tree, you'll probably want to add some items to
it.  
<A HREF="#sec_Tree_Item_Widget">The Tree Item Widget</A> below
explains the gory details of TreeItem. For now, it'll suffice to
create one, using:
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkWidget *gtk_tree_item_new_with_label( gchar *label );
</PRE>
</CODE></BLOCKQUOTE>
<P>You can then add it to the tree using one of the following (see
<A HREF="#sec_Tree_Functions">Functions and Macros</A>
below for more options):
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_tree_append( GtkTree    *tree,
                       GtkWidget *tree_item );

void gtk_tree_prepend( GtkTree   *tree,
                       GtkWidget *tree_item );
</PRE>
</CODE></BLOCKQUOTE>
<P>Note that you must add items to a Tree one at a time - there is no
equivalent to gtk_list_*_items().
<P>
<H2><A NAME="ss12.2">12.2 Adding a Subtree</A>
</H2>

<P>A subtree is created like any other Tree widget. A subtree is added
to another tree beneath a tree item, using:
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_tree_item_set_subtree( GtkTreeItem *tree_item,
                                GtkWidget   *subtree );
</PRE>
</CODE></BLOCKQUOTE>
<P>You do not need to call gtk_widget_show() on a subtree before or after
adding it to a TreeItem. However, you <EM>must</EM> have added the
TreeItem in question to a parent tree before calling
gtk_tree_item_set_subtree(). This is because, technically, the parent
of the subtree is <EM>not</EM> the GtkTreeItem which "owns" it, but
rather the GtkTree which holds that GtkTreeItem.
<P>When you add a subtree to a TreeItem, a plus or minus sign appears
beside it, which the user can click on to "expand" or "collapse" it,
meaning, to show or hide its subtree. TreeItems are collapsed by
default. Note that when you collapse a TreeItem, any selected
items in its subtree remain selected, which may not be what the user
expects.
<P>
<H2><A NAME="ss12.3">12.3 Handling the Selection List</A>
</H2>

<P>As with CList, the Tree type has a <CODE>selection</CODE> field, and
it is possible to control the behaviour of the tree (somewhat) by
setting the selection type using:
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_tree_set_selection_mode( GtkTree          *tree,
                                  GtkSelectionMode  mode );
</PRE>
</CODE></BLOCKQUOTE>
<P>The semantics associated with the various selection modes are
described in the section on the CList widget. As with the CList
widget, the "select_child", "unselect_child" (not really - see 
<A HREF="#sec_Tree_Signals">Signals</A> below for an explanation),
and "selection_changed" signals are emitted when list items are
selected or unselected. However, in order to take advantage of these
signals, you need to know <EM>which</EM> Tree widget they will be
emitted by, and where to find the list of selected items.
<P>This is a source of potential confusion. The best way to explain this
is that though all Tree widgets are created equal, some are more equal
than others. All Tree widgets have their own X window, and can
therefore receive events such as mouse clicks (if their TreeItems or
their children don't catch them first!). However, to make
<CODE>GTK_SELECTION_SINGLE</CODE> and <CODE>GTK_SELECTION_BROWSE</CODE> selection
types behave in a sane manner, the list of selected items is specific
to the topmost Tree widget in a hierarchy, known as the "root tree".
<P>Thus, accessing the <CODE>selection</CODE> field directly in an arbitrary
Tree widget is not a good idea unless you <EM>know</EM> it's the root
tree. Instead, use the <CODE>GTK_TREE_SELECTION (Tree)</CODE> macro, which
gives the root tree's selection list as a GList pointer. Of course,
this list can include items that are not in the subtree in question if
the selection type is <CODE>GTK_SELECTION_MULTIPLE</CODE>.
<P>Finally, the "select_child" (and "unselect_child", in theory) signals
are emitted by all trees, but the "selection_changed" signal is only
emitted by the root tree. Consequently, if you want to handle the
"select_child" signal for a tree and all its subtrees, you will have
to call gtk_signal_connect() for every subtree.
<P>
<H2><A NAME="ss12.4">12.4 Tree Widget Internals</A>
</H2>

<P>The Tree's struct definition looks like this:
<P>
<BLOCKQUOTE><CODE>
<PRE>
struct _GtkTree
{
  GtkContainer container;

  GList *children;
  
  GtkTree* root_tree; /* owner of selection list */
  GtkWidget* tree_owner;
  GList *selection;
  guint level;
  guint indent_value;
  guint current_indent;
  guint selection_mode : 2;
  guint view_mode : 1;
  guint view_line : 1;
};
</PRE>
</CODE></BLOCKQUOTE>
<P>The perils associated with accessing the <CODE>selection</CODE> field
directly have already been mentioned. The other important fields of
the struct can also be accessed with handy macros or class functions.
<CODE>GTK_IS_ROOT_TREE (Tree)</CODE> returns a boolean value which
indicates whether a tree is the root tree in a Tree hierarchy, while
<CODE>GTK_TREE_ROOT_TREE (Tree)</CODE> returns the root tree, an object of
type GtkTree (so, remember to cast it using <CODE>GTK_WIDGET (Tree)</CODE> if
you want to use one of the gtk_widget_*() functions on it).
<P>Instead of directly accessing the children field of a Tree widget,
it's probably best to cast it using >tt/GTK_CONTAINER (Tree)/, and
pass it to the gtk_container_children() function. This creates a
duplicate of the original list, so it's advisable to free it up using
g_list_free() after you're done with it, or to iterate on it
destructively, like this:
<P>
<BLOCKQUOTE><CODE>
<PRE>
    children = gtk_container_children (GTK_CONTAINER (tree));
    while (children) {
      do_something_nice (GTK_TREE_ITEM (children->data));
      children = g_list_remove_link (children, children);
}
</PRE>
</CODE></BLOCKQUOTE>
<P>The <CODE>tree_owner</CODE> field is defined only in subtrees, where it
points to the TreeItem widget which holds the tree in question.
The <CODE>level</CODE> field indicates how deeply nested a particular tree
is; root trees have level 0, and each successive level of subtrees has
a level one greater than the parent level. This field is set only
after a Tree widget is actually mapped (i.e. drawn on the screen).
<P>
<H3><A NAME="sec_Tree_Signals"></A> Signals</H3>

<P>
<BLOCKQUOTE><CODE>
<PRE>
void selection_changed( GtkTree *tree );
</PRE>
</CODE></BLOCKQUOTE>
<P>This signal will be emitted whenever the <CODE>selection</CODE> field of a
Tree has changed. This happens when a child of the Tree is
selected or deselected.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void select_child( GtkTree   *tree,
                   GtkWidget *child );
</PRE>
</CODE></BLOCKQUOTE>
<P>This signal is emitted when a child of the Tree is about to get
selected. This happens on calls to gtk_tree_select_item(),
gtk_tree_select_child(), on <EM>all</EM> button presses and calls to
gtk_tree_item_toggle() and gtk_item_toggle().  It may sometimes be
indirectly triggered on other occasions where children get added to or
removed from the Tree.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void unselect_child (GtkTree   *tree,
                     GtkWidget *child);
</PRE>
</CODE></BLOCKQUOTE>
<P>This signal is emitted when a child of the Tree is about to get
deselected. As of GTK 1.0.4, this seems to only occur on calls to
gtk_tree_unselect_item() or gtk_tree_unselect_child(), and perhaps on
other occasions, but <EM>not</EM> when a button press deselects a
child, nor on emission of the "toggle" signal by gtk_item_toggle().
<P>
<H3><A NAME="sec_Tree_Functions"></A> Functions and Macros</H3>

<P>
<BLOCKQUOTE><CODE>
<PRE>
guint gtk_tree_get_type( void );
</PRE>
</CODE></BLOCKQUOTE>
<P>Returns the "GtkTree" type identifier.
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkWidget* gtk_tree_new( void );
</PRE>
</CODE></BLOCKQUOTE>
<P>Create a new Tree object. The new widget is returned as a pointer to a
GtkWidget object. NULL is returned on failure.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_tree_append( GtkTree   *tree,
                      GtkWidget *tree_item );
</PRE>
</CODE></BLOCKQUOTE>
<P>Append a tree item to a Tree.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_tree_prepend( GtkTree   *tree,
                       GtkWidget *tree_item );
</PRE>
</CODE></BLOCKQUOTE>
<P>Prepend a tree item to a Tree.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_tree_insert( GtkTree   *tree,
                      GtkWidget *tree_item,
                      gint       position );
</PRE>
</CODE></BLOCKQUOTE>
<P>Insert a tree item into a Tree at the position in the list
specified by <CODE>position.</CODE>
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_tree_remove_items( GtkTree *tree,
                            GList   *items );
</PRE>
</CODE></BLOCKQUOTE>
<P>Remove a list of items (in the form of a GList *) from a Tree.
Note that removing an item from a tree dereferences (and thus usually)
destroys it <EM>and</EM> its subtree, if it has one, <EM>and</EM> all
subtrees in that subtree. If you want to remove only one item, you
can use gtk_container_remove().
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_tree_clear_items( GtkTree *tree,
                           gint     start,

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩不卡一区二区| 欧美最新大片在线看 | 日韩三级视频中文字幕| 国产精品一二三区在线| 国产一区在线观看视频| 国产精品99久久久久久有的能看| 26uuu精品一区二区在线观看| 日本欧美在线观看| 日韩av一区二| 经典三级视频一区| 国产一区二区毛片| 91香蕉视频在线| 欧美性大战久久久久久久蜜臀| 美女在线视频一区| 久久精品国产精品亚洲精品| 九九九久久久精品| 成人一区二区在线观看| 在线精品亚洲一区二区不卡| 欧美日韩国产高清一区二区三区| 国产精品99久久久久久似苏梦涵| 亚洲图片欧美激情| 夜夜揉揉日日人人青青一国产精品| 欧美一区二区三区视频在线 | 中文字幕成人av| 中文字幕在线观看不卡视频| 国产精品成人免费在线| 亚洲国产成人av好男人在线观看| 精品国产一区二区三区av性色| 99国内精品久久| 69堂成人精品免费视频| 久久日一线二线三线suv| 综合婷婷亚洲小说| 久久国产免费看| 91片黄在线观看| 精品欧美一区二区三区精品久久| 欧美在线观看视频在线| 日韩一卡二卡三卡| 国产精品卡一卡二卡三| 奇米888四色在线精品| 国产精品一区二区果冻传媒| 欧美三级电影网站| 国产精品视频在线看| 日本aⅴ精品一区二区三区| 91视频在线看| 国产亚洲欧美在线| 日韩中文欧美在线| 在线一区二区三区四区| 中文成人av在线| 国产乱人伦偷精品视频免下载| 经典三级一区二区| 欧美美女直播网站| 国产精品久久久久影院老司| 久久99久久99小草精品免视看| 六月丁香婷婷久久| 欧美久久久影院| 亚洲综合免费观看高清完整版在线| 亚洲视频一区在线观看| 国产一区在线视频| 精品动漫一区二区三区在线观看| 日韩一级大片在线| 图片区小说区区亚洲影院| 成人性视频网站| 国产欧美一区二区三区沐欲| 黄一区二区三区| 欧美变态凌虐bdsm| 久久国产精品露脸对白| 日韩欧美电影在线| 蜜臀a∨国产成人精品| 51午夜精品国产| 麻豆91小视频| 久久免费电影网| 国产乱码精品1区2区3区| 日韩欧美中文字幕一区| 久久国内精品自在自线400部| 国产jizzjizz一区二区| 日本一区二区三区免费乱视频| 中文字幕免费观看一区| 国产精品99久久久久久有的能看| 91在线免费视频观看| 中文字幕在线一区免费| 丁香婷婷深情五月亚洲| 国产午夜久久久久| 国产一区二区中文字幕| 久久九九久精品国产免费直播| 亚洲激情五月婷婷| 欧美色图天堂网| 香蕉av福利精品导航| 日韩一区二区三区视频在线| 午夜电影网一区| 日韩精品中文字幕一区| 国产精品主播直播| 亚洲美女视频在线观看| 精品视频全国免费看| 麻豆国产91在线播放| 久久久久国产精品麻豆ai换脸 | 久久精品噜噜噜成人88aⅴ| 日韩午夜激情免费电影| 国产91精品久久久久久久网曝门 | 日韩和欧美一区二区| 欧美一区二区三区思思人 | 成人精品国产一区二区4080| 国产精品久久福利| 欧美午夜精品一区| 国产一区福利在线| 亚洲成人免费看| 国产欧美日韩另类一区| 欧美日韩一区小说| 国模套图日韩精品一区二区| 国产日韩精品一区二区三区| 欧美色电影在线| 东方欧美亚洲色图在线| 五月天激情综合网| 国产精品久久久久久妇女6080| 国产精品综合视频| 午夜欧美2019年伦理| 久久久国际精品| 欧美亚洲综合在线| 成人黄色小视频在线观看| 天堂一区二区在线| 亚洲精品视频一区二区| 欧美一级国产精品| 欧美性xxxxxx少妇| 丁香婷婷综合色啪| 黄页网站大全一区二区| 亚洲影院免费观看| 国产精品久久久久久久久久久免费看 | 久久国产福利国产秒拍| 国产精品白丝jk白祙喷水网站| 欧美伦理电影网| 粉嫩aⅴ一区二区三区四区五区| 久久久久久久久久久电影| 在线观看亚洲专区| 91尤物视频在线观看| 国产一区二区三区高清播放| 午夜一区二区三区视频| 国产精品第13页| 久久免费视频一区| 日韩欧美不卡在线观看视频| 欧美午夜视频网站| 欧美在线免费播放| 99精品欧美一区二区蜜桃免费| 中文字幕一区视频| 日本一区二区动态图| 久久久777精品电影网影网| 日韩欧美高清dvd碟片| 欧美精品丝袜中出| 91精品国产综合久久久久久漫画| 亚洲一区二区三区四区不卡| 自拍视频在线观看一区二区| 国产欧美1区2区3区| 久久久精品免费观看| 久久久午夜精品理论片中文字幕| 狠狠狠色丁香婷婷综合激情| 五月婷婷激情综合网| 亚洲一区二区欧美激情| 亚洲福利一二三区| 丝袜美腿亚洲综合| 日韩成人一级片| 韩国成人在线视频| 国产91精品久久久久久久网曝门 | 色综合久久综合网欧美综合网 | 日韩欧美你懂的| 欧美日产国产精品| 91精品国产麻豆国产自产在线| 六月丁香婷婷久久| 国产一区福利在线| av在线不卡电影| 在线欧美日韩精品| 欧美一区二区在线免费播放 | 亚洲午夜精品17c| 五月激情综合网| 精品亚洲成a人在线观看 | 日本道在线观看一区二区| 欧美影视一区在线| 精品国产第一区二区三区观看体验| av网站一区二区三区| 欧美午夜精品一区二区三区| 欧美一区二区三区在| 中文一区一区三区高中清不卡| 欧美影院一区二区| 日韩美女一区二区三区四区| 国产欧美视频在线观看| 一色屋精品亚洲香蕉网站| 五月激情丁香一区二区三区| 国产乱码精品1区2区3区| 色婷婷亚洲婷婷| 精品国产一区二区精华| 亚洲精品五月天| 国产老肥熟一区二区三区| 色播五月激情综合网| 久久精品一区蜜桃臀影院| 亚洲乱码国产乱码精品精小说 | 欧美性大战xxxxx久久久| 欧美v日韩v国产v| 亚洲伦理在线免费看| 国产一区二区三区黄视频| 欧美性感一类影片在线播放| 国产日韩精品久久久| 日韩电影在线一区| 色呦呦国产精品|