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

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

?? gtk_tut-31.html

?? GTK development guide
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
    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);
    
    /* This is the scrolled window to put the List widget inside */
    scrolled_window=gtk_scrolled_window_new(NULL, NULL);
    gtk_widget_set_usize(scrolled_window, 250, 150);
    gtk_container_add(GTK_CONTAINER(vbox), scrolled_window);
    gtk_widget_show(scrolled_window);
    
    /* Create thekList widget.
     * Connect the sigh_print_selection() signal handler
     * function to the "selection_changed" signal of the List
     * to print out the selected items each time the selection
     * has changed */
    gtklist=gtk_list_new();
    gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(scrolled_window),
                                           gtklist);
    gtk_widget_show(gtklist);
    gtk_signal_connect(GTK_OBJECT(gtklist),
                       "selection_changed",
                       GTK_SIGNAL_FUNC(sigh_print_selection),
                       NULL);
    
    /* We create a "Prison" to put a list item in ;) */
    frame=gtk_frame_new("Prison");
    gtk_widget_set_usize(frame, 200, 50);
    gtk_container_set_border_width(GTK_CONTAINER(frame), 5);
    gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT);
    gtk_container_add(GTK_CONTAINER(vbox), frame);
    gtk_widget_show(frame);
    
    /* Connect the sigh_button_event() signal handler to the List
     * which will handle the "arresting" of list items
     */
    gtk_signal_connect(GTK_OBJECT(gtklist),
                       "button_release_event",
                       GTK_SIGNAL_FUNC(sigh_button_event),
                       frame);
    
    /* Create a separator */
    separator=gtk_hseparator_new();
    gtk_container_add(GTK_CONTAINER(vbox), separator);
    gtk_widget_show(separator);
    
    /* Finally create a button and connect its "clicked" signal
     * to the destruction of the window */
    button=gtk_button_new_with_label("Close");
    gtk_container_add(GTK_CONTAINER(vbox), button);
    gtk_widget_show(button);
    gtk_signal_connect_object(GTK_OBJECT(button),
                              "clicked",
                              GTK_SIGNAL_FUNC(gtk_widget_destroy),
                              GTK_OBJECT(window));
    
    
    /* Now we create 5 list items, each having its own
     * label and add them to the List using gtk_container_add()
     * Also we query the text string from the label and
     * associate it with the list_item_data_key for each list item
     */
    for (i=0; i<5; i++) {
        GtkWidget       *label;
        gchar           *string;
        
        sprintf(buffer, "ListItemContainer with Label #%d", i);
        label=gtk_label_new(buffer);
        list_item=gtk_list_item_new();
        gtk_container_add(GTK_CONTAINER(list_item), label);
        gtk_widget_show(label);
        gtk_container_add(GTK_CONTAINER(gtklist), list_item);
        gtk_widget_show(list_item);
        gtk_label_get(GTK_LABEL(label), &string);
        gtk_object_set_data(GTK_OBJECT(list_item),
                            list_item_data_key,
                            string);
    }
    /* Here, we are creating another 5 labels, this time
     * we use gtk_list_item_new_with_label() for the creation
     * we can't query the text string from the label because
     * we don't have the labels pointer and therefore
     * we just associate the list_item_data_key of each
     * list item with the same text string.
     * For adding of the list items we put them all into a doubly
     * linked list (GList), and then add them by a single call to
     * gtk_list_append_items().
     * Because we use g_list_prepend() to put the items into the
     * doubly linked list, their order will be descending (instead
     * of ascending when using g_list_append())
     */
    dlist=NULL;
    for (; i<10; i++) {
        sprintf(buffer, "List Item with Label %d", i);
        list_item=gtk_list_item_new_with_label(buffer);
        dlist=g_list_prepend(dlist, list_item);
        gtk_widget_show(list_item);
        gtk_object_set_data(GTK_OBJECT(list_item),
                            list_item_data_key,
                            "ListItem with integrated Label");
    }
    gtk_list_append_items(GTK_LIST(gtklist), dlist);
    
    /* Finally we want to see the window, don't we? ;) */
    gtk_widget_show(window);
    
    /* Fire up the main event loop of gtk */
    gtk_main();
    
    /* We get here after gtk_main_quit() has been called which
     * happens if the main window gets destroyed
     */
    return(0);
}

