⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sec-gtklistfunctions.html

📁 gtk 开发手册和参考文档。 包括gtk glib gdk等
💻 HTML
字号:
<HTML><HEAD><TITLE>Functions</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.49"><LINKREL="HOME"TITLE="GTK+ 1.2 Tutorial"HREF="gtk-tut.html"><LINKREL="UP"TITLE="List Widget"HREF="app-listwidget.html"><LINKREL="PREVIOUS"TITLE="List Widget"HREF="app-listwidget.html"><LINKREL="NEXT"TITLE="Example"HREF="sec-gtklistexample.html"></HEAD></head><body bgcolor="#FFFFFF" marginheight=0 marginwidth=0 width="100%"><table cellspacing=6 border=0 cellpadding=0 width="100%">  <tr>    <td bgcolor="#FFFFFF" valign=top nowrap>    <centeR><A HREF="/"><img src="/images/gtk-logo-rgb.gif" width=107 height=140 border=0></A>      <font face="helvetica,lucidia" color="#000000"><BR><BR><b>GTK+<BR>The GIMP Toolkit</b></center><BR><table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B>General</B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="/">Introduction</A><BR><A HREF="/screenshots/">Screenshots</A><br><A HREF="/download/">Download</A><br><A HREF="/mailinglists.html">Mailing Lists</A><BR><A HREF="/bindings.html">Language Bindings</A><BR><A HREF="http://gtk.themes.org/">Themes</A><BR><A HREF="/bugs.html">Bug Tracker</A><BR></td></tr></table></td></tr></table><BR>  <table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B>Documentation</B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="/faq/">FAQ</A><br><A HREF="/tutorial/">Tutorial</A><BR><A HREF="/api/">API Reference</A><br><A HREF="/books.html">Published Books</A><BR></td></tr></table></td></tr></table><BR>  <table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B>Projects</B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="http://www.pango.org/">Pango</A><BR><A HREF="http://sources.redhat.com/inti/">Inti</A><BR><A HREF="http://www.gnome.org/">GNOME</A><BR><A HREF="http://user.sgic.fi/~tml/gimp/win32/">GTK+ for Win32</A><br><A HREF="http://people.redhat.com/sopwith/gtkfb/">GtkFB (Framebuffer)</A><br><A HREF="http://www.directfb.org/gtk.xml">GTK+ on DirectFB</A><BR><A HREF="/beos/">GTK+ for BeOS</A></td></tr></table></td></tr></table><BR>  <table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B><B>Applications</B></B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="http://www.gimp.org/">GIMP</A><BR><A HREF="http://www.abiword.org/">Abiword</A><BR><A HREF="http://www.lysator.liu.se/~alla/dia/dia.html">Dia</A><BR><A HREF="http://glade.pn.org/">Glade</A><BR><A HREF="http://www.gnucash.org/">GnuCash</A><BR><A HREF="http://www.gnome.org/projects/gnumeric/">Gnumeric</A><BR><BR><A HREF="http://www.gnome.org/applist/">GNOME Software Map</A><br></td></tr></table></td></tr></table><BR>      </td>  <td bgcolor="#ffffff" valign=top width="99%"><font face="lucida,helvetica"><BODYCLASS="SECT1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">GTK+ 1.2 Tutorial</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="app-listwidget.html">&#60;&#60;&#60; Previous</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Appendix D. List Widget</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="sec-gtklistexample.html">Next &#62;&#62;&#62;</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="SEC-GTKLISTFUNCTIONS">D.2. Functions</A></H1><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">guint gtk_list_get_type( void );</PRE></TD></TR></TABLE><P>Returns the "GtkList" type identifier.</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">GtkWidget *gtk_list_new( void );</PRE></TD></TR></TABLE><P>Create a new List object. The new widget is returned as a pointerto a GtkWidget object. NULL is returned on failure.</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_list_insert_items( GtkList *list,                            GList   *items,                            gint     position );</PRE></TD></TR></TABLE><P>Insert list items into the list, starting at <TTCLASS="LITERAL">position</TT>.<TTCLASS="LITERAL">items</TT> is a doubly linked list where each nodes data pointer isexpected to point to a newly created ListItem. The GList nodes of<TTCLASS="LITERAL">items</TT> are taken over by the list.</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_list_append_items( GtkList *list,                            GList   *items);</PRE></TD></TR></TABLE><P>Insert list items just like gtk_list_insert_items() at the end of thelist. The GList nodes of <TTCLASS="LITERAL">items</TT> are taken over by the list.</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_list_prepend_items( GtkList *list,                             GList   *items);</PRE></TD></TR></TABLE><P>Insert list items just like gtk_list_insert_items() at the verybeginning of the list. The GList nodes of <TTCLASS="LITERAL">items</TT> are taken over bythe list.</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_list_remove_items( GtkList *list,                            GList   *items);</PRE></TD></TR></TABLE><P>Remove list items from the list. <TTCLASS="LITERAL">items</TT> is a doubly linked listwhere each nodes data pointer is expected to point to a direct childof list. It is the callers responsibility to make a call tog_list_free(items) afterwards. Also the caller has to destroy the listitems himself.</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_list_clear_items( GtkList *list,                           gint start,                           gint end );</PRE></TD></TR></TABLE><P>Remove and destroy list items from the list. A widget is affected ifits current position within the list is in the range specified by<TTCLASS="LITERAL">start</TT> and <TTCLASS="LITERAL">end</TT>.</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_list_select_item( GtkList *list,                           gint     item );</PRE></TD></TR></TABLE><P>Invoke the select_child signal for a list item specified through itscurrent position within the list.</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_list_unselect_item( GtkList *list,                             gint     item);</PRE></TD></TR></TABLE><P>Invoke the unselect_child signal for a list item specified through itscurrent position within the list.</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_list_select_child( GtkList *list,                            GtkWidget *child);</PRE></TD></TR></TABLE><P>Invoke the select_child signal for the specified child.</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_list_unselect_child( GtkList   *list,                              GtkWidget *child);</PRE></TD></TR></TABLE><P>Invoke the unselect_child signal for the specified child.</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">gint gtk_list_child_position( GtkList *list,                              GtkWidget *child);</PRE></TD></TR></TABLE><P>Return the position of <TTCLASS="LITERAL">child</TT> within the list. "-1" is returned onfailure.</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_list_set_selection_mode( GtkList         *list,                                  GtkSelectionMode mode );</PRE></TD></TR></TABLE><P>Set the selection mode MODE which can be of GTK_SELECTION_SINGLE,GTK_SELECTION_BROWSE, GTK_SELECTION_MULTIPLE orGTK_SELECTION_EXTENDED.</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">GtkList *GTK_LIST( gpointer obj );</PRE></TD></TR></TABLE><P>Cast a generic pointer to "GtkList *".</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">GtkListClass *GTK_LIST_CLASS( gpointer class);</PRE></TD></TR></TABLE><P>Cast a generic pointer to "GtkListClass *". </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">gint GTK_IS_LIST( gpointer obj);</PRE></TD></TR></TABLE><P>Determine if a generic pointer refers to a "GtkList" object.</P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="app-listwidget.html">&#60;&#60;&#60; Previous</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="gtk-tut.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="sec-gtklistexample.html">Next &#62;&#62;&#62;</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">List Widget</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="app-listwidget.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Example</TD></TR></TABLE></DIV>        </td>    </tr></table>  </td>  </tr></table></body></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -