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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? gtk_tut-11.html

?? GTK development guide
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
                            guint8     spacing,
                            GdkPixmap *pixmap,
                            GdkBitmap *mask );
</PRE>
</CODE></BLOCKQUOTE>
<P>It's quite straightforward. All the calls have the CList as the first
argument, followed by the row and column of the cell, followed by the
data to be set. The <CODE>spacing</CODE> argument in gtk_clist_set_pixtext is
the number of pixels between the pixmap and the beginning of the
text. In all cases the data is copied into the widget.
<P>To read back the data, we instead use
<P>
<BLOCKQUOTE><CODE>
<PRE>
gint gtk_clist_get_text( GtkCList  *clist,
                         gint       row,
                         gint       column,
                         gchar    **text );

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

gint gtk_clist_get_pixtext( GtkCList   *clist,
                            gint        row,
                            gint        column,
                            gchar     **text,
                            guint8     *spacing,
                            GdkPixmap **pixmap,
                            GdkBitmap **mask );
</PRE>
</CODE></BLOCKQUOTE>
<P>The returned pointers are all pointers to the data stored within the
widget, so the referenced data should not be modified or released. It
isn't necessary to read it all back in case you aren't interested. Any
of the pointers that are meant for return values (all except the
clist) can be NULL. So if we want to read back only the text from a
cell that is of type pixtext, then we would do the following, assuming
that clist, row and column already exist:
<P>
<BLOCKQUOTE><CODE>
<PRE>
gchar *mytext;

gtk_clist_get_pixtext(clist, row, column, &amp;mytext, NULL, NULL, NULL);
</PRE>
</CODE></BLOCKQUOTE>
<P>There is one more call that is related to what's inside a cell in the
clist, and that's
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkCellType gtk_clist_get_cell_type( GtkCList *clist,
                                     gint      row,
                                     gint      column );
</PRE>
</CODE></BLOCKQUOTE>
<P>which returns the type of data in a cell. The return value is one of
<P>
<BLOCKQUOTE><CODE>
<PRE>
  GTK_CELL_EMPTY
  GTK_CELL_TEXT
  GTK_CELL_PIXMAP
  GTK_CELL_PIXTEXT
  GTK_CELL_WIDGET
</PRE>
</CODE></BLOCKQUOTE>
<P>There is also a function that will let us set the indentation, both
vertical and horizontal, of a cell. The indentation value is of type
gint, given in pixels, and can be both positive and negative.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_set_shift( GtkCList *clist,
                          gint      row,
                          gint      column,
                          gint      vertical,
                          gint      horizontal );
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss11.7">11.7 Storing data pointers</A>
</H2>

<P>With a CList it is possible to set a data pointer for a row. This
pointer will not be visible for the user, but is merely a convenience
for the programmer to associate a row with a pointer to some
additional data.
<P>The functions should be fairly self-explanatory by now.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_set_row_data( GtkCList *clist,
                             gint      row,
                             gpointer  data );

void gtk_clist_set_row_data_full( GtkCList         *clist,
                                  gint              row,
                                  gpointer          data,
                                  GtkDestroyNotify  destroy );

gpointer gtk_clist_get_row_data( GtkCList *clist,
                                 gint      row );

gint gtk_clist_find_row_from_data( GtkCList *clist,
                                   gpointer  data );
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss11.8">11.8 Working with selections</A>
</H2>

<P>There are also functions available that let us force the (un)selection
of a row. These are
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_clist_select_row( GtkCList *clist,
                           gint      row,
                           gint      column );

void gtk_clist_unselect_row( GtkCList *clist,
                             gint      row,
                             gint      column );
</PRE>
</CODE></BLOCKQUOTE>
<P>And also a function that will take x and y coordinates (for example,
read from the mousepointer), and map that onto the list, returning the
corresponding row and column.
<P>
<BLOCKQUOTE><CODE>
<PRE>
gint gtk_clist_get_selection_info( GtkCList *clist,
                                   gint      x,
                                   gint      y,
                                   gint     *row,
                                   gint     *column );
</PRE>
</CODE></BLOCKQUOTE>
<P>When we detect something of interest (it might be movement of the
pointer, a click somewhere in the list) we can read the pointer
coordinates and find out where in the list the pointer is. Cumbersome?
Luckily, there is a simpler way...
<P>
<H2><A NAME="ss11.9">11.9 The signals that bring it together</A>
</H2>