/* This is the signal handler that got connected to button
 * press/release events of the List
 */
void sigh_button_event( GtkWidget      *gtklist,
                        GdkEventButton *event,
                        GtkWidget      *frame )
{
    /* We only do something if the third (rightmost mouse button
     * was released
     */
    if (event->type==GDK_BUTTON_RELEASE &&
        event->button==3) {
        GList           *dlist, *free_list;
        GtkWidget       *new_prisoner;
        
        /* Fetch the currently selected list item which
         * will be our next prisoner ;)
         */
        dlist=GTK_LIST(gtklist)->selection;
        if (dlist)
                new_prisoner=GTK_WIDGET(dlist->data);
        else
                new_prisoner=NULL;
        
        /* Look for already imprisoned list items, we
         * will put them back into the list.
         * Remember to free the doubly linked list that
         * gtk_container_children() returns
         */
        dlist=gtk_container_children(GTK_CONTAINER(frame));
        free_list=dlist;
        while (dlist) {
            GtkWidget       *list_item;
            
            list_item=dlist->data;
            
            gtk_widget_reparent(list_item, gtklist);
            
            dlist=dlist->next;
        }
        g_list_free(free_list);
        
        /* If we have a new prisoner, remove him from the
         * List and put him into the frame "Prison".
         * We need to unselect the item first.
         */
        if (new_prisoner) {
            GList   static_dlist;
            
            static_dlist.data=new_prisoner;
            static_dlist.next=NULL;
            static_dlist.prev=NULL;
            
            gtk_list_unselect_child(GTK_LIST(gtklist),
                                    new_prisoner);
            gtk_widget_reparent(new_prisoner, frame);
        }
    }
}

/* This is the signal handler that gets called if List
 * emits the "selection_changed" signal
 */
void sigh_print_selection( GtkWidget *gtklist,
                           gpointer   func_data )
{
    GList   *dlist;
    
    /* Fetch the doubly linked list of selected items
     * of the List, remember to treat this as read-only!
     */
    dlist=GTK_LIST(gtklist)->selection;
    
    /* If there are no selected items there is nothing more
     * to do than just telling the user so
     */
    if (!dlist) {
        g_print("Selection cleared\n");
        return;
    }
    /* Ok, we got a selection and so we print it
     */
    g_print("The selection is a ");
    
    /* Get the list item from the doubly linked list
     * and then query the data associated with list_item_data_key.
     * We then just print it */
    while (dlist) {
        GtkObject       *list_item;
        gchar           *item_data_string;
        
        list_item=GTK_OBJECT(dlist->data);
        item_data_string=gtk_object_get_data(list_item,
                                             list_item_data_key);
        g_print("%s ", item_data_string);
        
        dlist=dlist->next;
    }
    g_print("\n");
}
/* example-end */
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss31.4">31.4 List Item Widget</A>
</H2>

<P>The ListItem widget is designed to act as a container holding up to
one child, providing functions for selection/deselection just like the
List widget requires them for its children.
<P>A ListItem has its own window to receive events and has its own
background color which is usually white.
<P>As it is directly derived from an Item it can be treated as such by
using the GTK_ITEM(ListItem) macro, see the Item widget for more on
this. Usually a ListItem just holds a label to identify, e.g., a
filename within a List -- therefore the convenience function
gtk_list_item_new_with_label() is provided. The same effect can be
achieved by creating a Label on its own, setting its alignment to
xalign=0 and yalign=0.5 with a subsequent container addition to the
ListItem.
<P>As one is not forced to add a GtkLabel to a GtkListItem, you could
also add a GtkVBox or a GtkArrow etc. to the GtkListItem.
<P>
<H2><A NAME="ss31.5">31.5 Signals</A>
</H2>

<P>AkListItem does not create new signals on its own, but inherits
the signals of a Item.
<P>
<H2><A NAME="ss31.6">31.6 Functions</A>
</H2>

