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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? gtk_tut-11.html

?? GTK development guide
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
<!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: CList Widget</TITLE>
 <LINK HREF="gtk_tut-12.html" REL=next>
 <LINK HREF="gtk_tut-10.html" REL=previous>
 <LINK HREF="gtk_tut.html#toc11" REL=contents>
</HEAD>
<BODY TEXT="#CCCCCC" BGCOLOR="#000000" LINK="#33cc00" VLINK="#009900" ALINK="#FF0000">
<A HREF="gtk_tut-12.html">Next</A>
<A HREF="gtk_tut-10.html">Previous</A>
<A HREF="gtk_tut.html#toc11">Contents</A>
<HR>
<H2><A NAME="s11">11. CList Widget</A></H2>

<P>The CList widget has replaced the List widget (which is still
available).
<P>The CList widget is a multi-column list widget that is capable of
handling literally thousands of rows of information. Each column can
optionally have a title, which itself is optionally active, allowing
us to bind a function to its selection.
<P>
<H2><A NAME="ss11.1">11.1 Creating a CList widget</A>
</H2>

<P>Creating a CList is quite straightforward, once you have learned
about widgets in general. It provides the almost standard two ways,
that is the hard way, and the easy way. But before we create it, there
is one thing we should figure out beforehand: how many columns should
it have?
<P>Not all columns have to be visible and can be used to store data that
is related to a certain cell in the list.
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkWidget *gtk_clist_new ( gint columns );

GtkWidget *gtk_clist_new_with_titles( gint   columns,
                                      gchar *titles[] );
</PRE>
</CODE></BLOCKQUOTE>
<P>The first form is very straightforward, the second might require some
explanation. Each column can have a title associated with it, and this
title can be a label or a button that reacts when we click on it. If
we use the second form, we must provide pointers to the title texts,
and the number of pointers should equal the number of columns
specified. Of course we can always use the first form, and manually
add titles later.
<P>Note: The CList widget does not have its own scrollbars and should
be placed within a ScrolledWindow widget if your require this
functionality. This is a change from the GTK 1.0 implementation.
<P>
<H2><A NAME="ss11.2">11.2 Modes of operation</A>
</H2>

<P>There are several attributes that can be used to alter the behaviour of
a CList. First there is
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_set_selection_mode( GtkCList         *clist,
                                   GtkSelectionMode  mode );
</PRE>
</CODE></BLOCKQUOTE>
<P>which, as the name implies, sets the selection mode of the
CList. The first argument is the CList widget, and the second
specifies the cell selection mode (they are defined in gtkenums.h). At
the time of this writing, the following modes are available to us:
<P>
<UL>
<LI> <CODE>GTK_SELECTION_SINGLE</CODE> - The selection is either NULL or contains
a GList pointer for a single selected item.
</LI>
<LI> <CODE>GTK_SELECTION_BROWSE</CODE> - The selection is NULL if the list
contains no widgets or insensitive ones only, otherwise it contains a
GList pointer for one GList structure, and therefore exactly one list
item.
</LI>
<LI> <CODE>GTK_SELECTION_MULTIPLE</CODE> - The selection is NULL if no list items
are selected or a GList pointer for the first selected item. That in
turn points to a GList structure for the second selected item and so
on. This is currently the <B>default</B> for the CList widget.
</LI>
<LI> <CODE>GTK_SELECTION_EXTENDED</CODE> - The selection is always NULL.</LI>
</UL>
<P>Others might be added in later revisions of GTK.
<P>We can also define what the border of the CList widget should look
like. It is done through
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_set_shadow_type( GtkCList      *clist,
                                GtkShadowType  border );
</PRE>
</CODE></BLOCKQUOTE>
<P>The possible values for the second argument are
<P>
<BLOCKQUOTE><CODE>
<PRE>
  GTK_SHADOW_NONE
  GTK_SHADOW_IN
  GTK_SHADOW_OUT
  GTK_SHADOW_ETCHED_IN
  GTK_SHADOW_ETCHED_OUT
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss11.3">11.3 Working with titles</A>
</H2>

<P>When you create a CList widget, you will also get a set of title
buttons automatically. They live in the top of the CList window, and
can act either as normal buttons that respond to being pressed, or
they can be passive, in which case they are nothing more than a
title. There are four different calls that aid us in setting the
status of the title buttons.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_column_title_active( GtkCList *clist,
                                     gint     column );

void gtk_clist_column_title_passive( GtkCList *clist,
                                     gint      column );

void gtk_clist_column_titles_active( GtkCList *clist );