<P>As with all other widgets, there are a few signals that can be used. The
CList widget is derived from the Container widget, and so has all the
same signals, but also adds the following:
<P>
<UL>
<LI>select_row - This signal will send the following information, in
order: GtkCList *clist, gint row, gint column, GtkEventButton *event
</LI>
<LI>unselect_row - When the user unselects a row, this signal is
activated. It sends the same information as select_row
</LI>
<LI>click_column - Send GtkCList *clist, gint column</LI>
</UL>
<P>So if we want to connect a callback to select_row, the callback
function would be declared like this
<P>
<BLOCKQUOTE><CODE>
<PRE>
void select_row_callback(GtkWidget *widget,
                         gint row,
                         gint column,
                         GdkEventButton *event,
                         gpointer data);
</PRE>
</CODE></BLOCKQUOTE>
<P>The callback is connected as usual with
<P>
<BLOCKQUOTE><CODE>
<PRE>
gtk_signal_connect(GTK_OBJECT( clist),
                   "select_row"
                   GTK_SIGNAL_FUNC(select_row_callback),
                   NULL);
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss11.10">11.10 A CList example</A>
</H2>

<P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
/* example-start clist clist.c */

#include &lt;gtk/gtk.h>

/* User clicked the "Add List" button. */
void button_add_clicked( gpointer data )
{
    int indx;
 
    /* Something silly to add to the list. 4 rows of 2 columns each */
    gchar *drink[4][2] = { { "Milk",    "3 Oz" },
                           { "Water",   "6 l" },
                           { "Carrots", "2" },
                           { "Snakes",  "55" } };

    /* Here we do the actual adding of the text. It's done once for
     * each row.
     */
    for ( indx=0 ; indx &lt; 4 ; indx++ )
        gtk_clist_append( (GtkCList *) data, drink[indx]);

    return;
}

/* User clicked the "Clear List" button. */
void button_clear_clicked( gpointer data )
{
    /* Clear the list using gtk_clist_clear. This is much faster than
     * calling gtk_clist_remove once for each row.
     */
    gtk_clist_clear( (GtkCList *) data);

    return;
}

/* The user clicked the "Hide/Show titles" button. */
void button_hide_show_clicked( gpointer data )
{
    /* Just a flag to remember the status. 0 = currently visible */
    static short int flag = 0;

    if (flag == 0)
    {
        /* Hide the titles and set the flag to 1 */
        gtk_clist_column_titles_hide((GtkCList *) data);
        flag++;
    }
    else
    {
        /* Show the titles and reset flag to 0 */
        gtk_clist_column_titles_show((GtkCList *) data);
        flag--;
    }

    return;
}

/* If we come here, then the user has selected a row in the list. */
void selection_made( GtkWidget      *clist,
                     gint            row,
                     gint            column,
                     GdkEventButton *event,
                     gpointer        data )
{
    gchar *text;

    /* Get the text that is stored in the selected row and column
     * which was clicked in. We will receive it as a pointer in the
     * argument text.
     */
    gtk_clist_get_text(GTK_CLIST(clist), row, column, &amp;text);

    /* Just prints some information about the selected row */
    g_print("You selected row %d. More specifically you clicked in "
            "column %d, and the text in this cell is %s\n\n",
            row, column, text);

    return;
}

