1 2@c %start of fragment 3 4@deftp Class <gtk-list-store> 5Derives from @code{<gtk-tree-model>}, @code{<gtk-tree-sortable>}, 6@code{<gtk-buildable>}, @code{<gtk-tree-drag-dest>}, 7@code{<gtk-tree-drag-source>}, @code{<gobject>}. 8 9This class defines no direct slots. 10 11@end deftp 12 13@deffn Function gtk-list-store-new (types@tie{}@code{scm}) @result{}@tie{} (ret@tie{}@code{<gtk-list-store>}) 14Creates a new list store as with @var{n-columns} columns each of the types 15passed in. Note that only types derived from standard GObject fundamental types 16are supported. 17 18As an example, @samp{gtk_tree_store_new (3, G_TYPE_INT, G_TYPE_STRING, 19GDK_TYPE_PIXBUF);} will create a new @code{<gtk-list-store>} with three columns, 20of type int, string and @code{<gdk-pixbuf>} respectively. 21 22@table @var 23@item n-columns 24number of columns in the list store 25 26@item ... 27all @code{<g-type>} types for the columns, from first to last 28 29@item ret 30a new @code{<gtk-list-store>} 31 32@end table 33 34@end deffn 35 36@deffn Function gtk-list-store-set-value (self@tie{}@code{<gtk-list-store>}) (iter@tie{}@code{<gtk-tree-iter>}) (column@tie{}@code{int}) (value@tie{}@code{scm}) 37@deffnx Method set-value 38Sets the data in the cell specified by @var{iter} and @var{column}. The type of 39@var{value} must be convertible to the type of the column. 40 41@table @var 42@item list-store 43A @code{<gtk-list-store>} 44 45@item iter 46A valid @code{<gtk-tree-iter>} for the row being modified 47 48@item column 49column number to modify 50 51@item value 52new value for the cell 53 54@end table 55 56@end deffn 57 58@deffn Function gtk-list-store-remove (self@tie{}@code{<gtk-list-store>}) (iter@tie{}@code{<gtk-tree-iter>}) @result{}@tie{} (ret@tie{}@code{<gtk-tree-iter>}) 59@deffnx Method remove 60Removes the given row from the list store. After being removed, @var{iter} is 61set to be the next valid row, or invalidated if it pointed to the last row in 62@var{list-store}. 63 64@table @var 65@item list-store 66A @code{<gtk-list-store>} 67 68@item iter 69A valid @code{<gtk-tree-iter>} 70 71@item ret 72@samp{@code{#t}} if @var{iter} is valid, @samp{@code{#f}} if not. 73 74@end table 75 76@end deffn 77 78@deffn Function gtk-list-store-insert (self@tie{}@code{<gtk-list-store>}) (position@tie{}@code{int}) @result{}@tie{} (ret@tie{}@code{<gtk-tree-iter>}) 79@deffnx Method insert 80Creates a new row at @var{position}. @var{iter} will be changed to point to this 81new row. If @var{position} is larger than the number of rows on the list, then 82the new row will be appended to the list. The row will be empty after this 83function is called. To fill in values, you need to call 84@code{gtk-list-store-set} or @code{gtk-list-store-set-value}. 85 86@table @var 87@item list-store 88A @code{<gtk-list-store>} 89 90@item iter 91An unset @code{<gtk-tree-iter>} to set to the new row 92 93@item position 94position to insert the new row 95 96@end table 97 98@end deffn 99 100@deffn Function gtk-list-store-insert-before (self@tie{}@code{<gtk-list-store>}) (sibling@tie{}@code{<gtk-tree-iter>}) @result{}@tie{} (ret@tie{}@code{<gtk-tree-iter>}) 101@deffnx Method insert-before 102Inserts a new row before @var{sibling}. If @var{sibling} is @samp{@code{#f}}, 103then the row will be appended to the end of the list. @var{iter} will be changed 104to point to this new row. The row will be empty after this function is called. 105To fill in values, you need to call @code{gtk-list-store-set} or 106@code{gtk-list-store-set-value}. 107 108@table @var 109@item list-store 110A @code{<gtk-list-store>} 111 112@item iter 113An unset @code{<gtk-tree-iter>} to set to the new row 114 115@item sibling 116A valid @code{<gtk-tree-iter>}, or @samp{@code{#f}} 117 118@end table 119 120@end deffn 121 122@deffn Function gtk-list-store-insert-after (self@tie{}@code{<gtk-list-store>}) (sibling@tie{}@code{<gtk-tree-iter>}) @result{}@tie{} (ret@tie{}@code{<gtk-tree-iter>}) 123@deffnx Method insert-after 124Inserts a new row after @var{sibling}. If @var{sibling} is @samp{@code{#f}}, 125then the row will be prepended to the beginning of the list. @var{iter} will be 126changed to point to this new row. The row will be empty after this function is 127called. To fill in values, you need to call @code{gtk-list-store-set} or 128@code{gtk-list-store-set-value}. 129 130@table @var 131@item list-store 132A @code{<gtk-list-store>} 133 134@item iter 135An unset @code{<gtk-tree-iter>} to set to the new row 136 137@item sibling 138A valid @code{<gtk-tree-iter>}, or @samp{@code{#f}} 139 140@end table 141 142@end deffn 143 144@deffn Function gtk-list-store-prepend (self@tie{}@code{<gtk-list-store>}) @result{}@tie{} (ret@tie{}@code{<gtk-tree-iter>}) 145@deffnx Method prepend 146Prepends a new row to @var{list-store}. @var{iter} will be changed to point to 147this new row. The row will be empty after this function is called. To fill in 148values, you need to call @code{gtk-list-store-set} or 149@code{gtk-list-store-set-value}. 150 151@table @var 152@item list-store 153A @code{<gtk-list-store>} 154 155@item iter 156An unset @code{<gtk-tree-iter>} to set to the prepend row 157 158@end table 159 160@end deffn 161 162@deffn Function gtk-list-store-append (self@tie{}@code{<gtk-list-store>}) @result{}@tie{} (ret@tie{}@code{<gtk-tree-iter>}) 163@deffnx Method append 164Appends a new row to @var{list-store}. @var{iter} will be changed to point to 165this new row. The row will be empty after this function is called. To fill in 166values, you need to call @code{gtk-list-store-set} or 167@code{gtk-list-store-set-value}. 168 169@table @var 170@item list-store 171A @code{<gtk-list-store>} 172 173@item iter 174An unset @code{<gtk-tree-iter>} to set to the appended row 175 176@end table 177 178@end deffn 179 180@deffn Function gtk-list-store-clear (self@tie{}@code{<gtk-list-store>}) 181@deffnx Method clear 182Removes all rows from the list store. 183 184@table @var 185@item list-store 186a @code{<gtk-list-store>}. 187 188@end table 189 190@end deffn 191 192@deffn Function gtk-list-store-iter-is-valid (self@tie{}@code{<gtk-list-store>}) (iter@tie{}@code{<gtk-tree-iter>}) @result{}@tie{} (ret@tie{}@code{bool}) 193@deffnx Method iter-is-valid 194@c (warning "This function is slow. Only use it for debugging and/or testing 195purposes.") 196 197Checks if the given iter is a valid iter for this @code{<gtk-list-store>}. 198 199@table @var 200@item list-store 201A @code{<gtk-list-store>}. 202 203@item iter 204A @code{<gtk-tree-iter>}. 205 206@item ret 207@samp{@code{#t}} if the iter is valid, @samp{@code{#f}} if the iter is invalid. 208 209@end table 210 211Since 2.2 212 213@end deffn 214 215@deffn Function gtk-list-store-reorder (self@tie{}@code{<gtk-list-store>}) @result{}@tie{} (new_order@tie{}@code{int}) 216@deffnx Method reorder 217Reorders @var{store} to follow the order indicated by @var{new-order}. Note that 218this function only works with unsorted stores. 219 220@table @var 221@item store 222A @code{<gtk-list-store>}. 223 224@item new-order 225an array of integers mapping the new position of each child to its old position 226before the re-ordering, i.e. @var{new-order}@samp{[newpos] = oldpos}. 227 228@end table 229 230Since 2.2 231 232@end deffn 233 234@deffn Function gtk-list-store-swap (self@tie{}@code{<gtk-list-store>}) (a@tie{}@code{<gtk-tree-iter>}) (b@tie{}@code{<gtk-tree-iter>}) 235@deffnx Method swap 236Swaps @var{a} and @var{b} in @var{store}. Note that this function only works 237with unsorted stores. 238 239@table @var 240@item store 241A @code{<gtk-list-store>}. 242 243@item a 244A @code{<gtk-tree-iter>}. 245 246@item b 247Another @code{<gtk-tree-iter>}. 248 249@end table 250 251Since 2.2 252 253@end deffn 254 255@deffn Function gtk-list-store-move-before (self@tie{}@code{<gtk-list-store>}) (iter@tie{}@code{<gtk-tree-iter>}) (position@tie{}@code{<gtk-tree-iter>}) 256@deffnx Method move-before 257Moves @var{iter} in @var{store} to the position before @var{position}. Note that 258this function only works with unsorted stores. If @var{position} is 259@samp{@code{#f}}, @var{iter} will be moved to the end of the list. 260 261@table @var 262@item store 263A @code{<gtk-list-store>}. 264 265@item iter 266A @code{<gtk-tree-iter>}. 267 268@item position 269A @code{<gtk-tree-iter>}, or @samp{@code{#f}}. 270 271@end table 272 273Since 2.2 274 275@end deffn 276 277@deffn Function gtk-list-store-move-after (self@tie{}@code{<gtk-list-store>}) (iter@tie{}@code{<gtk-tree-iter>}) (position@tie{}@code{<gtk-tree-iter>}) 278@deffnx Method move-after 279Moves @var{iter} in @var{store} to the position after @var{position}. Note that 280this function only works with unsorted stores. If @var{position} is 281@samp{@code{#f}}, @var{iter} will be moved to the start of the list. 282 283@table @var 284@item store 285A @code{<gtk-list-store>}. 286 287@item iter 288A @code{<gtk-tree-iter>}. 289 290@item position 291A @code{<gtk-tree-iter>} or @samp{@code{#f}}. 292 293@end table 294 295Since 2.2 296 297@end deffn 298 299 300@c %end of fragment 301