void gtk_clist_column_titles_passive( GtkCList *clist );
</PRE>
</CODE></BLOCKQUOTE>
<P>An active title is one which acts as a normal button, a passive one is
just a label. The first two calls above will activate/deactivate the
title button above the specific column, while the last two calls
activate/deactivate all title buttons in the supplied clist widget.
<P>But of course there are those cases when we don't want them at all,
and so they can be hidden and shown at will using the following two
calls.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_column_titles_show( GtkCList *clist );

void gtk_clist_column_titles_hide( GtkCList *clist );
</PRE>
</CODE></BLOCKQUOTE>
<P>For titles to be really useful we need a mechanism to set and change
them, and this is done using
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_set_column_title( GtkCList *clist,
                                 gint      column,
                                 gchar    *title );
</PRE>
</CODE></BLOCKQUOTE>
<P>Note that only the title of one column can be set at a time, so if all
the titles are known from the beginning, then I really suggest using
gtk_clist_new_with_titles (as described above) to set them. It saves
you coding time, and makes your program smaller. There are some cases
where getting the job done the manual way is better, and that's when
not all titles will be text. CList provides us with title buttons
that can in fact incorporate whole widgets, for example a pixmap. It's
all done through
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_set_column_widget( GtkCList  *clist,
                                  gint       column,
                                  GtkWidget *widget );
</PRE>
</CODE></BLOCKQUOTE>
<P>which should require no special explanation.
<P>
<H2><A NAME="ss11.4">11.4 Manipulating the list itself</A>
</H2>

<P>It is possible to change the justification for a column, and it is
done through
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_set_column_justification( GtkCList         *clist,
                                         gint              column,
                                         GtkJustification  justification );
</PRE>
</CODE></BLOCKQUOTE>
<P>The GtkJustification type can take the following values:
<P>
<UL>
<LI><CODE>GTK_JUSTIFY_LEFT</CODE> - The text in the column will begin from the
left edge.
</LI>
<LI><CODE>GTK_JUSTIFY_RIGHT</CODE> - The text in the column will begin from the
right edge.
</LI>
<LI><CODE>GTK_JUSTIFY_CENTER</CODE> - The text is placed in the center of the
column.
</LI>
<LI><CODE>GTK_JUSTIFY_FILL</CODE> - The text will use up all available space in
the column. It is normally done by inserting extra blank spaces
between words (or between individual letters if it's a single
word). Much in the same way as any ordinary WYSIWYG text editor.</LI>
</UL>
<P>The next function is a very important one, and should be standard in
the setup of all CList widgets. When the list is created, the width
of the various columns are chosen to match their titles, and since
this is seldom the right width we have to set it using
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_set_column_width( GtkCList *clist,
                                 gint      column,
                                 gint      width );
</PRE>
</CODE></BLOCKQUOTE>
<P>Note that the width is given in pixels and not letters. The same goes
for the height of the cells in the columns, but as the default value
is the height of the current font this isn't as critical to the
application. Still, it is done through
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_set_row_height( GtkCList *clist,
                               gint      height );
</PRE>
</CODE></BLOCKQUOTE>
<P>Again, note that the height is given in pixels.
<P>We can also move the list around without user interaction, however, it
does require that we know what we are looking for. Or in other words,
we need the row and column of the item we want to scroll to.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_moveto( GtkCList *clist,
                       gint      row,
                       gint      column,
                       gfloat    row_align,
                       gfloat    col_align );
</PRE>
</CODE></BLOCKQUOTE>
<P>The gfloat row_align is pretty important to understand. It's a value
between 0.0 and 1.0, where 0.0 means that we should scroll the list so
the row appears at the top, while if the value of row_align is 1.0,
the row will appear at the bottom instead. All other values between
0.0 and 1.0 are also valid and will place the row between the top and
the bottom. The last argument, gfloat col_align works in the same way,
though 0.0 marks left and 1.0 marks right instead.
<P>Depending on the application's needs, we don't have to scroll to an
item that is already visible to us. So how do we know if it is
visible? As usual, there is a function to find that out as well.
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkVisibility gtk_clist_row_is_visible( GtkCList *clist,
                                        gint      row );
</PRE>
</CODE></BLOCKQUOTE>
<P>The return value is is one of the following:
<P>
<BLOCKQUOTE><CODE>
<PRE>
  GTK_VISIBILITY_NONE
  GTK_VISIBILITY_PARTIAL
  GTK_VISIBILITY_FULL
</PRE>
</CODE></BLOCKQUOTE>
<P>Note that it will only tell us if a row is visible. Currently there is
no way to determine this for a column. We can get partial information
though, because if the return is <CODE>GTK_VISIBILITY_PARTIAL</CODE>, then
some of it is hidden, but we don't know if it is the row that is being
cut by the lower edge of the listbox, or if the row has columns that
are outside.
<P>We can also change both the foreground and background colors of a
particular row. This is useful for marking the row selected by the
user, and the two functions that is used to do it are
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_set_foreground( GtkCList *clist,
                               gint      row,
                               GdkColor *color );