int main( int    argc,
          gchar *argv[] )
{                                  
    GtkWidget *window;
    GtkWidget *vbox, *hbox;
    GtkWidget *scrolled_window, *clist;
    GtkWidget *button_add, *button_clear, *button_hide_show;    
    gchar *titles[2] = { "Ingredients", "Amount" };

    gtk_init(&amp;argc, &amp;argv);
    
    window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_widget_set_usize(GTK_WIDGET(window), 300, 150);

    gtk_window_set_title(GTK_WINDOW(window), "GtkCList Example");
    gtk_signal_connect(GTK_OBJECT(window),
                       "destroy",
                       GTK_SIGNAL_FUNC(gtk_main_quit),
                       NULL);
    
    vbox=gtk_vbox_new(FALSE, 5);
    gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
    gtk_container_add(GTK_CONTAINER(window), vbox);
    gtk_widget_show(vbox);
    
    /* Create a scrolled window to pack the CList widget into */
    scrolled_window = gtk_scrolled_window_new (NULL, NULL);
    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
                                    GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);

    gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0);
    gtk_widget_show (scrolled_window);

    /* Create the CList. For this example we use 2 columns */
    clist = gtk_clist_new_with_titles( 2, titles);

    /* When a selection is made, we want to know about it. The callback
     * used is selection_made, and its code can be found further down */
    gtk_signal_connect(GTK_OBJECT(clist), "select_row",
                       GTK_SIGNAL_FUNC(selection_made),
                       NULL);

    /* It isn't necessary to shadow the border, but it looks nice :) */
    gtk_clist_set_shadow_type (GTK_CLIST(clist), GTK_SHADOW_OUT);

    /* What however is important, is that we set the column widths as
     * they will never be right otherwise. Note that the columns are
     * numbered from 0 and up (to 1 in this case).
     */
    gtk_clist_set_column_width (GTK_CLIST(clist), 0, 150);

    /* Add the CList widget to the vertical box and show it. */
    gtk_container_add(GTK_CONTAINER(scrolled_window), clist);
    gtk_widget_show(clist);

    /* Create the buttons and add them to the window. See the button
     * tutorial for more examples and comments on this.
     */
    hbox = gtk_hbox_new(FALSE, 0);
    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
    gtk_widget_show(hbox);

    button_add = gtk_button_new_with_label("Add List");
    button_clear = gtk_button_new_with_label("Clear List");
    button_hide_show = gtk_button_new_with_label("Hide/Show titles");

    gtk_box_pack_start(GTK_BOX(hbox), button_add, TRUE, TRUE, 0);
    gtk_box_pack_start(GTK_BOX(hbox), button_clear, TRUE, TRUE, 0);
    gtk_box_pack_start(GTK_BOX(hbox), button_hide_show, TRUE, TRUE, 0);

    /* Connect our callbacks to the three buttons */
    gtk_signal_connect_object(GTK_OBJECT(button_add), "clicked",
                              GTK_SIGNAL_FUNC(button_add_clicked),
                              (gpointer) clist);
    gtk_signal_connect_object(GTK_OBJECT(button_clear), "clicked",
                              GTK_SIGNAL_FUNC(button_clear_clicked),
                              (gpointer) clist);
    gtk_signal_connect_object(GTK_OBJECT(button_hide_show), "clicked",
                              GTK_SIGNAL_FUNC(button_hide_show_clicked),
                              (gpointer) clist);

    gtk_widget_show(button_add);
    gtk_widget_show(button_clear);
    gtk_widget_show(button_hide_show);

    /* The interface is completely set up so we show the window and
     * enter the gtk_main loop.
     */
    gtk_widget_show(window);
    gtk_main();
    
    return(0);
}
/* example-end */
</PRE>
</CODE></BLOCKQUOTE>
<P>
<HR>
<A HREF="gtk_tut-12.html">Next</A>
<A HREF="gtk_tut-10.html">Previous</A>
<A HREF="gtk_tut.html#toc11">Contents</A>
</BODY>
</HTML>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美视频在线| 亚洲一区二区黄色| 亚洲精品国产精华液| 日韩中文字幕一区二区三区| 国产99久久精品| 欧美一区二区视频网站| 亚洲人一二三区| 国产精品主播直播| 91精品久久久久久久久99蜜臂| 国产精品成人免费在线| 久久精品国产久精国产爱| 欧美网站大全在线观看| 国产精品区一区二区三区| 美女爽到高潮91| 欧美电影一区二区| 亚洲一区精品在线| 一本久久a久久免费精品不卡| 久久久国产一区二区三区四区小说| 日韩成人午夜电影| 91热门视频在线观看| 国产精品人人做人人爽人人添| 青青草一区二区三区| 欧美精品xxxxbbbb| 午夜欧美2019年伦理| 欧美色精品在线视频| 国产精品久久久久aaaa| 粉嫩嫩av羞羞动漫久久久| 精品福利在线导航| 成人妖精视频yjsp地址| 欧美一区二区在线免费播放 | 五月天视频一区| 色诱亚洲精品久久久久久| 国产日韩精品视频一区| 国产美女一区二区三区| 久久精品在线观看| 国产福利一区二区三区视频在线| 久久综合色8888| 激情综合色播激情啊| 日韩欧美一区二区视频| 美女视频黄 久久| 26uuu另类欧美亚洲曰本| 老汉av免费一区二区三区| 日韩女优av电影在线观看| 国产在线精品一区在线观看麻豆| 欧美α欧美αv大片| 精品无人码麻豆乱码1区2区 | 一区二区三区高清不卡| 欧亚洲嫩模精品一区三区| 亚洲一区二区成人在线观看| 欧洲一区二区av| 天天综合网天天综合色| 樱花影视一区二区| 欧美高清dvd| 美女视频免费一区| 欧美国产日韩在线观看| 99re视频精品| 天堂一区二区在线免费观看| 日韩欧美色综合| 懂色av一区二区三区免费看| 亚洲视频一区在线| 69堂成人精品免费视频| 国产麻豆成人精品| 亚洲欧美激情小说另类| 欧美日本一道本| 国产精品一二三四区| 亚洲黄色小视频| 精品sm在线观看| 色综合一区二区三区| 免费黄网站欧美| 国产精品免费视频网站| 在线播放亚洲一区| 成人国产视频在线观看| 日韩高清在线一区| 中文字幕在线一区免费| 日韩一区二区不卡| 日本高清不卡aⅴ免费网站| 免费成人小视频| 亚洲精品欧美激情| 久久久电影一区二区三区| 在线观看区一区二| 成人一道本在线| 久久成人av少妇免费| 亚洲欧美日韩一区二区| 26uuu国产一区二区三区| 欧洲av在线精品| 成人性生交大片免费看在线播放 | 久久久99久久| 欧美在线短视频| 国产91精品一区二区麻豆亚洲| 天天影视色香欲综合网老头| 中文字幕一区二区三区在线播放| 日韩亚洲欧美综合| 欧美日韩激情在线| 91在线视频免费观看| 国产一区二区0| 美日韩一级片在线观看| 午夜欧美一区二区三区在线播放| 国产精品麻豆欧美日韩ww| 日韩一级视频免费观看在线| 欧美日韩一区不卡| 91国在线观看| 91美女视频网站| 成人毛片老司机大片| 国产综合成人久久大片91| 视频一区视频二区在线观看| 一区二区三区中文字幕电影| 最新日韩在线视频| 国产精品久久久久7777按摩| 久久久久久毛片| xfplay精品久久| 欧美va在线播放| 日韩精品一区在线观看| 日韩一区二区三区四区五区六区| 欧美日韩的一区二区| 欧美日韩国产系列| 欧美精品在线一区二区| 在线不卡一区二区| 欧美老女人第四色| 欧美一区二区在线视频| 日韩久久久久久| 2020日本不卡一区二区视频| 久久网站最新地址| 欧美国产欧美综合| 国产精品久久久久久久久免费相片 | 欧美一区二区三区男人的天堂| 777亚洲妇女| 日韩欧美一区二区不卡| 欧美xxxxx牲另类人与| 欧美va亚洲va国产综合| 久久在线观看免费| 国产精品久久久久影院亚瑟 | 欧美精品一区二区三区蜜桃视频| 精品日韩在线观看| 国产精品麻豆欧美日韩ww| 亚洲精品水蜜桃| 午夜欧美在线一二页| 久久国产精品第一页| 丁香婷婷综合五月| 91久久精品一区二区二区| 在线播放亚洲一区| 国产目拍亚洲精品99久久精品| 国产精品每日更新| 婷婷国产在线综合| 国产乱一区二区| 在线免费观看不卡av| 欧美一区二区性放荡片| 欧美激情一区二区三区| 一区二区三区 在线观看视频| 美女高潮久久久| 99vv1com这只有精品| 91精品国产一区二区三区| 久久精品日韩一区二区三区| 一区二区在线观看视频| 麻豆一区二区在线| av在线不卡电影| 7777女厕盗摄久久久| 国产午夜精品理论片a级大结局| 亚洲欧美国产77777| 美国毛片一区二区| 色综合久久中文字幕综合网| 91精品国产综合久久久蜜臀图片| 日本一区二区三区dvd视频在线 | 亚洲欧洲av另类| 日日摸夜夜添夜夜添亚洲女人| 国产乱色国产精品免费视频| 欧美在线啊v一区| 国产精品乱人伦| 九九视频精品免费| 欧洲在线/亚洲| 国产精品午夜在线| 免费在线观看日韩欧美| 欧美伊人精品成人久久综合97| 国产亚洲成aⅴ人片在线观看| 亚洲成av人片在www色猫咪| av一二三不卡影片| 久久一夜天堂av一区二区三区| 亚洲午夜激情网站| 99热精品一区二区| 久久综合一区二区| 久久成人久久爱| 51精品秘密在线观看| 亚洲精选免费视频| 波多野结衣在线一区| 久久日韩粉嫩一区二区三区| 奇米四色…亚洲| 欧美日韩不卡一区二区| 亚洲精品视频免费观看| 丁香亚洲综合激情啪啪综合| 久久久久久亚洲综合影院红桃| 欧美a一区二区| 91麻豆精品国产91久久久资源速度 | 99久久久久久99| 久久久精品tv| 精品一区二区三区日韩| 欧美一区二区黄色| 日本欧美大码aⅴ在线播放| 欧美日韩国产在线观看| 成人综合婷婷国产精品久久蜜臀 | 久久亚洲精品小早川怜子| 一区二区欧美国产|