1
2@c %start of fragment
3
4@deftp Class <gtk-icon-view>
5Derives from @code{<gtk-cell-layout>}, @code{<gtk-container>}.
6
7This class defines the following slots:
8
9@table @code
10@item pixbuf-column
11Model column used to retrieve the icon pixbuf from
12
13@item text-column
14Model column used to retrieve the text from
15
16@item markup-column
17Model column used to retrieve the text if using Pango markup
18
19@item selection-mode
20The selection mode
21
22@item orientation
23How the text and icon of each item are positioned relative to each other
24
25@item model
26The model for the icon view
27
28@item columns
29Number of columns to display
30
31@item item-width
32The width used for each item
33
34@item spacing
35Space which is inserted between cells of an item
36
37@item row-spacing
38Space which is inserted between grid rows
39
40@item column-spacing
41Space which is inserted between grid columns
42
43@item margin
44Space which is inserted at the edges of the icon view
45
46@item reorderable
47View is reorderable
48
49@item tooltip-column
50The column in the model containing the tooltip texts for the items
51
52@end table
53
54@end deftp
55
56@defop Signal <gtk-icon-view> move-cursor  (arg0@tie{}@code{<gtk-movement-step>}) (arg1@tie{}@code{<gint>}) @result{}@tie{}@code{<gboolean>}
57@end defop
58
59@defop Signal <gtk-icon-view> selection-changed
60@end defop
61
62@defop Signal <gtk-icon-view> set-scroll-adjustments  (arg0@tie{}@code{<gtk-adjustment>}) (arg1@tie{}@code{<gtk-adjustment>})
63@end defop
64
65@defop Signal <gtk-icon-view> item-activated  (arg0@tie{}@code{<gtk-tree-path>})
66@end defop
67
68@defop Signal <gtk-icon-view> select-all
69@end defop
70
71@defop Signal <gtk-icon-view> unselect-all
72@end defop
73
74@defop Signal <gtk-icon-view> select-cursor-item
75@end defop
76
77@defop Signal <gtk-icon-view> toggle-cursor-item
78@end defop
79
80@defop Signal <gtk-icon-view> activate-cursor-item  @result{}@tie{}@code{<gboolean>}
81@end defop
82
83@deffn Function gtk-icon-view-new  @result{}@tie{} (ret@tie{}@code{<gtk-widget>})
84Creates a new @code{<gtk-icon-view>} widget
85
86@table @var
87@item ret
88A newly created @code{<gtk-icon-view>} widget
89
90@end table
91
92Since 2.6
93
94@end deffn
95
96@deffn Function gtk-icon-view-new-with-model  (model@tie{}@code{<gtk-tree-model>}) @result{}@tie{} (ret@tie{}@code{<gtk-widget>})
97Creates a new @code{<gtk-icon-view>} widget with the model @var{model}.
98
99@table @var
100@item model
101The model.
102
103@item ret
104A newly created @code{<gtk-icon-view>} widget.
105
106@end table
107
108Since 2.6
109
110@end deffn
111
112@deffn Function gtk-icon-view-set-model  (self@tie{}@code{<gtk-icon-view>}) (model@tie{}@code{<gtk-tree-model>})
113@deffnx Method set-model
114Sets the model for a @code{<gtk-icon-view>}. If the @var{icon-view} already has
115a model set, it will remove it before setting the new model. If @var{model} is
116@samp{@code{#f}}, then it will unset the old model.
117
118@table @var
119@item icon-view
120A @code{<gtk-icon-view>}.
121
122@item model
123The model.
124
125@end table
126
127Since 2.6
128
129@end deffn
130
131@deffn Function gtk-icon-view-get-model  (self@tie{}@code{<gtk-icon-view>}) @result{}@tie{} (ret@tie{}@code{<gtk-tree-model>})
132@deffnx Method get-model
133Returns the model the @code{<gtk-icon-view>} is based on. Returns
134@samp{@code{#f}} if the model is unset.
135
136@table @var
137@item icon-view
138a @code{<gtk-icon-view>}
139
140@item ret
141A @code{<gtk-tree-model>}, or @samp{@code{#f}} if none is currently being used.
142
143@end table
144
145Since 2.6
146
147@end deffn
148
149@deffn Function gtk-icon-view-set-text-column  (self@tie{}@code{<gtk-icon-view>}) (column@tie{}@code{int})
150@deffnx Method set-text-column
151Sets the column with text for @var{icon-view} to be @var{column}. The text
152column must be of type @code{<g-type-string>}.
153
154@table @var
155@item icon-view
156A @code{<gtk-icon-view>}.
157
158@item column
159A column in the currently used model.
160
161@end table
162
163Since 2.6
164
165@end deffn
166
167@deffn Function gtk-icon-view-get-text-column  (self@tie{}@code{<gtk-icon-view>}) @result{}@tie{} (ret@tie{}@code{int})
168@deffnx Method get-text-column
169Returns the column with text for @var{icon-view}.
170
171@table @var
172@item icon-view
173A @code{<gtk-icon-view>}.
174
175@item ret
176the text column, or -1 if it's unset.
177
178@end table
179
180Since 2.6
181
182@end deffn
183
184@deffn Function gtk-icon-view-set-markup-column  (self@tie{}@code{<gtk-icon-view>}) (column@tie{}@code{int})
185@deffnx Method set-markup-column
186Sets the column with markup information for @var{icon-view} to be @var{column}.
187The markup column must be of type @code{<g-type-string>}. If the markup column
188is set to something, it overrides the text column set by
189@code{gtk-icon-view-set-text-column}.
190
191@table @var
192@item icon-view
193A @code{<gtk-icon-view>}.
194
195@item column
196A column in the currently used model.
197
198@end table
199
200Since 2.6
201
202@end deffn
203
204@deffn Function gtk-icon-view-get-markup-column  (self@tie{}@code{<gtk-icon-view>}) @result{}@tie{} (ret@tie{}@code{int})
205@deffnx Method get-markup-column
206Returns the column with markup text for @var{icon-view}.
207
208@table @var
209@item icon-view
210A @code{<gtk-icon-view>}.
211
212@item ret
213the markup column, or -1 if it's unset.
214
215@end table
216
217Since 2.6
218
219@end deffn
220
221@deffn Function gtk-icon-view-set-pixbuf-column  (self@tie{}@code{<gtk-icon-view>}) (column@tie{}@code{int})
222@deffnx Method set-pixbuf-column
223Sets the column with pixbufs for @var{icon-view} to be @var{column}. The pixbuf
224column must be of type @code{<gdk-type-pixbuf>}
225
226@table @var
227@item icon-view
228A @code{<gtk-icon-view>}.
229
230@item column
231A column in the currently used model.
232
233@end table
234
235Since 2.6
236
237@end deffn
238
239@deffn Function gtk-icon-view-get-pixbuf-column  (self@tie{}@code{<gtk-icon-view>}) @result{}@tie{} (ret@tie{}@code{int})
240@deffnx Method get-pixbuf-column
241Returns the column with pixbufs for @var{icon-view}.
242
243@table @var
244@item icon-view
245A @code{<gtk-icon-view>}.
246
247@item ret
248the pixbuf column, or -1 if it's unset.
249
250@end table
251
252Since 2.6
253
254@end deffn
255
256@deffn Function gtk-icon-view-get-path-at-pos  (self@tie{}@code{<gtk-icon-view>}) (x@tie{}@code{int}) (y@tie{}@code{int}) @result{}@tie{} (ret@tie{}@code{<gtk-tree-path>})
257@deffnx Method get-path-at-pos
258Finds the path at the point (@var{x}, @var{y}), relative to widget coordinates.
259See @code{gtk-icon-view-get-item-at-pos}, if you are also interested in the cell
260at the specified position.
261
262@table @var
263@item icon-view
264A @code{<gtk-icon-view>}.
265
266@item x
267The x position to be identified
268
269@item y
270The y position to be identified
271
272@item ret
273The @code{<gtk-tree-path>} corresponding to the icon or @samp{@code{#f}} if no
274icon exists at that position.
275
276@end table
277
278Since 2.6
279
280@end deffn
281
282@deffn Function gtk-icon-view-set-cursor  (self@tie{}@code{<gtk-icon-view>}) (path@tie{}@code{<gtk-tree-path>}) (cell@tie{}@code{<gtk-cell-renderer>}) (start_editing@tie{}@code{bool})
283@deffnx Method set-cursor
284Sets the current keyboard focus to be at @var{path}, and selects it. This is
285useful when you want to focus the user's attention on a particular item. If
286@var{cell} is not @samp{@code{#f}}, then focus is given to the cell specified by
287it. Additionally, if @var{start-editing} is @samp{@code{#t}}, then editing
288should be started in the specified cell.
289
290This function is often followed by @samp{gtk_widget_grab_focus (icon_view)} in
291order to give keyboard focus to the widget. Please note that editing can only
292happen when the widget is realized.
293
294@table @var
295@item icon-view
296A @code{<gtk-icon-view>}
297
298@item path
299A @code{<gtk-tree-path>}
300
301@item cell
302One of the cell renderers of @var{icon-view}, or @samp{@code{#f}}
303
304@item start-editing
305@samp{@code{#t}} if the specified cell should start being edited.
306
307@end table
308
309Since 2.8
310
311@end deffn
312
313@deffn Function gtk-icon-view-set-selection-mode  (self@tie{}@code{<gtk-icon-view>}) (mode@tie{}@code{<gtk-selection-mode>})
314@deffnx Method set-selection-mode
315Sets the selection mode of the @var{icon-view}.
316
317@table @var
318@item icon-view
319A @code{<gtk-icon-view>}.
320
321@item mode
322The selection mode
323
324@end table
325
326Since 2.6
327
328@end deffn
329
330@deffn Function gtk-icon-view-get-selection-mode  (self@tie{}@code{<gtk-icon-view>}) @result{}@tie{} (ret@tie{}@code{<gtk-selection-mode>})
331@deffnx Method get-selection-mode
332Gets the selection mode of the @var{icon-view}.
333
334@table @var
335@item icon-view
336A @code{<gtk-icon-view>}.
337
338@item ret
339the current selection mode
340
341@end table
342
343Since 2.6
344
345@end deffn
346
347@deffn Function gtk-icon-view-set-orientation  (self@tie{}@code{<gtk-icon-view>}) (orientation@tie{}@code{<gtk-orientation>})
348@deffnx Method set-orientation
349Sets the ::orientation property which determines whether the labels are drawn
350beside the icons instead of below.
351
352@table @var
353@item icon-view
354a @code{<gtk-icon-view>}
355
356@item orientation
357the relative position of texts and icons
358
359@end table
360
361Since 2.6
362
363@end deffn
364
365@deffn Function gtk-icon-view-get-orientation  (self@tie{}@code{<gtk-icon-view>}) @result{}@tie{} (ret@tie{}@code{<gtk-orientation>})
366@deffnx Method get-orientation
367Returns the value of the ::orientation property which determines whether the
368labels are drawn beside the icons instead of below.
369
370@table @var
371@item icon-view
372a @code{<gtk-icon-view>}
373
374@item ret
375the relative position of texts and icons
376
377@end table
378
379Since 2.6
380
381@end deffn
382
383@deffn Function gtk-icon-view-set-columns  (self@tie{}@code{<gtk-icon-view>}) (columns@tie{}@code{int})
384@deffnx Method set-columns
385Sets the ::columns property which determines in how many columns the icons are
386arranged. If @var{columns} is -1, the number of columns will be chosen
387automatically to fill the available area.
388
389@table @var
390@item icon-view
391a @code{<gtk-icon-view>}
392
393@item columns
394the number of columns
395
396@end table
397
398Since 2.6
399
400@end deffn
401
402@deffn Function gtk-icon-view-get-columns  (self@tie{}@code{<gtk-icon-view>}) @result{}@tie{} (ret@tie{}@code{int})
403@deffnx Method get-columns
404Returns the value of the ::columns property.
405
406@table @var
407@item icon-view
408a @code{<gtk-icon-view>}
409
410@item ret
411the number of columns, or -1
412
413@end table
414
415Since 2.6
416
417@end deffn
418
419@deffn Function gtk-icon-view-set-item-width  (self@tie{}@code{<gtk-icon-view>}) (item_width@tie{}@code{int})
420@deffnx Method set-item-width
421Sets the ::item-width property which specifies the width to use for each item.
422If it is set to -1, the icon view will automatically determine a suitable item
423size.
424
425@table @var
426@item icon-view
427a @code{<gtk-icon-view>}
428
429@item item-width
430the width for each item
431
432@end table
433
434Since 2.6
435
436@end deffn
437
438@deffn Function gtk-icon-view-get-item-width  (self@tie{}@code{<gtk-icon-view>}) @result{}@tie{} (ret@tie{}@code{int})
439@deffnx Method get-item-width
440Returns the value of the ::item-width property.
441
442@table @var
443@item icon-view
444a @code{<gtk-icon-view>}
445
446@item ret
447the width of a single item, or -1
448
449@end table
450
451Since 2.6
452
453@end deffn
454
455@deffn Function gtk-icon-view-set-spacing  (self@tie{}@code{<gtk-icon-view>}) (spacing@tie{}@code{int})
456@deffnx Method set-spacing
457Sets the ::spacing property which specifies the space which is inserted between
458the cells (i.e. the icon and the text) of an item.
459
460@table @var
461@item icon-view
462a @code{<gtk-icon-view>}
463
464@item spacing
465the spacing
466
467@end table
468
469Since 2.6
470
471@end deffn
472
473@deffn Function gtk-icon-view-get-spacing  (self@tie{}@code{<gtk-icon-view>}) @result{}@tie{} (ret@tie{}@code{int})
474@deffnx Method get-spacing
475Returns the value of the ::spacing property.
476
477@table @var
478@item icon-view
479a @code{<gtk-icon-view>}
480
481@item ret
482the space between cells
483
484@end table
485
486Since 2.6
487
488@end deffn
489
490@deffn Function gtk-icon-view-set-row-spacing  (self@tie{}@code{<gtk-icon-view>}) (row_spacing@tie{}@code{int})
491@deffnx Method set-row-spacing
492Sets the ::row-spacing property which specifies the space which is inserted
493between the rows of the icon view.
494
495@table @var
496@item icon-view
497a @code{<gtk-icon-view>}
498
499@item row-spacing
500the row spacing
501
502@end table
503
504Since 2.6
505
506@end deffn
507
508@deffn Function gtk-icon-view-get-row-spacing  (self@tie{}@code{<gtk-icon-view>}) @result{}@tie{} (ret@tie{}@code{int})
509@deffnx Method get-row-spacing
510Returns the value of the ::row-spacing property.
511
512@table @var
513@item icon-view
514a @code{<gtk-icon-view>}
515
516@item ret
517the space between rows
518
519@end table
520
521Since 2.6
522
523@end deffn
524
525@deffn Function gtk-icon-view-set-column-spacing  (self@tie{}@code{<gtk-icon-view>}) (column_spacing@tie{}@code{int})
526@deffnx Method set-column-spacing
527Sets the ::column-spacing property which specifies the space which is inserted
528between the columns of the icon view.
529
530@table @var
531@item icon-view
532a @code{<gtk-icon-view>}
533
534@item column-spacing
535the column spacing
536
537@end table
538
539Since 2.6
540
541@end deffn
542
543@deffn Function gtk-icon-view-get-column-spacing  (self@tie{}@code{<gtk-icon-view>}) @result{}@tie{} (ret@tie{}@code{int})
544@deffnx Method get-column-spacing
545Returns the value of the ::column-spacing property.
546
547@table @var
548@item icon-view
549a @code{<gtk-icon-view>}
550
551@item ret
552the space between columns
553
554@end table
555
556Since 2.6
557
558@end deffn
559
560@deffn Function gtk-icon-view-set-margin  (self@tie{}@code{<gtk-icon-view>}) (margin@tie{}@code{int})
561@deffnx Method set-margin
562Sets the ::margin property which specifies the space which is inserted at the
563top, bottom, left and right of the icon view.
564
565@table @var
566@item icon-view
567a @code{<gtk-icon-view>}
568
569@item margin
570the margin
571
572@end table
573
574Since 2.6
575
576@end deffn
577
578@deffn Function gtk-icon-view-get-margin  (self@tie{}@code{<gtk-icon-view>}) @result{}@tie{} (ret@tie{}@code{int})
579@deffnx Method get-margin
580Returns the value of the ::margin property.
581
582@table @var
583@item icon-view
584a @code{<gtk-icon-view>}
585
586@item ret
587the space at the borders
588
589@end table
590
591Since 2.6
592
593@end deffn
594
595@deffn Function gtk-icon-view-select-path  (self@tie{}@code{<gtk-icon-view>}) (path@tie{}@code{<gtk-tree-path>})
596@deffnx Method select-path
597Selects the row at @var{path}.
598
599@table @var
600@item icon-view
601A @code{<gtk-icon-view>}.
602
603@item path
604The @code{<gtk-tree-path>} to be selected.
605
606@end table
607
608Since 2.6
609
610@end deffn
611
612@deffn Function gtk-icon-view-unselect-path  (self@tie{}@code{<gtk-icon-view>}) (path@tie{}@code{<gtk-tree-path>})
613@deffnx Method unselect-path
614Unselects the row at @var{path}.
615
616@table @var
617@item icon-view
618A @code{<gtk-icon-view>}.
619
620@item path
621The @code{<gtk-tree-path>} to be unselected.
622
623@end table
624
625Since 2.6
626
627@end deffn
628
629@deffn Function gtk-icon-view-path-is-selected  (self@tie{}@code{<gtk-icon-view>}) (path@tie{}@code{<gtk-tree-path>}) @result{}@tie{} (ret@tie{}@code{bool})
630@deffnx Method path-is-selected
631Returns @samp{@code{#t}} if the icon pointed to by @var{path} is currently
632selected. If @var{icon} does not point to a valid location, @samp{@code{#f}} is
633returned.
634
635@table @var
636@item icon-view
637A @code{<gtk-icon-view>}.
638
639@item path
640A @code{<gtk-tree-path>} to check selection on.
641
642@item ret
643@samp{@code{#t}} if @var{path} is selected.
644
645@end table
646
647Since 2.6
648
649@end deffn
650
651@deffn Function gtk-icon-view-get-selected-items  (self@tie{}@code{<gtk-icon-view>}) @result{}@tie{} (ret@tie{}@code{glist-of})
652@deffnx Method get-selected-items
653Creates a list of paths of all selected items. Additionally, if you are planning
654on modifying the model after calling this function, you may want to convert the
655returned list into a list of @code{<gtk-tree-row-reference>}s. To do this, you
656can use @code{gtk-tree-row-reference-new}.
657
658To free the return value, use:
659
660@example
661
662g_list_foreach (list, gtk_tree_path_free, NULL);
663g_list_free (list);
664@end example
665
666@table @var
667@item icon-view
668A @code{<gtk-icon-view>}.
669
670@item ret
671A @code{<g-list>} containing a @code{<gtk-tree-path>} for each selected row.
672
673@end table
674
675Since 2.6
676
677@end deffn
678
679@deffn Function gtk-icon-view-select-all  (self@tie{}@code{<gtk-icon-view>})
680@deffnx Method select-all
681Selects all the icons. @var{icon-view} must has its selection mode set to
682@code{<gtk-selection-multiple>}.
683
684@table @var
685@item icon-view
686A @code{<gtk-icon-view>}.
687
688@end table
689
690Since 2.6
691
692@end deffn
693
694@deffn Function gtk-icon-view-unselect-all  (self@tie{}@code{<gtk-icon-view>})
695@deffnx Method unselect-all
696Unselects all the icons.
697
698@table @var
699@item icon-view
700A @code{<gtk-icon-view>}.
701
702@end table
703
704Since 2.6
705
706@end deffn
707
708@deffn Function gtk-icon-view-item-activated  (self@tie{}@code{<gtk-icon-view>}) (path@tie{}@code{<gtk-tree-path>})
709@deffnx Method item-activated
710Activates the item determined by @var{path}.
711
712@table @var
713@item icon-view
714A @code{<gtk-icon-view>}
715
716@item path
717The @code{<gtk-tree-path>} to be activated
718
719@end table
720
721Since 2.6
722
723@end deffn
724
725@deffn Function gtk-icon-view-scroll-to-path  (self@tie{}@code{<gtk-icon-view>}) (path@tie{}@code{<gtk-tree-path>}) (use_align@tie{}@code{bool}) (row_align@tie{}@code{float}) (col_align@tie{}@code{float})
726@deffnx Method scroll-to-path
727Moves the alignments of @var{icon-view} to the position specified by @var{path}.
728@var{row-align} determines where the row is placed, and @var{col-align}
729determines where @var{column} is placed. Both are expected to be between 0.0 and
7301.0. 0.0 means left/top alignment, 1.0 means right/bottom alignment, 0.5 means
731center.
732
733If @var{use-align} is @samp{@code{#f}}, then the alignment arguments are
734ignored, and the tree does the minimum amount of work to scroll the item onto
735the screen. This means that the item will be scrolled to the edge closest to its
736current position. If the item is currently visible on the screen, nothing is
737done.
738
739This function only works if the model is set, and @var{path} is a valid row on
740the model. If the model changes before the @var{icon-view} is realized, the
741centered path will be modified to reflect this change.
742
743@table @var
744@item icon-view
745A @code{<gtk-icon-view>}.
746
747@item path
748The path of the item to move to.
749
750@item use-align
751whether to use alignment arguments, or @samp{@code{#f}}.
752
753@item row-align
754The vertical alignment of the item specified by @var{path}.
755
756@item col-align
757The horizontal alignment of the item specified by @var{path}.
758
759@end table
760
761Since 2.8
762
763@end deffn
764
765@deffn Function gtk-icon-view-unset-model-drag-dest  (self@tie{}@code{<gtk-icon-view>})
766@deffnx Method unset-model-drag-dest
767Undoes the effect of @code{gtk-icon-view-enable-model-drag-dest}.
768
769@table @var
770@item icon-view
771a @code{<gtk-icon-view>}
772
773@end table
774
775Since 2.8
776
777@end deffn
778
779@deffn Function gtk-icon-view-set-reorderable  (self@tie{}@code{<gtk-icon-view>}) (reorderable@tie{}@code{bool})
780@deffnx Method set-reorderable
781This function is a convenience function to allow you to reorder models that
782support the @code{<gtk-tree-drag-source-iface>} and the
783@code{<gtk-tree-drag-dest-iface>}. Both @code{<gtk-tree-store>} and
784@code{<gtk-list-store>} support these. If @var{reorderable} is @samp{@code{#t}},
785then the user can reorder the model by dragging and dropping rows. The developer
786can listen to these changes by connecting to the model's row_inserted and
787row_deleted signals.
788
789This function does not give you any degree of control over the order -- any
790reordering is allowed. If more control is needed, you should probably handle
791drag and drop manually.
792
793@table @var
794@item icon-view
795A @code{<gtk-icon-view>}.
796
797@item reorderable
798@samp{@code{#t}}, if the list of items can be reordered.
799
800@end table
801
802Since 2.8
803
804@end deffn
805
806@deffn Function gtk-icon-view-get-reorderable  (self@tie{}@code{<gtk-icon-view>}) @result{}@tie{} (ret@tie{}@code{bool})
807@deffnx Method get-reorderable
808Retrieves whether the user can reorder the list via drag-and-drop. See
809@code{gtk-icon-view-set-reorderable}.
810
811@table @var
812@item icon-view
813a @code{<gtk-icon-view>}
814
815@item ret
816@samp{@code{#t}} if the list can be reordered.
817
818@end table
819
820Since 2.8
821
822@end deffn
823
824@deffn Function gtk-icon-view-set-drag-dest-item  (self@tie{}@code{<gtk-icon-view>}) (path@tie{}@code{<gtk-tree-path>}) (pos@tie{}@code{<gtk-icon-view-drop-position>})
825@deffnx Method set-drag-dest-item
826Sets the item that is highlighted for feedback.
827
828@table @var
829@item icon-view
830a @code{<gtk-icon-view>}
831
832@item path
833The path of the item to highlight, or @samp{@code{#f}}.
834
835@item pos
836Specifies where to drop, relative to the item
837
838@end table
839
840Since 2.8
841
842@end deffn
843
844@deffn Function gtk-icon-view-create-drag-icon  (self@tie{}@code{<gtk-icon-view>}) (path@tie{}@code{<gtk-tree-path>}) @result{}@tie{} (ret@tie{}@code{<gdk-pixmap>})
845@deffnx Method create-drag-icon
846Creates a @code{<gdk-pixmap>} representation of the item at @var{path}. This
847image is used for a drag icon.
848
849@table @var
850@item icon-view
851a @code{<gtk-icon-view>}
852
853@item path
854a @code{<gtk-tree-path>} in @var{icon-view}
855
856@item ret
857a newly-allocated pixmap of the drag icon.
858
859@end table
860
861Since 2.8
862
863@end deffn
864
865
866@c %end of fragment
867