void gtk_clist_set_background( GtkCList *clist,
                               gint      row,
                               GdkColor *color );
</PRE>
</CODE></BLOCKQUOTE>
<P>Please note that the colors must have been previously allocated.
<P>
<H2><A NAME="ss11.5">11.5 Adding rows to the list</A>
</H2>

<P>We can add rows in three ways. They can be prepended or appended to
the list using
<P>
<BLOCKQUOTE><CODE>
<PRE>
gint gtk_clist_prepend( GtkCList *clist,
                        gchar    *text[] );

gint gtk_clist_append( GtkCList *clist,
                       gchar    *text[] );
</PRE>
</CODE></BLOCKQUOTE>
<P>The return value of these two functions indicate the index of the row
that was just added. We can insert a row at a given place using
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_insert( GtkCList *clist,
                       gint      row,
                       gchar    *text[] );
</PRE>
</CODE></BLOCKQUOTE>
<P>In these calls we have to provide a collection of pointers that are
the texts we want to put in the columns. The number of pointers should
equal the number of columns in the list. If the text[] argument is
NULL, then there will be no text in the columns of the row. This is
useful, for example, if we want to add pixmaps instead (something that
has to be done manually).
<P>Also, please note that the numbering of both rows and columns start at 0.
<P>To remove an individual row we use
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_remove( GtkCList *clist,
                       gint      row );
</PRE>
</CODE></BLOCKQUOTE>
<P>There is also a call that removes all rows in the list. This is a lot
faster than calling gtk_clist_remove once for each row, which is the
only alternative.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_clear( GtkCList *clist );
</PRE>
</CODE></BLOCKQUOTE>
<P>There are also two convenience functions that should be used when a
lot of changes have to be made to the list. This is to prevent the
list flickering while being repeatedly updated, which may be highly
annoying to the user. So instead it is a good idea to freeze the list,
do the updates to it, and finally thaw it which causes the list to be
updated on the screen.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_freeze( GtkCList * clist );

void gtk_clist_thaw( GtkCList * clist );
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss11.6">11.6 Setting text and pixmaps in the cells</A>
</H2>

<P>A cell can contain a pixmap, text or both. To set them the following
functions are used.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_set_text( GtkCList    *clist,
                         gint         row,
                         gint         column,
                         const gchar *text );

void gtk_clist_set_pixmap( GtkCList  *clist,
                           gint       row,
                           gint       column,
                           GdkPixmap *pixmap,
                           GdkBitmap *mask );