<P>
<BLOCKQUOTE><CODE>
<PRE>
guint gtk_list_item_get_type( void );
</PRE>
</CODE></BLOCKQUOTE>
<P>Returns the "GtkListItem" type identifier.
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkWidget *gtk_list_item_new( void );
</PRE>
</CODE></BLOCKQUOTE>
<P>Create a new ListItem object. The new widget is returned as a
pointer to a GtkWidget object. NULL is returned on failure.
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkWidget *gtk_list_item_new_with_label( gchar *label );
</PRE>
</CODE></BLOCKQUOTE>
<P>Create a new ListItem object, having a single GtkLabel as the sole
child. The new widget is returned as a pointer to a GtkWidget
object. NULL is returned on failure.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_list_item_select( GtkListItem *list_item );
</PRE>
</CODE></BLOCKQUOTE>
<P>This function is basically a wrapper around a call to gtk_item_select
(GTK_ITEM (list_item)) which will emit the select signal.  *Note
GtkItem::, for more info.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_list_item_deselect( GtkListItem *list_item );
</PRE>
</CODE></BLOCKQUOTE>
<P>This function is basically a wrapper around a call to
gtk_item_deselect (GTK_ITEM (list_item)) which will emit the deselect
signal.  *Note GtkItem::, for more info.
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkListItem *GTK_LIST_ITEM( gpointer obj );
</PRE>
</CODE></BLOCKQUOTE>
<P>Cast a generic pointer to "GtkListItem *".
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkListItemClass *GTK_LIST_ITEM_CLASS( gpointer class );
</PRE>
</CODE></BLOCKQUOTE>
<P>Cast a generic pointer to GtkListItemClass*. *Note Standard Macros::,
for more info.
<P>
<BLOCKQUOTE><CODE>
<PRE>
gint GTK_IS_LIST_ITEM( gpointer obj );
</PRE>
</CODE></BLOCKQUOTE>
<P>Determine if a generic pointer refers to a `GtkListItem' object.
*Note Standard Macros::, for more info.
<P>
<H2><A NAME="ss31.7">31.7 Example</A>
</H2>

<P>Please see the List example on this, which covers the usage of a
ListItem as well.
<P>
<P>
<HR>
Next
<A HREF="gtk_tut-30.html">Previous</A>
<A HREF="gtk_tut.html#toc31">Contents</A>
</BODY>
</HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美激情资源网| 久久久综合视频| 久久综合色婷婷| 亚洲激情校园春色| 成人午夜视频福利| 2024国产精品| 免费成人美女在线观看.| 色女孩综合影院| 国产精品入口麻豆原神| 伦理电影国产精品| 欧美久久免费观看| 亚洲第一会所有码转帖| 色偷偷成人一区二区三区91| 国产精品污网站| 国产精品一区二区黑丝| 精品国产一区二区在线观看| 日韩和欧美的一区| 欧美视频完全免费看| 亚洲欧美一区二区久久| 成人av中文字幕| 欧美国产欧美亚州国产日韩mv天天看完整| 美国十次了思思久久精品导航| 欧美在线三级电影| 亚洲午夜在线观看视频在线| 日本高清免费不卡视频| 亚洲黄色录像片| 在线观看区一区二| 亚洲国产欧美一区二区三区丁香婷| 99这里只有精品| 自拍视频在线观看一区二区| 不卡av电影在线播放| 国产精品传媒在线| 一本一本久久a久久精品综合麻豆| 椎名由奈av一区二区三区| 99久久免费精品高清特色大片| 日本一区二区三区在线观看| 大胆亚洲人体视频| 亚洲天堂成人在线观看| 91九色02白丝porn| 午夜激情一区二区| 精品国产成人在线影院| 久久国产免费看| 国产欧美日韩另类视频免费观看 | 日韩一区二区三区观看| 日日噜噜夜夜狠狠视频欧美人 | 国产福利一区二区| 日韩精品一区在线观看| 国产在线播放一区二区三区| 日本一区二区成人在线| 91色在线porny| 亚洲成av人片在线观看无码| 91精品国产麻豆国产自产在线 | 成人夜色视频网站在线观看| 亚洲日本护士毛茸茸| 欧美日韩一本到| 激情丁香综合五月| 亚洲色欲色欲www在线观看| 欧美色倩网站大全免费| 极品美女销魂一区二区三区免费| 国产亚洲欧美色| 欧美自拍丝袜亚洲| 精品一区二区在线看| 亚洲色图欧洲色图婷婷| 91精品婷婷国产综合久久性色| 国产美女精品一区二区三区| 综合激情成人伊人| 日韩久久久精品| 色综合久久久久| 国产一区二区三区在线观看免费| 国产精品麻豆久久久| 91精品国产乱码久久蜜臀| 成人性生交大片免费| 免费成人在线影院| 日韩理论电影院| www国产成人| 91高清视频免费看| 懂色中文一区二区在线播放| 亚洲国产精品久久艾草纯爱| 久久精品一区二区三区不卡牛牛| 91国产精品成人| 国产麻豆午夜三级精品| 亚洲成a天堂v人片| 国产精品欧美精品| 一区二区三区毛片| 久久久久久久久久美女| 欧美日韩国产一级二级| av午夜精品一区二区三区| 久久国产剧场电影| 亚洲成在线观看| 亚洲欧美日韩中文播放| 精品电影一区二区三区| 欧美年轻男男videosbes| 91女厕偷拍女厕偷拍高清| 国产精品亚洲一区二区三区妖精| 污片在线观看一区二区| 一区二区三区在线影院| 亚洲欧洲成人自拍| 久久久久久久久久电影| 精品电影一区二区| 日韩欧美中文字幕精品| 欧美三级蜜桃2在线观看| 9久草视频在线视频精品| 成人性生交大片| 国产.欧美.日韩| 国产91丝袜在线播放0| 国内成人精品2018免费看| 捆绑变态av一区二区三区| 日韩经典中文字幕一区| 日欧美一区二区| 青娱乐精品视频在线| 免费观看久久久4p| 美女脱光内衣内裤视频久久影院| 亚洲成人动漫一区| 亚洲国产成人av网| 性做久久久久久免费观看| 亚洲一区二区在线免费看| 一区二区三区产品免费精品久久75| 亚洲男人的天堂av| 亚洲一区二区精品视频| 天天综合色天天综合色h| 日韩av中文在线观看| 美女免费视频一区二区| 国精产品一区一区三区mba视频| 精品一区二区三区免费| 国产精品一卡二卡在线观看| 成人激情校园春色| 色综合色综合色综合色综合色综合| 一本色道**综合亚洲精品蜜桃冫| 色爱区综合激月婷婷| 欧美精品一二三| 欧美变态tickling挠脚心| 久久久久亚洲蜜桃| 国产精品久久久久影院| 亚洲国产综合人成综合网站| 日本不卡一区二区三区高清视频| 精品一区二区三区蜜桃| 成人91在线观看| 欧美精品在线观看一区二区| 亚洲精品一线二线三线无人区| 国产蜜臀97一区二区三区 | 色哟哟在线观看一区二区三区| 欧美在线高清视频| 日韩免费观看高清完整版| 国产欧美日韩在线看| 亚洲一区在线电影| 国产一区二区主播在线| 99久久综合色| 6080国产精品一区二区| 中文字幕av在线一区二区三区| 一区二区三区国产精品| 久久69国产一区二区蜜臀| 99久久国产综合精品色伊| 欧美一区在线视频| 中文字幕在线不卡视频| 午夜av一区二区三区| 成人免费高清在线| 欧美一区二区三区四区久久| 中文字幕一区二区在线播放| 日本美女一区二区三区视频| 成人18精品视频| 欧美一区二区播放| 亚洲免费观看高清| 国产宾馆实践打屁股91| 欧美日韩视频在线第一区| 国产日韩精品久久久| 日本在线不卡一区| 91免费视频观看| 久久精品一区八戒影视| 五月婷婷激情综合| 色婷婷综合视频在线观看| 亚洲无人区一区| 国产成人99久久亚洲综合精品| 欧美另类久久久品| 亚洲男人电影天堂| 成人午夜免费视频| 久久理论电影网| 麻豆91在线观看| 欧美二区乱c少妇| 亚洲自拍与偷拍| 91视频国产资源| 国产精品久99| 豆国产96在线|亚洲| 久久久久久久一区| 国产一区在线精品| 日韩美女在线视频| 免费xxxx性欧美18vr| 欧美欧美午夜aⅴ在线观看| 亚洲综合男人的天堂| 91丝袜呻吟高潮美腿白嫩在线观看| 久久九九久久九九| 国产在线精品一区二区不卡了| 在线播放欧美女士性生活| 亚洲1区2区3区4区| 欧美日韩不卡一区二区| 一区二区三区影院| 欧美在线免费视屏| 亚洲福利一二三区| 欧美日韩国产成人在线91| 亚洲成a人v欧美综合天堂| 欧美蜜桃一区二区三区|