void gtk_clist_set_pixtext( GtkCList  *clist,
                            gint       row,
                            gint       column,
                            gchar     *text,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产一区二区视频| 天堂资源在线中文精品| 欧美年轻男男videosbes| 91麻豆国产福利在线观看| 成人一级视频在线观看| 国产a区久久久| 色综合中文字幕国产 | 久久久99久久| 久久一区二区三区四区| 久久久久九九视频| 欧美国产精品中文字幕| 中文字幕欧美一| 亚洲日本一区二区| 天天综合网天天综合色| 91首页免费视频| 欧美激情一区二区三区| 久久精品国产网站| 国产伦精一区二区三区| 成人99免费视频| 欧美高清性hdvideosex| 久久婷婷色综合| 免费一级片91| 粉嫩aⅴ一区二区三区四区五区| 欧美一区二区三区在线电影| 26uuu精品一区二区| 日本三级韩国三级欧美三级| 成人午夜精品一区二区三区| 久久日韩精品一区二区五区| 欧美a级一区二区| 884aa四虎影成人精品一区| 国产午夜亚洲精品羞羞网站| 久久99九九99精品| 91久久精品午夜一区二区| 日韩一区二区在线免费观看| 久久婷婷国产综合国色天香| 亚洲愉拍自拍另类高清精品| 久久精品国产在热久久| 在线观看91av| 日韩一级免费观看| 日韩影院精彩在线| 欧美精品aⅴ在线视频| 香蕉乱码成人久久天堂爱免费| 爽爽淫人综合网网站| 欧美艳星brazzers| 国产亚洲福利社区一区| 国产一区二区三区四区五区入口| 精品国产三级a在线观看| 一级做a爱片久久| 国产一区二区三区av电影| 精品国产乱码久久久久久蜜臀| 精品在线观看视频| 久久久久久久久久久99999| 国产成人在线电影| 欧美大片一区二区| 午夜亚洲福利老司机| 欧美喷水一区二区| 老司机午夜精品99久久| 久久久噜噜噜久噜久久综合| 国产**成人网毛片九色 | 日韩欧美二区三区| 国产精品综合在线视频| 26uuu另类欧美亚洲曰本| 青草av.久久免费一区| 欧美一激情一区二区三区| 国产永久精品大片wwwapp| 国产精品久久久久久久久果冻传媒| 青青草国产精品97视觉盛宴| 日韩美女视频一区二区在线观看| 国产一区二区三区免费看| 中文字幕五月欧美| 欧美天天综合网| 男女男精品网站| 久久久不卡网国产精品二区| 不卡影院免费观看| 亚洲国产综合91精品麻豆| 欧美大片拔萝卜| 成人av网址在线观看| 亚洲成人福利片| 久久久不卡影院| 欧美性猛交xxxxxx富婆| 裸体在线国模精品偷拍| 日韩欧美精品三级| 成人免费视频app| 亚洲二区在线观看| 久久精品视频在线免费观看| 91精彩视频在线| 精品一区二区三区在线视频| 国产精品不卡在线观看| 91精品一区二区三区久久久久久| 国产美女精品人人做人人爽 | 宅男噜噜噜66一区二区66| 国产一区二区女| 一个色在线综合| 久久久久久亚洲综合| 色94色欧美sute亚洲线路一久| 美腿丝袜亚洲综合| 亚洲免费视频中文字幕| 91亚洲精华国产精华精华液| 日本伊人午夜精品| 国产精品久久国产精麻豆99网站| 欧美喷水一区二区| 99这里只有久久精品视频| 中文字幕一区日韩精品欧美| 欧美精品久久99久久在免费线 | 国产一区二区成人久久免费影院| 亚洲免费观看高清完整版在线观看熊 | 欧美日韩中文字幕一区二区| 亚洲成人免费电影| 国产精品久久久久久久久免费樱桃| 欧美久久久久久久久| a4yy欧美一区二区三区| 美日韩一区二区| 午夜精品久久久久久久| 日韩一区欧美一区| 久久久久久97三级| 欧美mv日韩mv国产网站| 国产成人av福利| 日本视频一区二区三区| 亚洲综合免费观看高清完整版在线| 久久精品一区二区三区不卡牛牛| 在线成人免费观看| 日本道精品一区二区三区| 成人看片黄a免费看在线| 精品一区二区在线视频| 日韩激情一二三区| 亚洲成人精品一区| 一区二区三区蜜桃网| 中文字幕在线不卡| 国产夜色精品一区二区av| 日韩一区二区电影网| 7777精品伊人久久久大香线蕉的| 色狠狠色狠狠综合| 99久久婷婷国产综合精品电影| 亚洲一区二三区| 亚洲欧洲日产国码二区| 国产性做久久久久久| 欧美电影免费观看高清完整版在线| 欧美美女视频在线观看| 欧美三级欧美一级| 在线日韩av片| 国产美女精品人人做人人爽| 美国十次综合导航| 成人污视频在线观看| 国产精品日日摸夜夜摸av| 国产不卡免费视频| 亚洲无线码一区二区三区| 国产精品高潮呻吟| 国产欧美1区2区3区| 欧美日韩中文字幕一区二区| 欧美影视一区在线| 欧美性受极品xxxx喷水| 欧美在线观看禁18| 在线观看日韩精品| 在线观看亚洲a| 欧美性猛片aaaaaaa做受| 欧美色手机在线观看| 欧美日韩成人综合在线一区二区| 欧美日韩精品一区二区天天拍小说| 欧美视频一区二区三区四区| 欧美三级电影在线观看| 7777精品伊人久久久大香线蕉最新版| 制服丝袜亚洲精品中文字幕| 欧美一区二区日韩| 精品剧情v国产在线观看在线| 精品国产a毛片| 欧美极品aⅴ影院| 国产精品久久久久久久久动漫| 中文字幕一区二区三区在线不卡 | 日本一区免费视频| 国产精品美女一区二区三区| 亚洲欧美一区二区在线观看| 亚洲柠檬福利资源导航| 午夜国产精品影院在线观看| 日本亚洲欧美天堂免费| 久久69国产一区二区蜜臀| 国产精品88888| 99久久精品国产导航| 在线视频欧美区| 欧美一区日本一区韩国一区| 精品乱人伦一区二区三区| 国产日韩视频一区二区三区| 综合自拍亚洲综合图不卡区| 亚洲一区二区成人在线观看| 日本vs亚洲vs韩国一区三区| 国产一区二区不卡老阿姨| www.欧美.com| 欧美日韩一区 二区 三区 久久精品| 91麻豆精品国产无毒不卡在线观看 | 欧美伊人久久久久久午夜久久久久| 7777精品久久久大香线蕉| 亚洲精品在线观看网站| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 成人av午夜影院| 欧美亚洲国产一区二区三区va| 日韩一区二区免费电影| 欧美激情一二三区| 亚洲综合av网| 国内精品久久久久影院薰衣草| 另类小说图片综合网| a美女胸又www黄视频久久|