1This is guile-gnome-gtk.info, produced by makeinfo version 6.3 from 2guile-gnome-gtk.texi. 3 4This manual is for '(gnome gtk)' (version 2.16.5, updated 24 January 52015) 6 7 Copyright 1997-2007 Damon Chaplin and others 8 9 This work may be reproduced and distributed in whole or in part, in 10 any medium, physical or electronic, so as long as this copyright 11 notice remains intact and unchanged on all copies. Commercial 12 redistribution is permitted and encouraged, but you may not 13 redistribute, in whole or in part, under terms more restrictive 14 than those under which you received it. If you redistribute a 15 modified or translated version of this work, you must also make the 16 source code to the modified or translated version available in 17 electronic form without charge. However, mere aggregation as part 18 of a larger work shall not count as a modification for this 19 purpose. 20 21 All code examples in this work are placed into the public domain, 22 and may be used, modified and redistributed without restriction. 23 24 BECAUSE THIS WORK IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 25 FOR THE WORK, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT 26 WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER 27 PARTIES PROVIDE THE WORK "AS IS" WITHOUT WARRANTY OF ANY KIND, 28 EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 29 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 30 PURPOSE. SHOULD THE WORK PROVE DEFECTIVE, YOU ASSUME THE COST OF 31 ALL NECESSARY REPAIR OR CORRECTION. 32 33 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 34 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY 35 MODIFY AND/OR REDISTRIBUTE THE WORK AS PERMITTED ABOVE, BE LIABLE 36 TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 37 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE 38 THE WORK, EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF 39 THE POSSIBILITY OF SUCH DAMAGES. 40 41INFO-DIR-SECTION The Algorithmic Language Scheme 42START-INFO-DIR-ENTRY 43* Guile-Gtk: (guile-gnome-gtk.info). The GIMP ToolKit. 44END-INFO-DIR-ENTRY 45 46 47File: guile-gnome-gtk.info, Node: GtkTextTag, Next: GtkTextTagTable, Prev: GtkTextBuffer, Up: Top 48 4929 GtkTextTag 50************* 51 52A tag that can be applied to text in a 53 5429.1 Overview 55============= 56 57You may wish to begin by reading the text widget conceptual overview 58which gives an overview of all the objects and data types related to the 59text widget and how they work together. 60 61 Tags should be in the '<gtk-text-tag-table>' for a given 62'<gtk-text-buffer>' before using them with that buffer. 63 64 'gtk-text-buffer-create-tag' is the best way to create tags. See for 65numerous examples. 66 67 The "invisible" property was not implemented for GTK+ 2.0; it's 68planned to be implemented in future releases. 69 7029.2 Usage 71========== 72 73 -- Class: <gtk-text-tag> 74 Derives from '<gobject>'. 75 76 This class defines the following slots: 77 78 'name' 79 Name used to refer to the text tag. NULL for anonymous tags 80 81 'background' 82 Background color as a string 83 84 'foreground' 85 Foreground color as a string 86 87 'background-gdk' 88 Background color as a (possibly unallocated) GdkColor 89 90 'foreground-gdk' 91 Foreground color as a (possibly unallocated) GdkColor 92 93 'background-stipple' 94 Bitmap to use as a mask when drawing the text background 95 96 'foreground-stipple' 97 Bitmap to use as a mask when drawing the text foreground 98 99 'font' 100 Font description as a string, e.g. "Sans Italic 12" 101 102 'font-desc' 103 Font description as a PangoFontDescription struct 104 105 'family' 106 Name of the font family, e.g. Sans, Helvetica, Times, 107 Monospace 108 109 'style' 110 Font style as a PangoStyle, e.g. PANGO_STYLE_ITALIC 111 112 'variant' 113 Font variant as a PangoVariant, e.g. PANGO_VARIANT_SMALL_CAPS 114 115 'weight' 116 Font weight as an integer, see predefined values in 117 PangoWeight; for example, PANGO_WEIGHT_BOLD 118 119 'stretch' 120 Font stretch as a PangoStretch, e.g. PANGO_STRETCH_CONDENSED 121 122 'size' 123 Font size in Pango units 124 125 'size-points' 126 Font size in points 127 128 'scale' 129 Font size as a scale factor relative to the default font size. 130 This properly adapts to theme changes etc. so is recommended. 131 Pango predefines some scales such as PANGO_SCALE_X_LARGE 132 133 'pixels-above-lines' 134 Pixels of blank space above paragraphs 135 136 'pixels-below-lines' 137 Pixels of blank space below paragraphs 138 139 'pixels-inside-wrap' 140 Pixels of blank space between wrapped lines in a paragraph 141 142 'editable' 143 Whether the text can be modified by the user 144 145 'wrap-mode' 146 Whether to wrap lines never, at word boundaries, or at 147 character boundaries 148 149 'justification' 150 Left, right, or center justification 151 152 'direction' 153 Text direction, e.g. right-to-left or left-to-right 154 155 'left-margin' 156 Width of the left margin in pixels 157 158 'indent' 159 Amount to indent the paragraph, in pixels 160 161 'strikethrough' 162 Whether to strike through the text 163 164 'right-margin' 165 Width of the right margin in pixels 166 167 'underline' 168 Style of underline for this text 169 170 'rise' 171 Offset of text above the baseline (below the baseline if rise 172 is negative) in Pango units 173 174 'background-full-height' 175 Whether the background color fills the entire line height or 176 only the height of the tagged characters 177 178 'language' 179 The language this text is in, as an ISO code. Pango can use 180 this as a hint when rendering the text. If not set, an 181 appropriate default will be used. 182 183 'tabs' 184 Custom tabs for this text 185 186 'invisible' 187 Whether this text is hidden. 188 189 'paragraph-background' 190 Paragraph background color as a string 191 192 'paragraph-background-gdk' 193 Paragraph background color as a (possibly unallocated) 194 GdkColor 195 196 'accumulative-margin' 197 Whether left and right margins accumulate. 198 199 'background-set' 200 Whether this tag affects the background color 201 202 'foreground-set' 203 Whether this tag affects the foreground color 204 205 'background-stipple-set' 206 Whether this tag affects the background stipple 207 208 'foreground-stipple-set' 209 Whether this tag affects the foreground stipple 210 211 'family-set' 212 Whether this tag affects the font family 213 214 'style-set' 215 Whether this tag affects the font style 216 217 'variant-set' 218 Whether this tag affects the font variant 219 220 'weight-set' 221 Whether this tag affects the font weight 222 223 'stretch-set' 224 Whether this tag affects the font stretch 225 226 'size-set' 227 Whether this tag affects the font size 228 229 'scale-set' 230 Whether this tag scales the font size by a factor 231 232 'pixels-above-lines-set' 233 Whether this tag affects the number of pixels above lines 234 235 'pixels-below-lines-set' 236 Whether this tag affects the number of pixels above lines 237 238 'pixels-inside-wrap-set' 239 Whether this tag affects the number of pixels between wrapped 240 lines 241 242 'editable-set' 243 Whether this tag affects text editability 244 245 'wrap-mode-set' 246 Whether this tag affects line wrap mode 247 248 'justification-set' 249 Whether this tag affects paragraph justification 250 251 'left-margin-set' 252 Whether this tag affects the left margin 253 254 'indent-set' 255 Whether this tag affects indentation 256 257 'strikethrough-set' 258 Whether this tag affects strikethrough 259 260 'right-margin-set' 261 Whether this tag affects the right margin 262 263 'underline-set' 264 Whether this tag affects underlining 265 266 'rise-set' 267 Whether this tag affects the rise 268 269 'background-full-height-set' 270 Whether this tag affects background height 271 272 'language-set' 273 Whether this tag affects the language the text is rendered as 274 275 'tabs-set' 276 Whether this tag affects tabs 277 278 'invisible-set' 279 Whether this tag affects text visibility 280 281 'paragraph-background-set' 282 Whether this tag affects the paragraph background color 283 284 -- Signal on <gtk-text-tag>: event (arg0 '<gobject>') 285 (arg1 '<gdk-event>') (arg2 '<gtk-text-iter>') => '<gboolean>' 286 287 -- Class: <gtk-text-attributes> 288 Derives from '<gboxed>'. 289 290 This class defines no direct slots. 291 292 -- Function: gtk-text-tag-new (name 'mchars') => 293 (ret '<gtk-text-tag>') 294 Creates a '<gtk-text-tag>'. Configure the tag using object 295 arguments, i.e. using 'g-object-set'. 296 297 NAME 298 tag name, or ''#f'' 299 300 RET 301 a new '<gtk-text-tag>' 302 303 -- Function: gtk-text-tag-get-priority (self '<gtk-text-tag>') => 304 (ret 'int') 305 -- Method: get-priority 306 Get the tag priority. 307 308 TAG 309 a '<gtk-text-tag>' 310 311 RET 312 The tag's priority. 313 314 -- Function: gtk-text-tag-set-priority (self '<gtk-text-tag>') 315 (priority 'int') 316 -- Method: set-priority 317 Sets the priority of a '<gtk-text-tag>'. Valid priorities are 318 start at 0 and go to one less than 'gtk-text-tag-table-get-size'. 319 Each tag in a table has a unique priority; setting the priority of 320 one tag shifts the priorities of all the other tags in the table to 321 maintain a unique priority for each tag. Higher priority tags 322 "win" if two tags both set the same text attribute. When adding a 323 tag to a tag table, it will be assigned the highest priority in the 324 table by default; so normally the precedence of a set of tags is 325 the order in which they were added to the table, or created with 326 'gtk-text-buffer-create-tag', which adds the tag to the buffer's 327 table automatically. 328 329 TAG 330 a '<gtk-text-tag>' 331 332 PRIORITY 333 the new priority 334 335 -- Function: gtk-text-tag-event (self '<gtk-text-tag>') 336 (event_object '<gobject>') (event '<gdk-event>') 337 (iter '<gtk-text-iter>') => (ret 'bool') 338 -- Method: event 339 Emits the "event" signal on the '<gtk-text-tag>'. 340 341 TAG 342 a '<gtk-text-tag>' 343 344 EVENT-OBJECT 345 object that received the event, such as a widget 346 347 EVENT 348 the event 349 350 ITER 351 location where the event was received 352 353 RET 354 result of signal emission (whether the event was handled) 355 356 -- Function: gtk-text-attributes-new => (ret '<gtk-text-attributes>') 357 Creates a '<gtk-text-attributes>', which describes a set of 358 properties on some text. 359 360 RET 361 a new '<gtk-text-attributes>' 362 363 -- Function: gtk-text-attributes-copy (self '<gtk-text-attributes>') 364 => (ret '<gtk-text-attributes>') 365 Copies SRC and returns a new '<gtk-text-attributes>'. 366 367 SRC 368 a '<gtk-text-attributes>' to be copied 369 370 RET 371 a copy of SRC 372 373 -- Function: gtk-text-attributes-copy-values 374 (self '<gtk-text-attributes>') (dest '<gtk-text-attributes>') 375 Copies the values from SRC to DEST so that DEST has the same values 376 as SRC. Frees existing values in DEST. 377 378 SRC 379 a '<gtk-text-attributes>' 380 381 DEST 382 another '<gtk-text-attributes>' 383 384 385File: guile-gnome-gtk.info, Node: GtkTextTagTable, Next: GtkTextView, Prev: GtkTextTag, Up: Top 386 38730 GtkTextTagTable 388****************** 389 390Collection of tags that can be used together 391 39230.1 Overview 393============= 394 395You may wish to begin by reading the text widget conceptual overview 396which gives an overview of all the objects and data types related to the 397text widget and how they work together. 398 39930.2 Usage 400========== 401 402 -- Class: <gtk-text-tag-table> 403 Derives from '<gobject>'. 404 405 This class defines no direct slots. 406 407 -- Signal on <gtk-text-tag-table>: tag-changed (arg0 '<gtk-text-tag>') 408 (arg1 '<gboolean>') 409 410 -- Signal on <gtk-text-tag-table>: tag-added (arg0 '<gtk-text-tag>') 411 412 -- Signal on <gtk-text-tag-table>: tag-removed (arg0 '<gtk-text-tag>') 413 414 -- Function: gtk-text-tag-table-new => (ret '<gtk-text-tag-table>') 415 Creates a new '<gtk-text-tag-table>'. The table contains no tags 416 by default. 417 418 RET 419 a new '<gtk-text-tag-table>' 420 421 -- Function: gtk-text-tag-table-add (self '<gtk-text-tag-table>') 422 (tag '<gtk-text-tag>') 423 -- Method: add 424 Add a tag to the table. The tag is assigned the highest priority 425 in the table. 426 427 TAG must not be in a tag table already, and may not have the same 428 name as an already-added tag. 429 430 TABLE 431 a '<gtk-text-tag-table>' 432 433 TAG 434 a '<gtk-text-tag>' 435 436 -- Function: gtk-text-tag-table-remove (self '<gtk-text-tag-table>') 437 (tag '<gtk-text-tag>') 438 -- Method: remove 439 Remove a tag from the table. This will remove the table's 440 reference to the tag, so be careful - the tag will end up destroyed 441 if you don't have a reference to it. 442 443 TABLE 444 a '<gtk-text-tag-table>' 445 446 TAG 447 a '<gtk-text-tag>' 448 449 -- Function: gtk-text-tag-table-lookup (self '<gtk-text-tag-table>') 450 (name 'mchars') => (ret '<gtk-text-tag>') 451 -- Method: lookup 452 Look up a named tag. 453 454 TABLE 455 a '<gtk-text-tag-table>' 456 457 NAME 458 name of a tag 459 460 RET 461 The tag, or ''#f'' if none by that name is in the table. 462 463 -- Function: gtk-text-tag-table-get-size (self '<gtk-text-tag-table>') 464 => (ret 'int') 465 -- Method: get-size 466 Returns the size of the table (number of tags) 467 468 TABLE 469 a '<gtk-text-tag-table>' 470 471 RET 472 number of tags in TABLE 473 474 475File: guile-gnome-gtk.info, Node: GtkTextView, Next: GtkTreeModel, Prev: GtkTextTagTable, Up: Top 476 47731 GtkTextView 478************** 479 480Widget that displays a 481 48231.1 Overview 483============= 484 485You may wish to begin by reading the text widget conceptual overview 486which gives an overview of all the objects and data types related to the 487text widget and how they work together. 488 48931.2 Usage 490========== 491 492 -- Class: <gtk-text-view> 493 Derives from '<gtk-container>'. 494 495 This class defines the following slots: 496 497 'pixels-above-lines' 498 Pixels of blank space above paragraphs 499 500 'pixels-below-lines' 501 Pixels of blank space below paragraphs 502 503 'pixels-inside-wrap' 504 Pixels of blank space between wrapped lines in a paragraph 505 506 'editable' 507 Whether the text can be modified by the user 508 509 'wrap-mode' 510 Whether to wrap lines never, at word boundaries, or at 511 character boundaries 512 513 'justification' 514 Left, right, or center justification 515 516 'left-margin' 517 Width of the left margin in pixels 518 519 'right-margin' 520 Width of the right margin in pixels 521 522 'indent' 523 Amount to indent the paragraph, in pixels 524 525 'tabs' 526 Custom tabs for this text 527 528 'cursor-visible' 529 If the insertion cursor is shown 530 531 'buffer' 532 The buffer which is displayed 533 534 'overwrite' 535 Whether entered text overwrites existing contents 536 537 'accepts-tab' 538 Whether Tab will result in a tab character being entered 539 540 -- Signal on <gtk-text-view>: move-cursor (arg0 '<gtk-movement-step>') 541 (arg1 '<gint>') (arg2 '<gboolean>') 542 The ::move-cursor signal is a keybinding signal which gets emitted 543 when the user initiates a cursor movement. 544 545 Applications should not connect to it, but may emit it with 546 'g-signal-emit-by-name' if they need to control scrolling 547 programmatically. 548 549 -- Signal on <gtk-text-view>: copy-clipboard 550 551 -- Signal on <gtk-text-view>: populate-popup (arg0 '<gtk-menu>') 552 553 -- Signal on <gtk-text-view>: insert-at-cursor (arg0 '<gchararray>') 554 555 -- Signal on <gtk-text-view>: delete-from-cursor 556 (arg0 '<gtk-delete-type>') (arg1 '<gint>') 557 558 -- Signal on <gtk-text-view>: backspace 559 560 -- Signal on <gtk-text-view>: cut-clipboard 561 562 -- Signal on <gtk-text-view>: paste-clipboard 563 564 -- Signal on <gtk-text-view>: toggle-overwrite 565 566 -- Signal on <gtk-text-view>: set-scroll-adjustments 567 (arg0 '<gtk-adjustment>') (arg1 '<gtk-adjustment>') 568 569 -- Signal on <gtk-text-view>: select-all (arg0 '<gboolean>') 570 571 -- Signal on <gtk-text-view>: page-horizontally (arg0 '<gint>') 572 (arg1 '<gboolean>') 573 574 -- Signal on <gtk-text-view>: move-viewport (arg0 '<gtk-scroll-step>') 575 (arg1 '<gint>') 576 577 -- Signal on <gtk-text-view>: set-anchor 578 579 -- Signal on <gtk-text-view>: toggle-cursor-visible 580 undocumented 581 582 -- Class: <gtk-text-child-anchor> 583 Derives from '<gobject>'. 584 585 This class defines no direct slots. 586 587 -- Function: gtk-text-view-new-with-buffer (buffer '<gtk-text-buffer>') 588 => (ret '<gtk-widget>') 589 Creates a new '<gtk-text-view>' widget displaying the buffer 590 BUFFER. One buffer can be shared among many widgets. BUFFER may 591 be NULL to create a default buffer, in which case this function is 592 equivalent to 'gtk-text-view-new'. The text view adds its own 593 reference count to the buffer; it does not take over an existing 594 reference. 595 596 BUFFER 597 a '<gtk-text-buffer>' 598 599 RET 600 a new '<gtk-text-view>'. 601 602 -- Function: gtk-text-view-set-buffer (self '<gtk-text-view>') 603 (buffer '<gtk-text-buffer>') 604 -- Method: set-buffer 605 Sets BUFFER as the buffer being displayed by TEXT-VIEW. The 606 previous buffer displayed by the text view is unreferenced, and a 607 reference is added to BUFFER. If you owned a reference to BUFFER 608 before passing it to this function, you must remove that reference 609 yourself; '<gtk-text-view>' will not "adopt" it. 610 611 TEXT-VIEW 612 a '<gtk-text-view>' 613 614 BUFFER 615 a '<gtk-text-buffer>' 616 617 -- Function: gtk-text-view-get-buffer (self '<gtk-text-view>') => 618 (ret '<gtk-text-buffer>') 619 -- Method: get-buffer 620 Returns the '<gtk-text-buffer>' being displayed by this text view. 621 The reference count on the buffer is not incremented; the caller of 622 this function won't own a new reference. 623 624 TEXT-VIEW 625 a '<gtk-text-view>' 626 627 RET 628 a '<gtk-text-buffer>' 629 630 -- Function: gtk-text-view-scroll-to-mark (self '<gtk-text-view>') 631 (mark '<gtk-text-mark>') (within_margin 'double') 632 (use_align 'bool') (xalign 'double') (yalign 'double') 633 -- Method: scroll-to-mark 634 Scrolls TEXT-VIEW so that MARK is on the screen in the position 635 indicated by XALIGN and YALIGN. An alignment of 0.0 indicates left 636 or top, 1.0 indicates right or bottom, 0.5 means center. If 637 USE-ALIGN is ''#f'', the text scrolls the minimal distance to get 638 the mark onscreen, possibly not scrolling at all. The effective 639 screen for purposes of this function is reduced by a margin of size 640 WITHIN-MARGIN. 641 642 TEXT-VIEW 643 a '<gtk-text-view>' 644 645 MARK 646 a '<gtk-text-mark>' 647 648 WITHIN-MARGIN 649 margin as a [0.0,0.5) fraction of screen size 650 651 USE-ALIGN 652 whether to use alignment arguments (if ''#f'', just get the 653 mark onscreen) 654 655 XALIGN 656 horizontal alignment of mark within visible area. 657 658 YALIGN 659 vertical alignment of mark within visible area 660 661 -- Function: gtk-text-view-scroll-to-iter (self '<gtk-text-view>') 662 (iter '<gtk-text-iter>') (within_margin 'double') 663 (use_align 'bool') (xalign 'double') (yalign 'double') => 664 (ret 'bool') 665 -- Method: scroll-to-iter 666 Scrolls TEXT-VIEW so that ITER is on the screen in the position 667 indicated by XALIGN and YALIGN. An alignment of 0.0 indicates left 668 or top, 1.0 indicates right or bottom, 0.5 means center. If 669 USE-ALIGN is ''#f'', the text scrolls the minimal distance to get 670 the mark onscreen, possibly not scrolling at all. The effective 671 screen for purposes of this function is reduced by a margin of size 672 WITHIN-MARGIN. NOTE: This function uses the currently-computed 673 height of the lines in the text buffer. Note that line heights are 674 computed in an idle handler; so this function may not have the 675 desired effect if it's called before the height computations. To 676 avoid oddness, consider using 'gtk-text-view-scroll-to-mark' which 677 saves a point to be scrolled to after line validation. 678 679 TEXT-VIEW 680 a '<gtk-text-view>' 681 682 ITER 683 a '<gtk-text-iter>' 684 685 WITHIN-MARGIN 686 margin as a [0.0,0.5) fraction of screen size 687 688 USE-ALIGN 689 whether to use alignment arguments (if ''#f'', just get the 690 mark onscreen) 691 692 XALIGN 693 horizontal alignment of mark within visible area. 694 695 YALIGN 696 vertical alignment of mark within visible area 697 698 RET 699 ''#t'' if scrolling occurred 700 701 -- Function: gtk-text-view-scroll-mark-onscreen 702 (self '<gtk-text-view>') (mark '<gtk-text-mark>') 703 -- Method: scroll-mark-onscreen 704 Scrolls TEXT-VIEW the minimum distance such that MARK is contained 705 within the visible area of the widget. 706 707 TEXT-VIEW 708 a '<gtk-text-view>' 709 710 MARK 711 a mark in the buffer for TEXT-VIEW 712 713 -- Function: gtk-text-view-move-mark-onscreen (self '<gtk-text-view>') 714 (mark '<gtk-text-mark>') => (ret 'bool') 715 -- Method: move-mark-onscreen 716 Moves a mark within the buffer so that it's located within the 717 currently-visible text area. 718 719 TEXT-VIEW 720 a '<gtk-text-view>' 721 722 MARK 723 a '<gtk-text-mark>' 724 725 RET 726 ''#t'' if the mark moved (wasn't already onscreen) 727 728 -- Function: gtk-text-view-place-cursor-onscreen 729 (self '<gtk-text-view>') => (ret 'bool') 730 -- Method: place-cursor-onscreen 731 Moves the cursor to the currently visible region of the buffer, it 732 it isn't there already. 733 734 TEXT-VIEW 735 a '<gtk-text-view>' 736 737 RET 738 TRUE if the cursor had to be moved. 739 740 -- Function: gtk-text-view-get-visible-rect (self '<gtk-text-view>') 741 (visible_rect '<gdk-rectangle>') 742 -- Method: get-visible-rect 743 Fills VISIBLE-RECT with the currently-visible region of the buffer, 744 in buffer coordinates. Convert to window coordinates with 745 'gtk-text-view-buffer-to-window-coords'. 746 747 TEXT-VIEW 748 a '<gtk-text-view>' 749 750 VISIBLE-RECT 751 rectangle to fill 752 753 -- Function: gtk-text-view-get-iter-location (self '<gtk-text-view>') 754 (iter '<gtk-text-iter>') (location '<gdk-rectangle>') 755 -- Method: get-iter-location 756 Gets a rectangle which roughly contains the character at ITER. The 757 rectangle position is in buffer coordinates; use 758 'gtk-text-view-buffer-to-window-coords' to convert these 759 coordinates to coordinates for one of the windows in the text view. 760 761 TEXT-VIEW 762 a '<gtk-text-view>' 763 764 ITER 765 a '<gtk-text-iter>' 766 767 LOCATION 768 bounds of the character at ITER 769 770 -- Function: gtk-text-view-get-line-at-y (self '<gtk-text-view>') 771 (target_iter '<gtk-text-iter>') (y 'int') => (line_top 'int') 772 -- Method: get-line-at-y 773 Gets the '<gtk-text-iter>' at the start of the line containing the 774 coordinate Y. Y is in buffer coordinates, convert from window 775 coordinates with 'gtk-text-view-window-to-buffer-coords'. If 776 non-''#f'', LINE-TOP will be filled with the coordinate of the top 777 edge of the line. 778 779 TEXT-VIEW 780 a '<gtk-text-view>' 781 782 TARGET-ITER 783 a '<gtk-text-iter>' 784 785 Y 786 a y coordinate 787 788 LINE-TOP 789 return location for top coordinate of the line 790 791 -- Function: gtk-text-view-get-line-yrange (self '<gtk-text-view>') 792 (iter '<gtk-text-iter>') => (y 'int') (height 'int') 793 -- Method: get-line-yrange 794 Gets the y coordinate of the top of the line containing ITER, and 795 the height of the line. The coordinate is a buffer coordinate; 796 convert to window coordinates with 797 'gtk-text-view-buffer-to-window-coords'. 798 799 TEXT-VIEW 800 a '<gtk-text-view>' 801 802 ITER 803 a '<gtk-text-iter>' 804 805 Y 806 return location for a y coordinate 807 808 HEIGHT 809 return location for a height 810 811 -- Function: gtk-text-view-get-iter-at-location 812 (self '<gtk-text-view>') (iter '<gtk-text-iter>') (x 'int') 813 (y 'int') 814 -- Method: get-iter-at-location 815 Retrieves the iterator at buffer coordinates X and Y. Buffer 816 coordinates are coordinates for the entire buffer, not just the 817 currently-displayed portion. If you have coordinates from an 818 event, you have to convert those to buffer coordinates with 819 'gtk-text-view-window-to-buffer-coords'. 820 821 TEXT-VIEW 822 a '<gtk-text-view>' 823 824 ITER 825 a '<gtk-text-iter>' 826 827 X 828 x position, in buffer coordinates 829 830 Y 831 y position, in buffer coordinates 832 833 -- Function: gtk-text-view-get-window (self '<gtk-text-view>') 834 (win '<gtk-text-window-type>') => (ret '<gdk-window>') 835 -- Method: get-window 836 Retrieves the '<gdk-window>' corresponding to an area of the text 837 view; possible windows include the overall widget window, child 838 windows on the left, right, top, bottom, and the window that 839 displays the text buffer. Windows are ''#f'' and nonexistent if 840 their width or height is 0, and are nonexistent before the widget 841 has been realized. 842 843 TEXT-VIEW 844 a '<gtk-text-view>' 845 846 WIN 847 window to get 848 849 RET 850 a '<gdk-window>', or ''#f'' 851 852 -- Function: gtk-text-view-get-window-type (self '<gtk-text-view>') 853 (window '<gdk-window>') => (ret '<gtk-text-window-type>') 854 -- Method: get-window-type 855 Usually used to find out which window an event corresponds to. If 856 you connect to an event signal on TEXT-VIEW, this function should 857 be called on 'event->window' to see which window it was. 858 859 TEXT-VIEW 860 a '<gtk-text-view>' 861 862 WINDOW 863 a window type 864 865 RET 866 the window type. 867 868 -- Function: gtk-text-view-forward-display-line 869 (self '<gtk-text-view>') (iter '<gtk-text-iter>') => 870 (ret 'bool') 871 -- Method: forward-display-line 872 Moves the given ITER forward by one display (wrapped) line. A 873 display line is different from a paragraph. Paragraphs are 874 separated by newlines or other paragraph separator characters. 875 Display lines are created by line-wrapping a paragraph. If 876 wrapping is turned off, display lines and paragraphs will be the 877 same. Display lines are divided differently for each view, since 878 they depend on the view's width; paragraphs are the same in all 879 views, since they depend on the contents of the 880 '<gtk-text-buffer>'. 881 882 TEXT-VIEW 883 a '<gtk-text-view>' 884 885 ITER 886 a '<gtk-text-iter>' 887 888 RET 889 ''#t'' if ITER was moved and is not on the end iterator 890 891 -- Function: gtk-text-view-backward-display-line 892 (self '<gtk-text-view>') (iter '<gtk-text-iter>') => 893 (ret 'bool') 894 -- Method: backward-display-line 895 Moves the given ITER backward by one display (wrapped) line. A 896 display line is different from a paragraph. Paragraphs are 897 separated by newlines or other paragraph separator characters. 898 Display lines are created by line-wrapping a paragraph. If 899 wrapping is turned off, display lines and paragraphs will be the 900 same. Display lines are divided differently for each view, since 901 they depend on the view's width; paragraphs are the same in all 902 views, since they depend on the contents of the 903 '<gtk-text-buffer>'. 904 905 TEXT-VIEW 906 a '<gtk-text-view>' 907 908 ITER 909 a '<gtk-text-iter>' 910 911 RET 912 ''#t'' if ITER was moved and is not on the end iterator 913 914 -- Function: gtk-text-view-starts-display-line (self '<gtk-text-view>') 915 (iter '<gtk-text-iter>') => (ret 'bool') 916 -- Method: starts-display-line 917 Determines whether ITER is at the start of a display line. See 918 'gtk-text-view-forward-display-line' for an explanation of display 919 lines vs. paragraphs. 920 921 TEXT-VIEW 922 a '<gtk-text-view>' 923 924 ITER 925 a '<gtk-text-iter>' 926 927 RET 928 ''#t'' if ITER begins a wrapped line 929 930 -- Function: gtk-text-view-move-visually (self '<gtk-text-view>') 931 (iter '<gtk-text-iter>') (count 'int') => (ret 'bool') 932 -- Method: move-visually 933 Move the iterator a given number of characters visually, treating 934 it as the strong cursor position. If COUNT is positive, then the 935 new strong cursor position will be COUNT positions to the right of 936 the old cursor position. If COUNT is negative then the new strong 937 cursor position will be COUNT positions to the left of the old 938 cursor position. 939 940 In the presence of bidirection text, the correspondence between 941 logical and visual order will depend on the direction of the 942 current run, and there may be jumps when the cursor is moved off of 943 the end of a run. 944 945 TEXT-VIEW 946 a '<gtk-text-view>' 947 948 ITER 949 a '<gtk-text-iter>' 950 951 COUNT 952 number of characters to move (negative moves left, positive 953 moves right) 954 955 RET 956 ''#t'' if ITER moved and is not on the end iterator 957 958 -- Function: gtk-text-view-add-child-at-anchor (self '<gtk-text-view>') 959 (child '<gtk-widget>') (anchor '<gtk-text-child-anchor>') 960 -- Method: add-child-at-anchor 961 Adds a child widget in the text buffer, at the given ANCHOR. 962 963 TEXT-VIEW 964 a '<gtk-text-view>' 965 966 CHILD 967 a '<gtk-widget>' 968 969 ANCHOR 970 a '<gtk-text-child-anchor>' in the '<gtk-text-buffer>' for 971 TEXT-VIEW 972 973 -- Function: gtk-text-child-anchor-new => 974 (ret '<gtk-text-child-anchor>') 975 Creates a new '<gtk-text-child-anchor>'. Usually you would then 976 insert it into a '<gtk-text-buffer>' with 977 'gtk-text-buffer-insert-child-anchor'. To perform the creation and 978 insertion in one step, use the convenience function 979 'gtk-text-buffer-create-child-anchor'. 980 981 RET 982 a new '<gtk-text-child-anchor>' 983 984 -- Function: gtk-text-child-anchor-get-widgets 985 (self '<gtk-text-child-anchor>') => (ret 'glist-of') 986 -- Method: get-widgets 987 Gets a list of all widgets anchored at this child anchor. The 988 returned list should be freed with 'g-list-free'. 989 990 ANCHOR 991 a '<gtk-text-child-anchor>' 992 993 RET 994 list of widgets anchored at ANCHOR 995 996 -- Function: gtk-text-child-anchor-get-deleted 997 (self '<gtk-text-child-anchor>') => (ret 'bool') 998 -- Method: get-deleted 999 Determines whether a child anchor has been deleted from the buffer. 1000 Keep in mind that the child anchor will be unreferenced when 1001 removed from the buffer, so you need to hold your own reference 1002 (with 'g-object-ref') if you plan to use this function — 1003 otherwise all deleted child anchors will also be finalized. 1004 1005 ANCHOR 1006 a '<gtk-text-child-anchor>' 1007 1008 RET 1009 ''#t'' if the child anchor has been deleted from its buffer 1010 1011 -- Function: gtk-text-view-add-child-in-window (self '<gtk-text-view>') 1012 (child '<gtk-widget>') (which_window '<gtk-text-window-type>') 1013 (xpos 'int') (ypos 'int') 1014 -- Method: add-child-in-window 1015 Adds a child at fixed coordinates in one of the text widget's 1016 windows. The window must have nonzero size (see 1017 'gtk-text-view-set-border-window-size'). Note that the child 1018 coordinates are given relative to the '<gdk-window>' in question, 1019 and that these coordinates have no sane relationship to scrolling. 1020 When placing a child in '<gtk-text-window-widget>', scrolling is 1021 irrelevant, the child floats above all scrollable areas. But when 1022 placing a child in one of the scrollable windows (border windows or 1023 text window), you'll need to compute the child's correct position 1024 in buffer coordinates any time scrolling occurs or buffer changes 1025 occur, and then call 'gtk-text-view-move-child' to update the 1026 child's position. Unfortunately there's no good way to detect that 1027 scrolling has occurred, using the current API; a possible hack 1028 would be to update all child positions when the scroll adjustments 1029 change or the text buffer changes. See bug 64518 on 1030 bugzilla.gnome.org for status of fixing this issue. 1031 1032 TEXT-VIEW 1033 a '<gtk-text-view>' 1034 1035 CHILD 1036 a '<gtk-widget>' 1037 1038 WHICH-WINDOW 1039 which window the child should appear in 1040 1041 XPOS 1042 X position of child in window coordinates 1043 1044 YPOS 1045 Y position of child in window coordinates 1046 1047 -- Function: gtk-text-view-move-child (self '<gtk-text-view>') 1048 (child '<gtk-widget>') (xpos 'int') (ypos 'int') 1049 -- Method: move-child 1050 Updates the position of a child, as for 1051 'gtk-text-view-add-child-in-window'. 1052 1053 TEXT-VIEW 1054 a '<gtk-text-view>' 1055 1056 CHILD 1057 child widget already added to the text view 1058 1059 XPOS 1060 new X position in window coordinates 1061 1062 YPOS 1063 new Y position in window coordinates 1064 1065 -- Function: gtk-text-view-set-wrap-mode (self '<gtk-text-view>') 1066 (wrap_mode '<gtk-wrap-mode>') 1067 -- Method: set-wrap-mode 1068 Sets the line wrapping for the view. 1069 1070 TEXT-VIEW 1071 a '<gtk-text-view>' 1072 1073 WRAP-MODE 1074 a '<gtk-wrap-mode>' 1075 1076 -- Function: gtk-text-view-get-wrap-mode (self '<gtk-text-view>') => 1077 (ret '<gtk-wrap-mode>') 1078 -- Method: get-wrap-mode 1079 Gets the line wrapping for the view. 1080 1081 TEXT-VIEW 1082 a '<gtk-text-view>' 1083 1084 RET 1085 the line wrap setting 1086 1087 -- Function: gtk-text-view-set-editable (self '<gtk-text-view>') 1088 (setting 'bool') 1089 -- Method: set-editable 1090 Sets the default editability of the '<gtk-text-view>'. You can 1091 override this default setting with tags in the buffer, using the 1092 "editable" attribute of tags. 1093 1094 TEXT-VIEW 1095 a '<gtk-text-view>' 1096 1097 SETTING 1098 whether it's editable 1099 1100 -- Function: gtk-text-view-get-editable (self '<gtk-text-view>') => 1101 (ret 'bool') 1102 -- Method: get-editable 1103 Returns the default editability of the '<gtk-text-view>'. Tags in 1104 the buffer may override this setting for some ranges of text. 1105 1106 TEXT-VIEW 1107 a '<gtk-text-view>' 1108 1109 RET 1110 whether text is editable by default 1111 1112 -- Function: gtk-text-view-set-cursor-visible (self '<gtk-text-view>') 1113 (setting 'bool') 1114 -- Method: set-cursor-visible 1115 Toggles whether the insertion point is displayed. A buffer with no 1116 editable text probably shouldn't have a visible cursor, so you may 1117 want to turn the cursor off. 1118 1119 TEXT-VIEW 1120 a '<gtk-text-view>' 1121 1122 SETTING 1123 whether to show the insertion cursor 1124 1125 -- Function: gtk-text-view-get-cursor-visible (self '<gtk-text-view>') 1126 => (ret 'bool') 1127 -- Method: get-cursor-visible 1128 Find out whether the cursor is being displayed. 1129 1130 TEXT-VIEW 1131 a '<gtk-text-view>' 1132 1133 RET 1134 whether the insertion mark is visible 1135 1136 -- Function: gtk-text-view-set-overwrite (self '<gtk-text-view>') 1137 (overwrite 'bool') 1138 -- Method: set-overwrite 1139 Changes the '<gtk-text-view>' overwrite mode. 1140 1141 TEXT-VIEW 1142 a '<gtk-text-view>' 1143 1144 OVERWRITE 1145 ''#t'' to turn on overwrite mode, ''#f'' to turn it off 1146 1147 Since 2.4 1148 1149 -- Function: gtk-text-view-get-overwrite (self '<gtk-text-view>') => 1150 (ret 'bool') 1151 -- Method: get-overwrite 1152 Returns whether the '<gtk-text-view>' is in overwrite mode or not. 1153 1154 TEXT-VIEW 1155 a '<gtk-text-view>' 1156 1157 RET 1158 whether TEXT-VIEW is in overwrite mode or not. 1159 1160 Since 2.4 1161 1162 -- Function: gtk-text-view-set-justification (self '<gtk-text-view>') 1163 (justification '<gtk-justification>') 1164 -- Method: set-justification 1165 Sets the default justification of text in TEXT-VIEW. Tags in the 1166 view's buffer may override the default. 1167 1168 TEXT-VIEW 1169 a '<gtk-text-view>' 1170 1171 JUSTIFICATION 1172 justification 1173 1174 -- Function: gtk-text-view-get-justification (self '<gtk-text-view>') 1175 => (ret '<gtk-justification>') 1176 -- Method: get-justification 1177 Gets the default justification of paragraphs in TEXT-VIEW. Tags in 1178 the buffer may override the default. 1179 1180 TEXT-VIEW 1181 a '<gtk-text-view>' 1182 1183 RET 1184 default justification 1185 1186 -- Function: gtk-text-view-set-left-margin (self '<gtk-text-view>') 1187 (left_margin 'int') 1188 -- Method: set-left-margin 1189 Sets the default left margin for text in TEXT-VIEW. Tags in the 1190 buffer may override the default. 1191 1192 TEXT-VIEW 1193 a '<gtk-text-view>' 1194 1195 LEFT-MARGIN 1196 left margin in pixels 1197 1198 -- Function: gtk-text-view-get-left-margin (self '<gtk-text-view>') => 1199 (ret 'int') 1200 -- Method: get-left-margin 1201 Gets the default left margin size of paragraphs in the TEXT-VIEW. 1202 Tags in the buffer may override the default. 1203 1204 TEXT-VIEW 1205 a '<gtk-text-view>' 1206 1207 RET 1208 left margin in pixels 1209 1210 -- Function: gtk-text-view-set-right-margin (self '<gtk-text-view>') 1211 (right_margin 'int') 1212 -- Method: set-right-margin 1213 Sets the default right margin for text in the text view. Tags in 1214 the buffer may override the default. 1215 1216 TEXT-VIEW 1217 a '<gtk-text-view>' 1218 1219 RIGHT-MARGIN 1220 right margin in pixels 1221 1222 -- Function: gtk-text-view-get-right-margin (self '<gtk-text-view>') 1223 => (ret 'int') 1224 -- Method: get-right-margin 1225 Gets the default right margin for text in TEXT-VIEW. Tags in the 1226 buffer may override the default. 1227 1228 TEXT-VIEW 1229 a '<gtk-text-view>' 1230 1231 RET 1232 right margin in pixels 1233 1234 -- Function: gtk-text-view-set-indent (self '<gtk-text-view>') 1235 (indent 'int') 1236 -- Method: set-indent 1237 Sets the default indentation for paragraphs in TEXT-VIEW. Tags in 1238 the buffer may override the default. 1239 1240 TEXT-VIEW 1241 a '<gtk-text-view>' 1242 1243 INDENT 1244 indentation in pixels 1245 1246 -- Function: gtk-text-view-get-indent (self '<gtk-text-view>') => 1247 (ret 'int') 1248 -- Method: get-indent 1249 Gets the default indentation of paragraphs in TEXT-VIEW. Tags in 1250 the view's buffer may override the default. The indentation may be 1251 negative. 1252 1253 TEXT-VIEW 1254 a '<gtk-text-view>' 1255 1256 RET 1257 number of pixels of indentation 1258 1259 -- Function: gtk-text-view-set-tabs (self '<gtk-text-view>') 1260 (tabs '<pango-tab-array>') 1261 -- Method: set-tabs 1262 Sets the default tab stops for paragraphs in TEXT-VIEW. Tags in 1263 the buffer may override the default. 1264 1265 TEXT-VIEW 1266 a '<gtk-text-view>' 1267 1268 TABS 1269 tabs as a '<pango-tab-array>' 1270 1271 -- Function: gtk-text-view-get-tabs (self '<gtk-text-view>') => 1272 (ret '<pango-tab-array>') 1273 -- Method: get-tabs 1274 Gets the default tabs for TEXT-VIEW. Tags in the buffer may 1275 override the defaults. The returned array will be ''#f'' if 1276 "standard" (8-space) tabs are used. Free the return value with 1277 'pango-tab-array-free'. 1278 1279 TEXT-VIEW 1280 a '<gtk-text-view>' 1281 1282 RET 1283 copy of default tab array, or ''#f'' if "standard" tabs are 1284 used; must be freed with 'pango-tab-array-free'. 1285 1286 -- Function: gtk-text-view-set-accepts-tab (self '<gtk-text-view>') 1287 (accepts_tab 'bool') 1288 -- Method: set-accepts-tab 1289 Sets the behavior of the text widget when the Tab key is pressed. 1290 If ACCEPTS-TAB is ''#t'' a tab character is inserted. If 1291 ACCEPTS-TAB is ''#f'' the keyboard focus is moved to the next 1292 widget in the focus chain. 1293 1294 TEXT-VIEW 1295 A '<gtk-text-view>' 1296 1297 ACCEPTS-TAB 1298 ''#t'' if pressing the Tab key should insert a tab character, 1299 ''#f'', if pressing the Tab key should move the keyboard 1300 focus. 1301 1302 Since 2.4 1303 1304 -- Function: gtk-text-view-get-accepts-tab (self '<gtk-text-view>') => 1305 (ret 'bool') 1306 -- Method: get-accepts-tab 1307 Returns whether pressing the Tab key inserts a tab characters. 1308 'gtk-text-view-set-accepts-tab'. 1309 1310 TEXT-VIEW 1311 A '<gtk-text-view>' 1312 1313 RET 1314 ''#t'' if pressing the Tab key inserts a tab character, ''#f'' 1315 if pressing the Tab key moves the keyboard focus. 1316 1317 Since 2.4 1318 1319 1320File: guile-gnome-gtk.info, Node: GtkTreeModel, Next: GtkTreeSelection, Prev: GtkTextView, Up: Top 1321 132232 GtkTreeModel 1323*************** 1324 1325The tree interface used by 1326 132732.1 Overview 1328============= 1329 1330The '<gtk-tree-model>' interface defines a generic tree interface for 1331use by the '<gtk-tree-view>' widget. It is an abstract interface, and 1332is designed to be usable with any appropriate data structure. The 1333programmer just has to implement this interface on their own data type 1334for it to be viewable by a '<gtk-tree-view>' widget. 1335 1336 The model is represented as a hierarchical tree of strongly-typed, 1337columned data. In other words, the model can be seen as a tree where 1338every node has different values depending on which column is being 1339queried. The type of data found in a column is determined by using the 1340GType system (ie. '<g-type-int>', '<gtk-type-button>', 1341'<g-type-pointer>', etc.). The types are homogeneous per column across 1342all nodes. It is important to note that this interface only provides a 1343way of examining a model and observing changes. The implementation of 1344each individual model decides how and if changes are made. 1345 1346 In order to make life simpler for programmers who do not need to 1347write their own specialized model, two generic models are provided 1348— the '<gtk-tree-store>' and the '<gtk-list-store>'. To use 1349these, the developer simply pushes data into these models as necessary. 1350These models provide the data structure as well as all appropriate tree 1351interfaces. As a result, implementing drag and drop, sorting, and 1352storing data is trivial. For the vast majority of trees and lists, 1353these two models are sufficient. 1354 1355 Models are accessed on a node/column level of granularity. One can 1356query for the value of a model at a certain node and a certain column on 1357that node. There are two structures used to reference a particular node 1358in a model. They are the '<gtk-tree-path>' and the '<gtk-tree-iter>' 1359Most of the interface consists of operations on a '<gtk-tree-iter>'. 1360 1361 Here, is short for 1362 1363 A path is essentially a potential node. It is a location on a model 1364that may or may not actually correspond to a node on a specific model. 1365The '<gtk-tree-path>' struct can be converted into either an array of 1366unsigned integers or a string. The string form is a list of numbers 1367separated by a colon. Each number refers to the offset at that level. 1368Thus, the path refers to the root node and the path refers to the fifth 1369child of the third node. 1370 1371 By contrast, a '<gtk-tree-iter>' is a reference to a specific node on 1372a specific model. It is a generic struct with an integer and three 1373generic pointers. These are filled in by the model in a model-specific 1374way. One can convert a path to an iterator by calling 1375'gtk-tree-model-get-iter'. These iterators are the primary way of 1376accessing a model and are similar to the iterators used by 1377'<gtk-text-buffer>'. They are generally statically allocated on the 1378stack and only used for a short time. The model interface defines a set 1379of operations using them for navigating the model. 1380 1381 It is expected that models fill in the iterator with private data. 1382For example, the '<gtk-list-store>' model, which is internally a simple 1383linked list, stores a list node in one of the pointers. The 1384'<gtk-tree-model-sort>' stores an array and an offset in two of the 1385pointers. Additionally, there is an integer field. This field is 1386generally filled with a unique stamp per model. This stamp is for 1387catching errors resulting from using invalid iterators with a model. 1388 1389 The lifecycle of an iterator can be a little confusing at first. 1390Iterators are expected to always be valid for as long as the model is 1391unchanged (and doesn't emit a signal). The model is considered to own 1392all outstanding iterators and nothing needs to be done to free them from 1393the user's point of view. Additionally, some models guarantee that an 1394iterator is valid for as long as the node it refers to is valid (most 1395notably the '<gtk-tree-store>' and '<gtk-list-store>'). Although 1396generally uninteresting, as one always has to allow for the case where 1397iterators do not persist beyond a signal, some very important 1398performance enhancements were made in the sort model. As a result, the 1399'<gtk-tree-model-iters-persist>' flag was added to indicate this 1400behavior. 1401 1402 To help show some common operation of a model, some examples are 1403provided. The first example shows three ways of getting the iter at the 1404location . While the first method shown is easier, the second is much 1405more common, as you often get paths from callbacks. 1406 1407 1408 /* Three ways of getting the iter pointing to the location 1409 */ 1410 { 1411 GtkTreePath *path; 1412 GtkTreeIter iter; 1413 GtkTreeIter parent_iter; 1414 1415 /* get the iterator from a string */ 1416 gtk_tree_model_get_iter_from_string (model, &iter, "3:2:5"); 1417 1418 /* get the iterator from a path */ 1419 path = gtk_tree_path_new_from_string ("3:2:5"); 1420 gtk_tree_model_get_iter (model, &iter, path); 1421 gtk_tree_path_free (path); 1422 1423 1424 /* walk the tree to find the iterator */ 1425 gtk_tree_model_iter_nth_child (model, &iter, NULL, 3); 1426 parent_iter = iter; 1427 gtk_tree_model_iter_nth_child (model, &iter, &parent_iter, 2); 1428 parent_iter = iter; 1429 gtk_tree_model_iter_nth_child (model, &iter, &parent_iter, 5); 1430 } 1431 1432 This second example shows a quick way of iterating through a list and 1433getting a string and an integer from each row. The 'populate-model' 1434function used below is not shown, as it is specific to the 1435'<gtk-list-store>'. For information on how to write such a function, 1436see the '<gtk-list-store>' documentation. 1437 1438 1439 enum 1440 { 1441 STRING_COLUMN, 1442 INT_COLUMN, 1443 N_COLUMNS 1444 }; 1445 1446 { 1447 GtkTreeModel *list_store; 1448 GtkTreeIter iter; 1449 gboolean valid; 1450 gint row_count = 0; 1451 1452 /* make a new list_store */ 1453 list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_INT); 1454 1455 /* Fill the list store with data */ 1456 populate_model (list_store); 1457 1458 /* Get the first iter in the list */ 1459 valid = gtk_tree_model_get_iter_first (list_store, &iter); 1460 1461 while (valid) 1462 { 1463 /* Walk through the list, reading each row */ 1464 gchar *str_data; 1465 gint int_data; 1466 1467 /* Make sure you terminate calls to gtk_tree_model_get() 1468 * with a '-1' value 1469 */ 1470 gtk_tree_model_get (list_store, &iter, 1471 STRING_COLUMN, &str_data, 1472 INT_COLUMN, &int_data, 1473 -1); 1474 1475 /* Do something with the data */ 1476 g_print ("Row %d: (%s,%d)\n", row_count, str_data, int_data); 1477 g_free (str_data); 1478 1479 row_count ++; 1480 valid = gtk_tree_model_iter_next (list_store, &iter); 1481 } 1482 } 1483 148432.2 Usage 1485========== 1486 1487 -- Class: <gtk-tree-model> 1488 Derives from '<ginterface>'. 1489 1490 This class defines no direct slots. 1491 1492 -- Signal on <gtk-tree-model>: row-changed (arg0 '<gtk-tree-path>') 1493 (arg1 '<gtk-tree-iter>') 1494 This signal is emitted when a row in the model has changed. 1495 1496 -- Signal on <gtk-tree-model>: row-inserted (arg0 '<gtk-tree-path>') 1497 (arg1 '<gtk-tree-iter>') 1498 This signal is emitted when a new row has been inserted in the 1499 model. 1500 1501 Note that the row may still be empty at this point, since it is a 1502 common pattern to first insert an empty row, and then fill it with 1503 the desired values. 1504 1505 -- Signal on <gtk-tree-model>: row-has-child-toggled 1506 (arg0 '<gtk-tree-path>') (arg1 '<gtk-tree-iter>') 1507 This signal is emitted when a row has gotten the first child row or 1508 lost its last child row. 1509 1510 -- Signal on <gtk-tree-model>: row-deleted (arg0 '<gtk-tree-path>') 1511 This signal is emitted when a row has been deleted. 1512 1513 Note that no iterator is passed to the signal handler, since the 1514 row is already deleted. 1515 1516 Implementations of GtkTreeModel must emit row-deleted _before_ 1517 removing the node from its internal data structures. This is 1518 because models and views which access and monitor this model might 1519 have references on the node which need to be released in the 1520 row-deleted handler. 1521 1522 -- Signal on <gtk-tree-model>: rows-reordered (arg0 '<gtk-tree-path>') 1523 (arg1 '<gtk-tree-iter>') (arg2 '<gpointer>') 1524 This signal is emitted when the children of a node in the 1525 '<gtk-tree-model>' have been reordered. 1526 1527 Note that this signal is _not_ emitted when rows are reordered by 1528 DND, since this is implemented by removing and then reinserting the 1529 row. 1530 1531 -- Class: <gtk-tree-iter> 1532 Derives from '<gboxed>'. 1533 1534 This class defines no direct slots. 1535 1536 -- Class: <gtk-tree-path> 1537 Derives from '<gboxed>'. 1538 1539 This class defines no direct slots. 1540 1541 -- Class: <gtk-tree-row-reference> 1542 Derives from '<gboxed>'. 1543 1544 This class defines no direct slots. 1545 1546 -- Function: gtk-tree-path-new-from-string (path 'mchars') 1547 (path 'mchars') => (ret '<gtk-tree-path>') 1548 Creates a new '<gtk-tree-path>' initialized to PATH. PATH is 1549 expected to be a colon separated list of numbers. For example, the 1550 string "10:4:0" would create a path of depth 3 pointing to the 11th 1551 child of the root node, the 5th child of that 11th child, and the 1552 1st child of that 5th child. If an invalid path string is passed 1553 in, ''#f'' is returned. 1554 1555 PATH 1556 The string representation of a path. 1557 1558 RET 1559 A newly-created '<gtk-tree-path>', or ''#f'' 1560 1561 -- Function: gtk-tree-path-append-index (self '<gtk-tree-path>') 1562 (index 'int') 1563 Appends a new index to a path. As a result, the depth of the path 1564 is increased. 1565 1566 PATH 1567 A '<gtk-tree-path>'. 1568 1569 INDEX 1570 The index. 1571 1572 -- Function: gtk-tree-path-prepend-index (self '<gtk-tree-path>') 1573 (index 'int') 1574 Prepends a new index to a path. As a result, the depth of the path 1575 is increased. 1576 1577 PATH 1578 A '<gtk-tree-path>'. 1579 1580 INDEX 1581 The index. 1582 1583 -- Function: gtk-tree-path-copy (self '<gtk-tree-path>') => 1584 (ret '<gtk-tree-path>') 1585 Creates a new '<gtk-tree-path>' as a copy of PATH. 1586 1587 PATH 1588 A '<gtk-tree-path>'. 1589 1590 RET 1591 A new '<gtk-tree-path>'. 1592 1593 -- Function: gtk-tree-row-reference-new (model '<gtk-tree-model>') 1594 (path '<gtk-tree-path>') => (ret '<gtk-tree-row-reference>') 1595 Creates a row reference based on PATH. This reference will keep 1596 pointing to the node pointed to by PATH, so long as it exists. It 1597 listens to all signals emitted by MODEL, and updates its path 1598 appropriately. If PATH isn't a valid path in MODEL, then ''#f'' is 1599 returned. 1600 1601 MODEL 1602 A '<gtk-tree-model>' 1603 1604 PATH 1605 A valid '<gtk-tree-path>' to monitor 1606 1607 RET 1608 A newly allocated '<gtk-tree-row-reference>', or ''#f'' 1609 1610 -- Function: gtk-tree-row-reference-new-proxy (proxy '<gobject>') 1611 (model '<gtk-tree-model>') (path '<gtk-tree-path>') => 1612 (ret '<gtk-tree-row-reference>') 1613 You do not need to use this function. Creates a row reference 1614 based on PATH. This reference will keep pointing to the node 1615 pointed to by PATH, so long as it exists. If PATH isn't a valid 1616 path in MODEL, then ''#f'' is returned. However, unlike references 1617 created with 'gtk-tree-row-reference-new', it does not listen to 1618 the model for changes. The creator of the row reference must do 1619 this explicitly using 'gtk-tree-row-reference-inserted', 1620 'gtk-tree-row-reference-deleted', 1621 'gtk-tree-row-reference-reordered'. 1622 1623 These functions must be called exactly once per proxy when the 1624 corresponding signal on the model is emitted. This single call 1625 updates all row references for that proxy. Since built-in GTK+ 1626 objects like '<gtk-tree-view>' already use this mechanism 1627 internally, using them as the proxy object will produce 1628 unpredictable results. Further more, passing the same object as 1629 MODEL and PROXY doesn't work for reasons of internal 1630 implementation. 1631 1632 This type of row reference is primarily meant by structures that 1633 need to carefully monitor exactly when a row reference updates 1634 itself, and is not generally needed by most applications. 1635 1636 PROXY 1637 A proxy '<gobject>' 1638 1639 MODEL 1640 A '<gtk-tree-model>' 1641 1642 PATH 1643 A valid '<gtk-tree-path>' to monitor 1644 1645 RET 1646 A newly allocated '<gtk-tree-row-reference>', or ''#f'' 1647 1648 -- Function: gtk-tree-row-reference-get-model 1649 (self '<gtk-tree-row-reference>') => (ret '<gtk-tree-model>') 1650 Returns the model that the row reference is monitoring. 1651 1652 REFERENCE 1653 A '<gtk-tree-row-reference>' 1654 1655 RET 1656 the model 1657 1658 Since 2.8 1659 1660 -- Function: gtk-tree-row-reference-get-path 1661 (self '<gtk-tree-row-reference>') => (ret '<gtk-tree-path>') 1662 Returns a path that the row reference currently points to, or 1663 ''#f'' if the path pointed to is no longer valid. 1664 1665 REFERENCE 1666 A '<gtk-tree-row-reference>' 1667 1668 RET 1669 A current path, or ''#f''. 1670 1671 -- Function: gtk-tree-row-reference-valid 1672 (self '<gtk-tree-row-reference>') => (ret 'bool') 1673 Returns ''#t'' if the REFERENCE is non-''#f'' and refers to a 1674 current valid path. 1675 1676 REFERENCE 1677 A '<gtk-tree-row-reference>', or ''#f'' 1678 1679 RET 1680 ''#t'' if REFERENCE points to a valid path. 1681 1682 -- Function: gtk-tree-row-reference-inserted (proxy '<gobject>') 1683 (path '<gtk-tree-path>') 1684 Lets a set of row reference created by 1685 'gtk-tree-row-reference-new-proxy' know that the model emitted the 1686 "row_inserted" signal. 1687 1688 PROXY 1689 A '<gobject>' 1690 1691 PATH 1692 The row position that was inserted 1693 1694 -- Function: gtk-tree-row-reference-deleted (proxy '<gobject>') 1695 (path '<gtk-tree-path>') 1696 Lets a set of row reference created by 1697 'gtk-tree-row-reference-new-proxy' know that the model emitted the 1698 "row_deleted" signal. 1699 1700 PROXY 1701 A '<gobject>' 1702 1703 PATH 1704 The path position that was deleted 1705 1706 -- Function: gtk-tree-row-reference-reordered (proxy '<gobject>') 1707 (path '<gtk-tree-path>') (iter '<gtk-tree-iter>') => 1708 (new_order 'int') 1709 Lets a set of row reference created by 1710 'gtk-tree-row-reference-new-proxy' know that the model emitted the 1711 "rows_reordered" signal. 1712 1713 PROXY 1714 A '<gobject>' 1715 1716 PATH 1717 The parent path of the reordered signal 1718 1719 ITER 1720 The iter pointing to the parent of the reordered 1721 1722 NEW-ORDER 1723 The new order of rows 1724 1725 -- Function: gtk-tree-iter-copy (self '<gtk-tree-iter>') => 1726 (ret '<gtk-tree-iter>') 1727 Creates a dynamically allocated tree iterator as a copy of ITER. 1728 This function is not intended for use in applications, because you 1729 can just copy the structs by value ('GtkTreeIter new_iter = 1730 iter;'). You must free this iter with 'gtk-tree-iter-free'. 1731 1732 ITER 1733 A '<gtk-tree-iter>'. 1734 1735 RET 1736 a newly-allocated copy of ITER. 1737 1738 -- Function: gtk-tree-model-get-flags (self '<gtk-tree-model>') => 1739 (ret '<gtk-tree-model-flags>') 1740 -- Method: get-flags 1741 Returns a set of flags supported by this interface. The flags are 1742 a bitwise combination of '<gtk-tree-model-flags>'. The flags 1743 supported should not change during the lifecycle of the TREE-MODEL. 1744 1745 TREE-MODEL 1746 A '<gtk-tree-model>'. 1747 1748 RET 1749 The flags supported by this interface. 1750 1751 -- Function: gtk-tree-model-get-n-columns (self '<gtk-tree-model>') => 1752 (ret 'int') 1753 -- Method: get-n-columns 1754 Returns the number of columns supported by TREE-MODEL. 1755 1756 TREE-MODEL 1757 A '<gtk-tree-model>'. 1758 1759 RET 1760 The number of columns. 1761 1762 -- Function: gtk-tree-model-get-column-type (self '<gtk-tree-model>') 1763 (index 'int') => (ret '<gtype>') 1764 -- Method: get-column-type 1765 Returns the type of the column. 1766 1767 TREE-MODEL 1768 A '<gtk-tree-model>'. 1769 1770 INDEX 1771 The column index. 1772 1773 RET 1774 The type of the column. 1775 1776 -- Function: gtk-tree-model-get-iter (self '<gtk-tree-model>') 1777 (path '<gtk-tree-path>') => (ret '<gtk-tree-iter>') 1778 -- Method: get-iter 1779 Sets ITER to a valid iterator pointing to PATH. 1780 1781 TREE-MODEL 1782 A '<gtk-tree-model>'. 1783 1784 ITER 1785 The uninitialized '<gtk-tree-iter>'. 1786 1787 PATH 1788 The '<gtk-tree-path>'. 1789 1790 RET 1791 ''#t'', if ITER was set. 1792 1793 -- Function: gtk-tree-model-get-iter-first (self '<gtk-tree-model>') 1794 => (ret '<gtk-tree-iter>') 1795 -- Method: get-iter-first 1796 Initializes ITER with the first iterator in the tree (the one at 1797 the path "0") and returns ''#t''. Returns ''#f'' if the tree is 1798 empty. 1799 1800 TREE-MODEL 1801 A '<gtk-tree-model>'. 1802 1803 ITER 1804 The uninitialized '<gtk-tree-iter>'. 1805 1806 RET 1807 ''#t'', if ITER was set. 1808 1809 -- Function: gtk-tree-model-get-path (self '<gtk-tree-model>') 1810 (iter '<gtk-tree-iter>') => (ret '<gtk-tree-path>') 1811 -- Method: get-path 1812 Returns a newly-created '<gtk-tree-path>' referenced by ITER. This 1813 path should be freed with 'gtk-tree-path-free'. 1814 1815 TREE-MODEL 1816 A '<gtk-tree-model>'. 1817 1818 ITER 1819 The '<gtk-tree-iter>'. 1820 1821 RET 1822 a newly-created '<gtk-tree-path>'. 1823 1824 -- Function: gtk-tree-model-get-value (self '<gtk-tree-model>') 1825 (iter '<gtk-tree-iter>') (column 'int') => (ret 'scm') 1826 -- Method: get-value 1827 Sets initializes and sets VALUE to that at COLUMN. When done with 1828 VALUE, 'g-value-unset' needs to be called to free any allocated 1829 memory. 1830 1831 TREE-MODEL 1832 A '<gtk-tree-model>'. 1833 1834 ITER 1835 The '<gtk-tree-iter>'. 1836 1837 COLUMN 1838 The column to lookup the value at. 1839 1840 VALUE 1841 An empty '<gvalue>' to set. 1842 1843 -- Function: gtk-tree-model-iter-next (self '<gtk-tree-model>') 1844 (iter '<gtk-tree-iter>') => (ret '<gtk-tree-iter>') 1845 -- Method: iter-next 1846 Sets ITER to point to the node following it at the current level. 1847 If there is no next ITER, ''#f'' is returned and ITER is set to be 1848 invalid. 1849 1850 TREE-MODEL 1851 A '<gtk-tree-model>'. 1852 1853 ITER 1854 The '<gtk-tree-iter>'. 1855 1856 RET 1857 ''#t'' if ITER has been changed to the next node. 1858 1859 -- Function: gtk-tree-model-iter-children (self '<gtk-tree-model>') 1860 (parent '<gtk-tree-iter>') => (ret 'glist-of') 1861 -- Method: iter-children 1862 Sets ITER to point to the first child of PARENT. If PARENT has no 1863 children, ''#f'' is returned and ITER is set to be invalid. PARENT 1864 will remain a valid node after this function has been called. 1865 1866 If PARENT is ''#f'' returns the first node, equivalent to 1867 'gtk_tree_model_get_iter_first (tree_model, iter);' 1868 1869 TREE-MODEL 1870 A '<gtk-tree-model>'. 1871 1872 ITER 1873 The new '<gtk-tree-iter>' to be set to the child. 1874 1875 PARENT 1876 The '<gtk-tree-iter>', or ''#f'' 1877 1878 RET 1879 ''#t'', if CHILD has been set to the first child. 1880 1881 -- Function: gtk-tree-model-iter-has-child (self '<gtk-tree-model>') 1882 (iter '<gtk-tree-iter>') => (ret 'bool') 1883 -- Method: iter-has-child 1884 Returns ''#t'' if ITER has children, ''#f'' otherwise. 1885 1886 TREE-MODEL 1887 A '<gtk-tree-model>'. 1888 1889 ITER 1890 The '<gtk-tree-iter>' to test for children. 1891 1892 RET 1893 ''#t'' if ITER has children. 1894 1895 -- Function: gtk-tree-model-iter-n-children (self '<gtk-tree-model>') 1896 (iter '<gtk-tree-iter>') => (ret 'int') 1897 -- Method: iter-n-children 1898 Returns the number of children that ITER has. As a special case, 1899 if ITER is ''#f'', then the number of toplevel nodes is returned. 1900 1901 TREE-MODEL 1902 A '<gtk-tree-model>'. 1903 1904 ITER 1905 The '<gtk-tree-iter>', or ''#f''. 1906 1907 RET 1908 The number of children of ITER. 1909 1910 -- Function: gtk-tree-model-iter-nth-child (self '<gtk-tree-model>') 1911 (parent '<gtk-tree-iter>') (n 'int') => 1912 (ret '<gtk-tree-iter>') 1913 -- Method: iter-nth-child 1914 Sets ITER to be the child of PARENT, using the given index. The 1915 first index is 0. If N is too big, or PARENT has no children, ITER 1916 is set to an invalid iterator and ''#f'' is returned. PARENT will 1917 remain a valid node after this function has been called. As a 1918 special case, if PARENT is ''#f'', then the Nth root node is set. 1919 1920 TREE-MODEL 1921 A '<gtk-tree-model>'. 1922 1923 ITER 1924 The '<gtk-tree-iter>' to set to the nth child. 1925 1926 PARENT 1927 The '<gtk-tree-iter>' to get the child from, or ''#f''. 1928 1929 N 1930 Then index of the desired child. 1931 1932 RET 1933 ''#t'', if PARENT has an Nth child. 1934 1935 -- Function: gtk-tree-model-iter-parent (self '<gtk-tree-model>') 1936 (child '<gtk-tree-iter>') => (ret '<gtk-tree-iter>') 1937 -- Method: iter-parent 1938 Sets ITER to be the parent of CHILD. If CHILD is at the toplevel, 1939 and doesn't have a parent, then ITER is set to an invalid iterator 1940 and ''#f'' is returned. CHILD will remain a valid node after this 1941 function has been called. 1942 1943 TREE-MODEL 1944 A '<gtk-tree-model>' 1945 1946 ITER 1947 The new '<gtk-tree-iter>' to set to the parent. 1948 1949 CHILD 1950 The '<gtk-tree-iter>'. 1951 1952 RET 1953 ''#t'', if ITER is set to the parent of CHILD. 1954 1955 -- Function: gtk-tree-model-get-string-from-iter 1956 (self '<gtk-tree-model>') (iter '<gtk-tree-iter>') => 1957 (ret 'mchars') 1958 -- Method: get-string-from-iter 1959 Generates a string representation of the iter. This string is a 1960 ':' separated list of numbers. For example, "4:10:0:3" would be an 1961 acceptable return value for this string. 1962 1963 TREE-MODEL 1964 A '<gtk-tree-model>'. 1965 1966 ITER 1967 An '<gtk-tree-iter>'. 1968 1969 RET 1970 A newly-allocated string. Must be freed with 'g-free'. 1971 1972 Since 2.2 1973 1974 -- Function: gtk-tree-model-ref-node (self '<gtk-tree-model>') 1975 (iter '<gtk-tree-iter>') 1976 -- Method: ref-node 1977 Lets the tree ref the node. This is an optional method for models 1978 to implement. To be more specific, models may ignore this call as 1979 it exists primarily for performance reasons. 1980 1981 This function is primarily meant as a way for views to let caching 1982 model know when nodes are being displayed (and hence, whether or 1983 not to cache that node.) For example, a file-system based model 1984 would not want to keep the entire file-hierarchy in memory, just 1985 the sections that are currently being displayed by every current 1986 view. 1987 1988 A model should be expected to be able to get an iter independent of 1989 its reffed state. 1990 1991 TREE-MODEL 1992 A '<gtk-tree-model>'. 1993 1994 ITER 1995 The '<gtk-tree-iter>'. 1996 1997 -- Function: gtk-tree-model-unref-node (self '<gtk-tree-model>') 1998 (iter '<gtk-tree-iter>') 1999 -- Method: unref-node 2000 Lets the tree unref the node. This is an optional method for 2001 models to implement. To be more specific, models may ignore this 2002 call as it exists primarily for performance reasons. 2003 2004 For more information on what this means, see 2005 'gtk-tree-model-ref-node'. Please note that nodes that are deleted 2006 are not unreffed. 2007 2008 TREE-MODEL 2009 A '<gtk-tree-model>'. 2010 2011 ITER 2012 The '<gtk-tree-iter>'. 2013 2014 -- Function: gtk-tree-model-row-changed (self '<gtk-tree-model>') 2015 (path '<gtk-tree-path>') (iter '<gtk-tree-iter>') 2016 -- Method: row-changed 2017 Emits the "row_changed" signal on TREE-MODEL. 2018 2019 TREE-MODEL 2020 A '<gtk-tree-model>' 2021 2022 PATH 2023 A '<gtk-tree-path>' pointing to the changed row 2024 2025 ITER 2026 A valid '<gtk-tree-iter>' pointing to the changed row 2027 2028 -- Function: gtk-tree-model-row-inserted (self '<gtk-tree-model>') 2029 (path '<gtk-tree-path>') (iter '<gtk-tree-iter>') 2030 -- Method: row-inserted 2031 Emits the "row_inserted" signal on TREE-MODEL 2032 2033 TREE-MODEL 2034 A '<gtk-tree-model>' 2035 2036 PATH 2037 A '<gtk-tree-path>' pointing to the inserted row 2038 2039 ITER 2040 A valid '<gtk-tree-iter>' pointing to the inserted row 2041 2042 -- Function: gtk-tree-model-row-deleted (self '<gtk-tree-model>') 2043 (path '<gtk-tree-path>') 2044 -- Method: row-deleted 2045 Emits the "row_deleted" signal on TREE-MODEL. This should be 2046 called by models after a row has been removed. The location 2047 pointed to by PATH should be the location that the row previously 2048 was at. It may not be a valid location anymore. 2049 2050 TREE-MODEL 2051 A '<gtk-tree-model>' 2052 2053 PATH 2054 A '<gtk-tree-path>' pointing to the previous location of the 2055 deleted row. 2056 2057 -- Function: gtk-tree-model-rows-reordered (self '<gtk-tree-model>') 2058 (path '<gtk-tree-path>') (iter '<gtk-tree-iter>') => 2059 (new_order 'int') 2060 -- Method: rows-reordered 2061 Emits the "rows_reordered" signal on TREE-MODEL. This should be 2062 called by models when their rows have been reordered. 2063 2064 TREE-MODEL 2065 A '<gtk-tree-model>' 2066 2067 PATH 2068 A '<gtk-tree-path>' pointing to the tree node whose children 2069 have been reordered 2070 2071 ITER 2072 A valid '<gtk-tree-iter>' pointing to the node whose children 2073 have been reordered, or ''#f'' if the depth of PATH is 0. 2074 2075 NEW-ORDER 2076 an array of integers mapping the current position of each 2077 child to its old position before the re-ordering, i.e. 2078 NEW-ORDER'[newpos] = oldpos'. 2079 2080 2081File: guile-gnome-gtk.info, Node: GtkTreeSelection, Next: GtkTreeViewColumn, Prev: GtkTreeModel, Up: Top 2082 208333 GtkTreeSelection 2084******************* 2085 2086The selection object for 2087 208833.1 Overview 2089============= 2090 2091The '<gtk-tree-selection>' object is a helper object to manage the 2092selection for a '<gtk-tree-view>' widget. The '<gtk-tree-selection>' 2093object is automatically created when a new '<gtk-tree-view>' widget is 2094created, and cannot exist independentally of this widget. The primary 2095reason the '<gtk-tree-selection>' objects exists is for cleanliness of 2096code and API. That is, there is no conceptual reason all these functions 2097could not be methods on the '<gtk-tree-view>' widget instead of a 2098separate function. 2099 2100 The '<gtk-tree-selection>' object is gotten from a '<gtk-tree-view>' 2101by calling 'gtk-tree-view-get-selection'. It can be manipulated to 2102check the selection status of the tree, as well as select and deselect 2103individual rows. Selection is done completely view side. As a result, 2104multiple views of the same model can have completely different 2105selections. Additionally, you cannot change the selection of a row on 2106the model that is not currently displayed by the view without expanding 2107its parents first. 2108 2109 One of the important things to remember when monitoring the selection 2110of a view is that the "changed" signal is mostly a hint. That is, it 2111may only emit one signal when a range of rows is selected. 2112Additionally, it may on occasion emit a "changed" signal when nothing 2113has happened (mostly as a result of programmers calling select_row on an 2114already selected row). 2115 211633.2 Usage 2117========== 2118 2119 -- Class: <gtk-tree-selection> 2120 Derives from '<gobject>'. 2121 2122 This class defines no direct slots. 2123 2124 -- Signal on <gtk-tree-selection>: changed 2125 Emitted whenever the selection has (possibly) changed. Please note 2126 that this signal is mostly a hint. It may only be emitted once 2127 when a range of rows are selected, and it may occasionally be 2128 emitted when nothing has happened. 2129 2130 -- Function: gtk-tree-selection-set-mode (self '<gtk-tree-selection>') 2131 (type '<gtk-selection-mode>') 2132 -- Method: set-mode 2133 Sets the selection mode of the SELECTION. If the previous type was 2134 '<gtk-selection-multiple>', then the anchor is kept selected, if it 2135 was previously selected. 2136 2137 SELECTION 2138 A '<gtk-tree-selection>'. 2139 2140 TYPE 2141 The selection mode 2142 2143 -- Function: gtk-tree-selection-get-mode (self '<gtk-tree-selection>') 2144 => (ret '<gtk-selection-mode>') 2145 -- Method: get-mode 2146 Gets the selection mode for SELECTION. See 2147 'gtk-tree-selection-set-mode'. 2148 2149 SELECTION 2150 a '<gtk-tree-selection>' 2151 2152 RET 2153 the current selection mode 2154 2155 -- Function: gtk-tree-selection-get-tree-view 2156 (self '<gtk-tree-selection>') => (ret '<gtk-tree-view>') 2157 -- Method: get-tree-view 2158 Returns the tree view associated with SELECTION. 2159 2160 SELECTION 2161 A '<gtk-tree-selection>' 2162 2163 RET 2164 A '<gtk-tree-view>' 2165 2166 -- Function: gtk-tree-selection-get-selected 2167 (self '<gtk-tree-selection>') => (model '<gtk-tree-model>') 2168 (iter '<gtk-tree-iter>') 2169 -- Method: get-selected 2170 -- Method: get-selected 2171 Retrieve the current selection, if SELECTION is set to 2172 '<gtk-selection-single>' or '<gtk-selection-browse>'. 2173 2174 This function will not work if you use SELECTION is 2175 '<gtk-selection-multiple>'. 2176 2177 SELECTION 2178 A '<gtk-tree-selection>'. 2179 2180 MODEL 2181 A pointer to set to the '<gtk-tree-model>', or NULL. 2182 2183 ITER 2184 The '<gtk-tree-iter>', or NULL. 2185 2186 -- Function: gtk-tree-selection-select-path 2187 (self '<gtk-tree-selection>') (path '<gtk-tree-path>') 2188 -- Method: select-path 2189 Select the row at PATH. 2190 2191 SELECTION 2192 A '<gtk-tree-selection>'. 2193 2194 PATH 2195 The '<gtk-tree-path>' to be selected. 2196 2197 -- Function: gtk-tree-selection-unselect-path 2198 (self '<gtk-tree-selection>') (path '<gtk-tree-path>') 2199 -- Method: unselect-path 2200 Unselects the row at PATH. 2201 2202 SELECTION 2203 A '<gtk-tree-selection>'. 2204 2205 PATH 2206 The '<gtk-tree-path>' to be unselected. 2207 2208 -- Function: gtk-tree-selection-path-is-selected 2209 (self '<gtk-tree-selection>') (path '<gtk-tree-path>') => 2210 (ret 'bool') 2211 -- Method: path-is-selected 2212 Returns ''#t'' if the row pointed to by PATH is currently selected. 2213 If PATH does not point to a valid location, ''#f'' is returned 2214 2215 SELECTION 2216 A '<gtk-tree-selection>'. 2217 2218 PATH 2219 A '<gtk-tree-path>' to check selection on. 2220 2221 RET 2222 ''#t'' if PATH is selected. 2223 2224 -- Function: gtk-tree-selection-select-iter 2225 (self '<gtk-tree-selection>') (iter '<gtk-tree-iter>') 2226 -- Method: select-iter 2227 Selects the specified iterator. 2228 2229 SELECTION 2230 A '<gtk-tree-selection>'. 2231 2232 ITER 2233 The '<gtk-tree-iter>' to be selected. 2234 2235 -- Function: gtk-tree-selection-unselect-iter 2236 (self '<gtk-tree-selection>') (iter '<gtk-tree-iter>') 2237 -- Method: unselect-iter 2238 Unselects the specified iterator. 2239 2240 SELECTION 2241 A '<gtk-tree-selection>'. 2242 2243 ITER 2244 The '<gtk-tree-iter>' to be unselected. 2245 2246 -- Function: gtk-tree-selection-iter-is-selected 2247 (self '<gtk-tree-selection>') (iter '<gtk-tree-iter>') => 2248 (ret 'bool') 2249 -- Method: iter-is-selected 2250 Returns ''#t'' if the row at ITER is currently selected. 2251 2252 SELECTION 2253 A '<gtk-tree-selection>' 2254 2255 ITER 2256 A valid '<gtk-tree-iter>' 2257 2258 RET 2259 ''#t'', if ITER is selected 2260 2261 -- Function: gtk-tree-selection-select-all 2262 (self '<gtk-tree-selection>') 2263 -- Method: select-all 2264 Selects all the nodes. SELECTION must be set to 2265 '<gtk-selection-multiple>' mode. 2266 2267 SELECTION 2268 A '<gtk-tree-selection>'. 2269 2270 -- Function: gtk-tree-selection-unselect-all 2271 (self '<gtk-tree-selection>') 2272 -- Method: unselect-all 2273 Unselects all the nodes. 2274 2275 SELECTION 2276 A '<gtk-tree-selection>'. 2277 2278 -- Function: gtk-tree-selection-select-range 2279 (self '<gtk-tree-selection>') (start_path '<gtk-tree-path>') 2280 (end_path '<gtk-tree-path>') 2281 -- Method: select-range 2282 Selects a range of nodes, determined by START-PATH and END-PATH 2283 inclusive. SELECTION must be set to '<gtk-selection-multiple>' 2284 mode. 2285 2286 SELECTION 2287 A '<gtk-tree-selection>'. 2288 2289 START-PATH 2290 The initial node of the range. 2291 2292 END-PATH 2293 The final node of the range. 2294 2295 -- Function: gtk-tree-selection-unselect-range 2296 (self '<gtk-tree-selection>') (start_path '<gtk-tree-path>') 2297 (end_path '<gtk-tree-path>') 2298 -- Method: unselect-range 2299 Unselects a range of nodes, determined by START-PATH and END-PATH 2300 inclusive. 2301 2302 SELECTION 2303 A '<gtk-tree-selection>'. 2304 2305 START-PATH 2306 The initial node of the range. 2307 2308 END-PATH 2309 The initial node of the range. 2310 2311 Since 2.2 2312 2313 2314File: guile-gnome-gtk.info, Node: GtkTreeViewColumn, Next: GtkTreeView, Prev: GtkTreeSelection, Up: Top 2315 231634 GtkTreeViewColumn 2317******************** 2318 2319A visible column in a widget 2320 232134.1 Overview 2322============= 2323 2324The GtkTreeViewColumn object represents a visible column in a 2325'<gtk-tree-view>' widget. It allows to set properties of the column 2326header, and functions as a holding pen for the cell renderers which 2327determine how the data in the column is displayed. 2328 2329 Please refer to the tree widget conceptual overview for an overview 2330of all the objects and data types related to the tree widget and how 2331they work together. 2332 233334.2 Usage 2334========== 2335 2336 -- Class: <gtk-tree-view-column> 2337 Derives from '<gtk-buildable>', '<gtk-cell-layout>', 2338 '<gtk-object>'. 2339 2340 This class defines the following slots: 2341 2342 'visible' 2343 Whether to display the column 2344 2345 'resizable' 2346 Column is user-resizable 2347 2348 'width' 2349 Current width of the column 2350 2351 'spacing' 2352 Space which is inserted between cells 2353 2354 'sizing' 2355 Resize mode of the column 2356 2357 'fixed-width' 2358 Current fixed width of the column 2359 2360 'min-width' 2361 Minimum allowed width of the column 2362 2363 'max-width' 2364 Maximum allowed width of the column 2365 2366 'title' 2367 Title to appear in column header 2368 2369 'expand' 2370 Column gets share of extra width allocated to the widget 2371 2372 'clickable' 2373 Whether the header can be clicked 2374 2375 'widget' 2376 Widget to put in column header button instead of column title 2377 2378 'alignment' 2379 X Alignment of the column header text or widget 2380 2381 'reorderable' 2382 Whether the column can be reordered around the headers 2383 2384 'sort-indicator' 2385 Whether to show a sort indicator 2386 2387 'sort-order' 2388 Sort direction the sort indicator should indicate 2389 2390 -- Signal on <gtk-tree-view-column>: clicked 2391 2392 -- Function: gtk-tree-view-column-new => 2393 (ret '<gtk-tree-view-column>') 2394 Creates a new '<gtk-tree-view-column>'. 2395 2396 RET 2397 A newly created '<gtk-tree-view-column>'. 2398 2399 -- Function: gtk-tree-view-column-pack-start 2400 (self '<gtk-tree-view-column>') (cell '<gtk-cell-renderer>') 2401 (expand 'bool') 2402 -- Method: pack-start 2403 Packs the CELL into the beginning of the column. If EXPAND is 2404 ''#f'', then the CELL is allocated no more space than it needs. 2405 Any unused space is divided evenly between cells for which EXPAND 2406 is ''#t''. 2407 2408 TREE-COLUMN 2409 A '<gtk-tree-view-column>'. 2410 2411 CELL 2412 The '<gtk-cell-renderer>'. 2413 2414 EXPAND 2415 ''#t'' if CELL is to be given extra space allocated to 2416 TREE-COLUMN. 2417 2418 -- Function: gtk-tree-view-column-pack-end 2419 (self '<gtk-tree-view-column>') (cell '<gtk-cell-renderer>') 2420 (expand 'bool') 2421 -- Method: pack-end 2422 Adds the CELL to end of the column. If EXPAND is ''#f'', then the 2423 CELL is allocated no more space than it needs. Any unused space is 2424 divided evenly between cells for which EXPAND is ''#t''. 2425 2426 TREE-COLUMN 2427 A '<gtk-tree-view-column>'. 2428 2429 CELL 2430 The '<gtk-cell-renderer>'. 2431 2432 EXPAND 2433 ''#t'' if CELL is to be given extra space allocated to 2434 TREE-COLUMN. 2435 2436 -- Function: gtk-tree-view-column-clear (self '<gtk-tree-view-column>') 2437 -- Method: clear 2438 Unsets all the mappings on all renderers on the TREE-COLUMN. 2439 2440 TREE-COLUMN 2441 A '<gtk-tree-view-column>' 2442 2443 -- Function: gtk-tree-view-column-add-attribute 2444 (self '<gtk-tree-view-column>') 2445 (cell_renderer '<gtk-cell-renderer>') (attribute 'mchars') 2446 (column 'int') 2447 -- Method: add-attribute 2448 Adds an attribute mapping to the list in TREE-COLUMN. The COLUMN 2449 is the column of the model to get a value from, and the ATTRIBUTE 2450 is the parameter on CELL-RENDERER to be set from the value. So for 2451 example if column 2 of the model contains strings, you could have 2452 the "text" attribute of a '<gtk-cell-renderer-text>' get its values 2453 from column 2. 2454 2455 TREE-COLUMN 2456 A '<gtk-tree-view-column>'. 2457 2458 CELL-RENDERER 2459 the '<gtk-cell-renderer>' to set attributes on 2460 2461 ATTRIBUTE 2462 An attribute on the renderer 2463 2464 COLUMN 2465 The column position on the model to get the attribute from. 2466 2467 -- Function: gtk-tree-view-column-set-spacing 2468 (self '<gtk-tree-view-column>') (spacing 'int') 2469 -- Method: set-spacing 2470 Sets the spacing field of TREE-COLUMN, which is the number of 2471 pixels to place between cell renderers packed into it. 2472 2473 TREE-COLUMN 2474 A '<gtk-tree-view-column>'. 2475 2476 SPACING 2477 distance between cell renderers in pixels. 2478 2479 -- Function: gtk-tree-view-column-get-spacing 2480 (self '<gtk-tree-view-column>') => (ret 'int') 2481 -- Method: get-spacing 2482 Returns the spacing of TREE-COLUMN. 2483 2484 TREE-COLUMN 2485 A '<gtk-tree-view-column>'. 2486 2487 RET 2488 the spacing of TREE-COLUMN. 2489 2490 -- Function: gtk-tree-view-column-set-visible 2491 (self '<gtk-tree-view-column>') (visible 'bool') 2492 -- Method: set-visible 2493 Sets the visibility of TREE-COLUMN. 2494 2495 TREE-COLUMN 2496 A '<gtk-tree-view-column>'. 2497 2498 VISIBLE 2499 ''#t'' if the TREE-COLUMN is visible. 2500 2501 -- Function: gtk-tree-view-column-get-visible 2502 (self '<gtk-tree-view-column>') => (ret 'bool') 2503 -- Method: get-visible 2504 Returns ''#t'' if TREE-COLUMN is visible. 2505 2506 TREE-COLUMN 2507 A '<gtk-tree-view-column>'. 2508 2509 RET 2510 whether the column is visible or not. If it is visible, then 2511 the tree will show the column. 2512 2513 -- Function: gtk-tree-view-column-set-resizable 2514 (self '<gtk-tree-view-column>') (resizable 'bool') 2515 -- Method: set-resizable 2516 If RESIZABLE is ''#t'', then the user can explicitly resize the 2517 column by grabbing the outer edge of the column button. If 2518 resizable is ''#t'' and sizing mode of the column is 2519 '<gtk-tree-view-column-autosize>', then the sizing mode is changed 2520 to '<gtk-tree-view-column-grow-only>'. 2521 2522 TREE-COLUMN 2523 A '<gtk-tree-view-column>' 2524 2525 RESIZABLE 2526 ''#t'', if the column can be resized 2527 2528 -- Function: gtk-tree-view-column-get-resizable 2529 (self '<gtk-tree-view-column>') => (ret 'bool') 2530 -- Method: get-resizable 2531 Returns ''#t'' if the TREE-COLUMN can be resized by the end user. 2532 2533 TREE-COLUMN 2534 A '<gtk-tree-view-column>' 2535 2536 RET 2537 ''#t'', if the TREE-COLUMN can be resized. 2538 2539 -- Function: gtk-tree-view-column-set-sizing 2540 (self '<gtk-tree-view-column>') 2541 (type '<gtk-tree-view-column-sizing>') 2542 -- Method: set-sizing 2543 Sets the growth behavior of TREE-COLUMN to TYPE. 2544 2545 TREE-COLUMN 2546 A '<gtk-tree-view-column>'. 2547 2548 TYPE 2549 The '<gtk-tree-view-column-sizing>'. 2550 2551 -- Function: gtk-tree-view-column-get-sizing 2552 (self '<gtk-tree-view-column>') => 2553 (ret '<gtk-tree-view-column-sizing>') 2554 -- Method: get-sizing 2555 Returns the current type of TREE-COLUMN. 2556 2557 TREE-COLUMN 2558 A '<gtk-tree-view-column>'. 2559 2560 RET 2561 The type of TREE-COLUMN. 2562 2563 -- Function: gtk-tree-view-column-get-width 2564 (self '<gtk-tree-view-column>') => (ret 'int') 2565 -- Method: get-width 2566 Returns the current size of TREE-COLUMN in pixels. 2567 2568 TREE-COLUMN 2569 A '<gtk-tree-view-column>'. 2570 2571 RET 2572 The current width of TREE-COLUMN. 2573 2574 -- Function: gtk-tree-view-column-set-min-width 2575 (self '<gtk-tree-view-column>') (min_width 'int') 2576 -- Method: set-min-width 2577 Sets the minimum width of the TREE-COLUMN. If MIN-WIDTH is -1, 2578 then the minimum width is unset. 2579 2580 TREE-COLUMN 2581 A '<gtk-tree-view-column>'. 2582 2583 MIN-WIDTH 2584 The minimum width of the column in pixels, or -1. 2585 2586 -- Function: gtk-tree-view-column-get-min-width 2587 (self '<gtk-tree-view-column>') => (ret 'int') 2588 -- Method: get-min-width 2589 Returns the minimum width in pixels of the TREE-COLUMN, or -1 if no 2590 minimum width is set. 2591 2592 TREE-COLUMN 2593 A '<gtk-tree-view-column>'. 2594 2595 RET 2596 The minimum width of the TREE-COLUMN. 2597 2598 -- Function: gtk-tree-view-column-set-max-width 2599 (self '<gtk-tree-view-column>') (max_width 'int') 2600 -- Method: set-max-width 2601 Sets the maximum width of the TREE-COLUMN. If MAX-WIDTH is -1, 2602 then the maximum width is unset. Note, the column can actually be 2603 wider than max width if it's the last column in a view. In this 2604 case, the column expands to fill any extra space. 2605 2606 TREE-COLUMN 2607 A '<gtk-tree-view-column>'. 2608 2609 MAX-WIDTH 2610 The maximum width of the column in pixels, or -1. 2611 2612 -- Function: gtk-tree-view-column-get-max-width 2613 (self '<gtk-tree-view-column>') => (ret 'int') 2614 -- Method: get-max-width 2615 Returns the maximum width in pixels of the TREE-COLUMN, or -1 if no 2616 maximum width is set. 2617 2618 TREE-COLUMN 2619 A '<gtk-tree-view-column>'. 2620 2621 RET 2622 The maximum width of the TREE-COLUMN. 2623 2624 -- Function: gtk-tree-view-column-clicked 2625 (self '<gtk-tree-view-column>') 2626 -- Method: clicked 2627 Emits the "clicked" signal on the column. This function will only 2628 work if TREE-COLUMN is clickable. 2629 2630 TREE-COLUMN 2631 a '<gtk-tree-view-column>' 2632 2633 -- Function: gtk-tree-view-column-set-title 2634 (self '<gtk-tree-view-column>') (title 'mchars') 2635 -- Method: set-title 2636 Sets the title of the TREE-COLUMN. If a custom widget has been 2637 set, then this value is ignored. 2638 2639 TREE-COLUMN 2640 A '<gtk-tree-view-column>'. 2641 2642 TITLE 2643 The title of the TREE-COLUMN. 2644 2645 -- Function: gtk-tree-view-column-get-title 2646 (self '<gtk-tree-view-column>') => (ret 'mchars') 2647 -- Method: get-title 2648 Returns the title of the widget. 2649 2650 TREE-COLUMN 2651 A '<gtk-tree-view-column>'. 2652 2653 RET 2654 the title of the column. This string should not be modified 2655 or freed. 2656 2657 -- Function: gtk-tree-view-column-set-expand 2658 (self '<gtk-tree-view-column>') (expand 'bool') 2659 -- Method: set-expand 2660 Sets the column to take available extra space. This space is 2661 shared equally amongst all columns that have the expand set to 2662 ''#t''. If no column has this option set, then the last column 2663 gets all extra space. By default, every column is created with 2664 this ''#f''. 2665 2666 TREE-COLUMN 2667 A '<gtk-tree-view-column>' 2668 2669 EXPAND 2670 ''#t'' if the column should take available extra space, ''#f'' 2671 if not 2672 2673 Since 2.4 2674 2675 -- Function: gtk-tree-view-column-get-expand 2676 (self '<gtk-tree-view-column>') => (ret 'bool') 2677 -- Method: get-expand 2678 Return ''#t'' if the column expands to take any available space. 2679 2680 TREE-COLUMN 2681 a '<gtk-tree-view-column>' 2682 2683 RET 2684 ''#t'', if the column expands 2685 2686 Since 2.4 2687 2688 -- Function: gtk-tree-view-column-set-clickable 2689 (self '<gtk-tree-view-column>') (clickable 'bool') 2690 -- Method: set-clickable 2691 Sets the header to be active if ACTIVE is ''#t''. When the header 2692 is active, then it can take keyboard focus, and can be clicked. 2693 2694 TREE-COLUMN 2695 A '<gtk-tree-view-column>'. 2696 2697 CLICKABLE 2698 ''#t'' if the header is active. 2699 2700 -- Function: gtk-tree-view-column-get-clickable 2701 (self '<gtk-tree-view-column>') => (ret 'bool') 2702 -- Method: get-clickable 2703 Returns ''#t'' if the user can click on the header for the column. 2704 2705 TREE-COLUMN 2706 a '<gtk-tree-view-column>' 2707 2708 RET 2709 ''#t'' if user can click the column header. 2710 2711 -- Function: gtk-tree-view-column-set-widget 2712 (self '<gtk-tree-view-column>') (widget '<gtk-widget>') 2713 -- Method: set-widget 2714 Sets the widget in the header to be WIDGET. If widget is ''#f'', 2715 then the header button is set with a '<gtk-label>' set to the title 2716 of TREE-COLUMN. 2717 2718 TREE-COLUMN 2719 A '<gtk-tree-view-column>'. 2720 2721 WIDGET 2722 A child '<gtk-widget>', or ''#f''. 2723 2724 -- Function: gtk-tree-view-column-get-widget 2725 (self '<gtk-tree-view-column>') => (ret '<gtk-widget>') 2726 -- Method: get-widget 2727 Returns the '<gtk-widget>' in the button on the column header. If 2728 a custom widget has not been set then ''#f'' is returned. 2729 2730 TREE-COLUMN 2731 A '<gtk-tree-view-column>'. 2732 2733 RET 2734 The '<gtk-widget>' in the column header, or ''#f'' 2735 2736 -- Function: gtk-tree-view-column-set-alignment 2737 (self '<gtk-tree-view-column>') (xalign 'float') 2738 -- Method: set-alignment 2739 Sets the alignment of the title or custom widget inside the column 2740 header. The alignment determines its location inside the button - 2741 0.0 for left, 0.5 for center, 1.0 for right. 2742 2743 TREE-COLUMN 2744 A '<gtk-tree-view-column>'. 2745 2746 XALIGN 2747 The alignment, which is between [0.0 and 1.0] inclusive. 2748 2749 -- Function: gtk-tree-view-column-get-alignment 2750 (self '<gtk-tree-view-column>') => (ret 'float') 2751 -- Method: get-alignment 2752 Returns the current x alignment of TREE-COLUMN. This value can 2753 range between 0.0 and 1.0. 2754 2755 TREE-COLUMN 2756 A '<gtk-tree-view-column>'. 2757 2758 RET 2759 The current alignent of TREE-COLUMN. 2760 2761 -- Function: gtk-tree-view-column-set-sort-order 2762 (self '<gtk-tree-view-column>') (order '<gtk-sort-type>') 2763 -- Method: set-sort-order 2764 Changes the appearance of the sort indicator. 2765 2766 This _does not_ actually sort the model. Use 2767 'gtk-tree-view-column-set-sort-column-id' if you want automatic 2768 sorting support. This function is primarily for custom sorting 2769 behavior, and should be used in conjunction with 2770 'gtk-tree-sortable-set-sort-column' to do that. For custom models, 2771 the mechanism will vary. 2772 2773 The sort indicator changes direction to indicate normal sort or 2774 reverse sort. Note that you must have the sort indicator enabled 2775 to see anything when calling this function; see 2776 'gtk-tree-view-column-set-sort-indicator'. 2777 2778 TREE-COLUMN 2779 a '<gtk-tree-view-column>' 2780 2781 ORDER 2782 sort order that the sort indicator should indicate 2783 2784 -- Function: gtk-tree-view-column-get-sort-order 2785 (self '<gtk-tree-view-column>') => (ret '<gtk-sort-type>') 2786 -- Method: get-sort-order 2787 Gets the value set by 'gtk-tree-view-column-set-sort-order'. 2788 2789 TREE-COLUMN 2790 a '<gtk-tree-view-column>' 2791 2792 RET 2793 the sort order the sort indicator is indicating 2794 2795 -- Function: gtk-tree-view-column-focus-cell 2796 (self '<gtk-tree-view-column>') (cell '<gtk-cell-renderer>') 2797 -- Method: focus-cell 2798 Sets the current keyboard focus to be at CELL, if the column 2799 contains 2 or more editable and activatable cells. 2800 2801 TREE-COLUMN 2802 A '<gtk-tree-view-column>' 2803 2804 CELL 2805 A '<gtk-cell-renderer>' 2806 2807 Since 2.2 2808 2809 -- Function: gtk-tree-view-column-queue-resize 2810 (self '<gtk-tree-view-column>') 2811 -- Method: queue-resize 2812 Flags the column, and the cell renderers added to this column, to 2813 have their sizes renegotiated. 2814 2815 TREE-COLUMN 2816 A '<gtk-tree-view-column>' 2817 2818 Since 2.8 2819 2820 2821File: guile-gnome-gtk.info, Node: GtkTreeView, Next: GtkTreeView drag-and-drop, Prev: GtkTreeViewColumn, Up: Top 2822 282335 GtkTreeView 2824************** 2825 2826A widget for displaying both trees and lists 2827 282835.1 Overview 2829============= 2830 2831Widget that displays any object that implements the GtkTreeModel 2832interface. 2833 2834 Please refer to the tree widget conceptual overview for an overview 2835of all the objects and data types related to the tree widget and how 2836they work together. 2837 283835.2 Usage 2839========== 2840 2841 -- Class: <gtk-tree-view> 2842 Derives from '<gtk-container>'. 2843 2844 This class defines the following slots: 2845 2846 'model' 2847 The model for the tree view 2848 2849 'hadjustment' 2850 Horizontal Adjustment for the widget 2851 2852 'vadjustment' 2853 Vertical Adjustment for the widget 2854 2855 'headers-visible' 2856 Show the column header buttons 2857 2858 'headers-clickable' 2859 Column headers respond to click events 2860 2861 'expander-column' 2862 Set the column for the expander column 2863 2864 'reorderable' 2865 View is reorderable 2866 2867 'rules-hint' 2868 Set a hint to the theme engine to draw rows in alternating 2869 colors 2870 2871 'enable-search' 2872 View allows user to search through columns interactively 2873 2874 'search-column' 2875 Model column to search through when searching through code 2876 2877 'fixed-height-mode' 2878 Speeds up GtkTreeView by assuming that all rows have the same 2879 height 2880 2881 'hover-selection' 2882 Whether the selection should follow the pointer 2883 2884 'hover-expand' 2885 Whether rows should be expanded/collapsed when the pointer 2886 moves over them 2887 2888 'show-expanders' 2889 View has expanders 2890 2891 'level-indentation' 2892 Extra indentation for each level 2893 2894 'rubber-banding' 2895 Whether to enable selection of multiple items by dragging the 2896 mouse pointer 2897 2898 'enable-grid-lines' 2899 Whether grid lines should be drawn in the tree view 2900 2901 'enable-tree-lines' 2902 Whether tree lines should be drawn in the tree view 2903 2904 'tooltip-column' 2905 The column in the model containing the tooltip texts for the 2906 rows 2907 2908 -- Signal on <gtk-tree-view>: move-cursor (arg0 '<gtk-movement-step>') 2909 (arg1 '<gint>') => '<gboolean>' 2910 2911 -- Signal on <gtk-tree-view>: set-scroll-adjustments 2912 (arg0 '<gtk-adjustment>') (arg1 '<gtk-adjustment>') 2913 2914 -- Signal on <gtk-tree-view>: select-all => '<gboolean>' 2915 2916 -- Signal on <gtk-tree-view>: unselect-all => '<gboolean>' 2917 2918 -- Signal on <gtk-tree-view>: row-activated (arg0 '<gtk-tree-path>') 2919 (arg1 '<gtk-tree-view-column>') 2920 The "row-activated" signal is emitted when the method 2921 'gtk-tree-view-row-activated' is called or the user double clicks a 2922 treeview row. It is also emitted when a non-editable row is 2923 selected and one of the keys: Space, Shift+Space, Return or Enter 2924 is pressed. 2925 2926 For selection handling refer to the tree widget conceptual overview 2927 as well as '<gtk-tree-selection>'. 2928 2929 -- Signal on <gtk-tree-view>: test-expand-row (arg0 '<gtk-tree-iter>') 2930 (arg1 '<gtk-tree-path>') => '<gboolean>' 2931 The given row is about to be expanded (show its children nodes). 2932 Use this signal if you need to control the expandability of 2933 individual rows. 2934 2935 -- Signal on <gtk-tree-view>: test-collapse-row 2936 (arg0 '<gtk-tree-iter>') (arg1 '<gtk-tree-path>') 2937 => '<gboolean>' 2938 The given row is about to be collapsed (hide its children nodes). 2939 Use this signal if you need to control the collapsibility of 2940 individual rows. 2941 2942 -- Signal on <gtk-tree-view>: row-expanded (arg0 '<gtk-tree-iter>') 2943 (arg1 '<gtk-tree-path>') 2944 The given row has been expanded (child nodes are shown). 2945 2946 -- Signal on <gtk-tree-view>: row-collapsed (arg0 '<gtk-tree-iter>') 2947 (arg1 '<gtk-tree-path>') 2948 The given row has been collapsed (child nodes are hidden). 2949 2950 -- Signal on <gtk-tree-view>: columns-changed 2951 The number of columns of the treeview has changed. 2952 2953 -- Signal on <gtk-tree-view>: cursor-changed 2954 The position of the cursor (focused cell) has changed. 2955 2956 -- Signal on <gtk-tree-view>: select-cursor-row (arg0 '<gboolean>') 2957 => '<gboolean>' 2958 2959 -- Signal on <gtk-tree-view>: toggle-cursor-row => '<gboolean>' 2960 2961 -- Signal on <gtk-tree-view>: expand-collapse-cursor-row 2962 (arg0 '<gboolean>') (arg1 '<gboolean>') (arg2 '<gboolean>') 2963 => '<gboolean>' 2964 2965 -- Signal on <gtk-tree-view>: select-cursor-parent => '<gboolean>' 2966 2967 -- Signal on <gtk-tree-view>: start-interactive-search => '<gboolean>' 2968 2969 -- Function: gtk-tree-view-new => (ret '<gtk-widget>') 2970 Creates a new '<gtk-tree-view>' widget. 2971 2972 RET 2973 A newly created '<gtk-tree-view>' widget. 2974 2975 -- Function: gtk-tree-view-new-with-model (model '<gtk-tree-model>') 2976 => (ret '<gtk-widget>') 2977 Creates a new '<gtk-tree-view>' widget with the model initialized 2978 to MODEL. 2979 2980 MODEL 2981 the model. 2982 2983 RET 2984 A newly created '<gtk-tree-view>' widget. 2985 2986 -- Function: gtk-tree-view-get-model (self '<gtk-tree-view>') => 2987 (ret '<gtk-tree-model>') 2988 -- Method: get-model 2989 Returns the model the '<gtk-tree-view>' is based on. Returns 2990 ''#f'' if the model is unset. 2991 2992 TREE-VIEW 2993 a '<gtk-tree-view>' 2994 2995 RET 2996 A '<gtk-tree-model>', or ''#f'' if none is currently being 2997 used. 2998 2999 -- Function: gtk-tree-view-set-model (self '<gtk-tree-view>') 3000 (model '<gtk-tree-model>') 3001 -- Method: set-model 3002 Sets the model for a '<gtk-tree-view>'. If the TREE-VIEW already 3003 has a model set, it will remove it before setting the new model. 3004 If MODEL is ''#f'', then it will unset the old model. 3005 3006 TREE-VIEW 3007 A '<gtk-tree-node>'. 3008 3009 MODEL 3010 The model. 3011 3012 -- Function: gtk-tree-view-get-selection (self '<gtk-tree-view>') => 3013 (ret '<gtk-tree-selection>') 3014 -- Method: get-selection 3015 Gets the '<gtk-tree-selection>' associated with TREE-VIEW. 3016 3017 TREE-VIEW 3018 A '<gtk-tree-view>'. 3019 3020 RET 3021 A '<gtk-tree-selection>' object. 3022 3023 -- Function: gtk-tree-view-get-hadjustment (self '<gtk-tree-view>') => 3024 (ret '<gtk-adjustment>') 3025 -- Method: get-hadjustment 3026 Gets the '<gtk-adjustment>' currently being used for the horizontal 3027 aspect. 3028 3029 TREE-VIEW 3030 A '<gtk-tree-view>' 3031 3032 RET 3033 A '<gtk-adjustment>' object, or ''#f'' if none is currently 3034 being used. 3035 3036 -- Function: gtk-tree-view-set-hadjustment (self '<gtk-tree-view>') 3037 (adjustment '<gtk-adjustment>') 3038 -- Method: set-hadjustment 3039 Sets the '<gtk-adjustment>' for the current horizontal aspect. 3040 3041 TREE-VIEW 3042 A '<gtk-tree-view>' 3043 3044 ADJUSTMENT 3045 The '<gtk-adjustment>' to set, or ''#f'' 3046 3047 -- Function: gtk-tree-view-get-vadjustment (self '<gtk-tree-view>') => 3048 (ret '<gtk-adjustment>') 3049 -- Method: get-vadjustment 3050 Gets the '<gtk-adjustment>' currently being used for the vertical 3051 aspect. 3052 3053 TREE-VIEW 3054 A '<gtk-tree-view>' 3055 3056 RET 3057 A '<gtk-adjustment>' object, or ''#f'' if none is currently 3058 being used. 3059 3060 -- Function: gtk-tree-view-set-vadjustment (self '<gtk-tree-view>') 3061 (adjustment '<gtk-adjustment>') 3062 -- Method: set-vadjustment 3063 Sets the '<gtk-adjustment>' for the current vertical aspect. 3064 3065 TREE-VIEW 3066 A '<gtk-tree-view>' 3067 3068 ADJUSTMENT 3069 The '<gtk-adjustment>' to set, or ''#f'' 3070 3071 -- Function: gtk-tree-view-get-headers-visible (self '<gtk-tree-view>') 3072 => (ret 'bool') 3073 -- Method: get-headers-visible 3074 Returns ''#t'' if the headers on the TREE-VIEW are visible. 3075 3076 TREE-VIEW 3077 A '<gtk-tree-view>'. 3078 3079 RET 3080 Whether the headers are visible or not. 3081 3082 -- Function: gtk-tree-view-set-headers-visible (self '<gtk-tree-view>') 3083 (headers_visible 'bool') 3084 -- Method: set-headers-visible 3085 Sets the visibility state of the headers. 3086 3087 TREE-VIEW 3088 A '<gtk-tree-view>'. 3089 3090 HEADERS-VISIBLE 3091 ''#t'' if the headers are visible 3092 3093 -- Function: gtk-tree-view-columns-autosize (self '<gtk-tree-view>') 3094 -- Method: columns-autosize 3095 Resizes all columns to their optimal width. Only works after the 3096 treeview has been realized. 3097 3098 TREE-VIEW 3099 A '<gtk-tree-view>'. 3100 3101 -- Function: gtk-tree-view-get-headers-clickable 3102 (self '<gtk-tree-view>') => (ret 'bool') 3103 -- Method: get-headers-clickable 3104 Returns whether all header columns are clickable. 3105 3106 TREE-VIEW 3107 A '<gtk-tree-view>'. 3108 3109 RET 3110 ''#t'' if all header columns are clickable, otherwise ''#f'' 3111 3112 Since 2.10 3113 3114 -- Function: gtk-tree-view-set-headers-clickable 3115 (self '<gtk-tree-view>') (setting 'bool') 3116 -- Method: set-headers-clickable 3117 Allow the column title buttons to be clicked. 3118 3119 TREE-VIEW 3120 A '<gtk-tree-view>'. 3121 3122 SETTING 3123 ''#t'' if the columns are clickable. 3124 3125 -- Function: gtk-tree-view-set-rules-hint (self '<gtk-tree-view>') 3126 (setting 'bool') 3127 -- Method: set-rules-hint 3128 This function tells GTK+ that the user interface for your 3129 application requires users to read across tree rows and associate 3130 cells with one another. By default, GTK+ will then render the tree 3131 with alternating row colors. Do _not_ use it just because you 3132 prefer the appearance of the ruled tree; that's a question for the 3133 theme. Some themes will draw tree rows in alternating colors even 3134 when rules are turned off, and users who prefer that appearance all 3135 the time can choose those themes. You should call this function 3136 only as a _semantic_ hint to the theme engine that your tree makes 3137 alternating colors useful from a functional standpoint (since it 3138 has lots of columns, generally). 3139 3140 TREE-VIEW 3141 a '<gtk-tree-view>' 3142 3143 SETTING 3144 ''#t'' if the tree requires reading across rows 3145 3146 -- Function: gtk-tree-view-get-rules-hint (self '<gtk-tree-view>') => 3147 (ret 'bool') 3148 -- Method: get-rules-hint 3149 Gets the setting set by 'gtk-tree-view-set-rules-hint'. 3150 3151 TREE-VIEW 3152 a '<gtk-tree-view>' 3153 3154 RET 3155 ''#t'' if rules are useful for the user of this tree 3156 3157 -- Function: gtk-tree-view-append-column (self '<gtk-tree-view>') 3158 (column '<gtk-tree-view-column>') => (ret 'int') 3159 -- Method: append-column 3160 Appends COLUMN to the list of columns. If TREE-VIEW has 3161 "fixed_height" mode enabled, then COLUMN must have its "sizing" 3162 property set to be GTK_TREE_VIEW_COLUMN_FIXED. 3163 3164 TREE-VIEW 3165 A '<gtk-tree-view>'. 3166 3167 COLUMN 3168 The '<gtk-tree-view-column>' to add. 3169 3170 RET 3171 The number of columns in TREE-VIEW after appending. 3172 3173 -- Function: gtk-tree-view-remove-column (self '<gtk-tree-view>') 3174 (column '<gtk-tree-view-column>') => (ret 'int') 3175 -- Method: remove-column 3176 Removes COLUMN from TREE-VIEW. 3177 3178 TREE-VIEW 3179 A '<gtk-tree-view>'. 3180 3181 COLUMN 3182 The '<gtk-tree-view-column>' to remove. 3183 3184 RET 3185 The number of columns in TREE-VIEW after removing. 3186 3187 -- Function: gtk-tree-view-insert-column (self '<gtk-tree-view>') 3188 (column '<gtk-tree-view-column>') (position 'int') => 3189 (ret 'int') 3190 -- Method: insert-column 3191 This inserts the COLUMN into the TREE-VIEW at POSITION. If 3192 POSITION is -1, then the column is inserted at the end. If 3193 TREE-VIEW has "fixed_height" mode enabled, then COLUMN must have 3194 its "sizing" property set to be GTK_TREE_VIEW_COLUMN_FIXED. 3195 3196 TREE-VIEW 3197 A '<gtk-tree-view>'. 3198 3199 COLUMN 3200 The '<gtk-tree-view-column>' to be inserted. 3201 3202 POSITION 3203 The position to insert COLUMN in. 3204 3205 RET 3206 The number of columns in TREE-VIEW after insertion. 3207 3208 -- Function: gtk-tree-view-get-column (self '<gtk-tree-view>') 3209 (n 'int') => (ret '<gtk-tree-view-column>') 3210 -- Method: get-column 3211 Gets the '<gtk-tree-view-column>' at the given position in the 3212 '<tree-view>'. 3213 3214 TREE-VIEW 3215 A '<gtk-tree-view>'. 3216 3217 N 3218 The position of the column, counting from 0. 3219 3220 RET 3221 The '<gtk-tree-view-column>', or ''#f'' if the position is 3222 outside the range of columns. 3223 3224 -- Function: gtk-tree-view-get-columns (self '<gtk-tree-view>') => 3225 (ret 'glist-of') 3226 -- Method: get-columns 3227 Returns a '<g-list>' of all the '<gtk-tree-view-column>' s 3228 currently in TREE-VIEW. The returned list must be freed with 3229 'g-list-free'. 3230 3231 TREE-VIEW 3232 A '<gtk-tree-view>' 3233 3234 RET 3235 A list of '<gtk-tree-view-column>' s 3236 3237 -- Function: gtk-tree-view-move-column-after (self '<gtk-tree-view>') 3238 (column '<gtk-tree-view-column>') 3239 (base_column '<gtk-tree-view-column>') 3240 -- Method: move-column-after 3241 Moves COLUMN to be after to BASE-COLUMN. If BASE-COLUMN is ''#f'', 3242 then COLUMN is placed in the first position. 3243 3244 TREE-VIEW 3245 A '<gtk-tree-view>' 3246 3247 COLUMN 3248 The '<gtk-tree-view-column>' to be moved. 3249 3250 BASE-COLUMN 3251 The '<gtk-tree-view-column>' to be moved relative to, or 3252 ''#f''. 3253 3254 -- Function: gtk-tree-view-set-expander-column (self '<gtk-tree-view>') 3255 (column '<gtk-tree-view-column>') 3256 -- Method: set-expander-column 3257 Sets the column to draw the expander arrow at. It must be in 3258 TREE-VIEW. If COLUMN is ''#f'', then the expander arrow is always 3259 at the first visible column. 3260 3261 If you do not want expander arrow to appear in your tree, set the 3262 expander column to a hidden column. 3263 3264 TREE-VIEW 3265 A '<gtk-tree-view>' 3266 3267 COLUMN 3268 ''#f'', or the column to draw the expander arrow at. 3269 3270 -- Function: gtk-tree-view-get-expander-column (self '<gtk-tree-view>') 3271 => (ret '<gtk-tree-view-column>') 3272 -- Method: get-expander-column 3273 Returns the column that is the current expander column. This 3274 column has the expander arrow drawn next to it. 3275 3276 TREE-VIEW 3277 A '<gtk-tree-view>' 3278 3279 RET 3280 The expander column. 3281 3282 -- Function: gtk-tree-view-scroll-to-point (self '<gtk-tree-view>') 3283 (tree_x 'int') (tree_y 'int') 3284 -- Method: scroll-to-point 3285 Scrolls the tree view such that the top-left corner of the visible 3286 area is TREE-X, TREE-Y, where TREE-X and TREE-Y are specified in 3287 tree window coordinates. The TREE-VIEW must be realized before 3288 this function is called. If it isn't, you probably want to be 3289 using 'gtk-tree-view-scroll-to-cell'. 3290 3291 If either TREE-X or TREE-Y are -1, then that direction isn't 3292 scrolled. 3293 3294 TREE-VIEW 3295 a '<gtk-tree-view>' 3296 3297 TREE-X 3298 X coordinate of new top-left pixel of visible area, or -1 3299 3300 TREE-Y 3301 Y coordinate of new top-left pixel of visible area, or -1 3302 3303 -- Function: gtk-tree-view-scroll-to-cell (self '<gtk-tree-view>') 3304 (path '<gtk-tree-path>') (column '<gtk-tree-view-column>') 3305 (use_align 'bool') (row_align 'float') (col_align 'float') 3306 -- Method: scroll-to-cell 3307 Moves the alignments of TREE-VIEW to the position specified by 3308 COLUMN and PATH. If COLUMN is ''#f'', then no horizontal scrolling 3309 occurs. Likewise, if PATH is ''#f'' no vertical scrolling occurs. 3310 At a minimum, one of COLUMN or PATH need to be non-''#f''. 3311 ROW-ALIGN determines where the row is placed, and COL-ALIGN 3312 determines where COLUMN is placed. Both are expected to be between 3313 0.0 and 1.0. 0.0 means left/top alignment, 1.0 means right/bottom 3314 alignment, 0.5 means center. 3315 3316 If USE-ALIGN is ''#f'', then the alignment arguments are ignored, 3317 and the tree does the minimum amount of work to scroll the cell 3318 onto the screen. This means that the cell will be scrolled to the 3319 edge closest to its current position. If the cell is currently 3320 visible on the screen, nothing is done. 3321 3322 This function only works if the model is set, and PATH is a valid 3323 row on the model. If the model changes before the TREE-VIEW is 3324 realized, the centered path will be modified to reflect this 3325 change. 3326 3327 TREE-VIEW 3328 A '<gtk-tree-view>'. 3329 3330 PATH 3331 The path of the row to move to, or ''#f''. 3332 3333 COLUMN 3334 The '<gtk-tree-view-column>' to move horizontally to, or 3335 ''#f''. 3336 3337 USE-ALIGN 3338 whether to use alignment arguments, or ''#f''. 3339 3340 ROW-ALIGN 3341 The vertical alignment of the row specified by PATH. 3342 3343 COL-ALIGN 3344 The horizontal alignment of the column specified by COLUMN. 3345 3346 -- Function: gtk-tree-view-set-cursor (self '<gtk-tree-view>') 3347 (path '<gtk-tree-path>') 3348 (focus_column '<gtk-tree-view-column>') (start_editing 'bool') 3349 -- Method: set-cursor 3350 Sets the current keyboard focus to be at PATH, and selects it. 3351 This is useful when you want to focus the user's attention on a 3352 particular row. If FOCUS-COLUMN is not ''#f'', then focus is given 3353 to the column specified by it. Additionally, if FOCUS-COLUMN is 3354 specified, and START-EDITING is ''#t'', then editing should be 3355 started in the specified cell. This function is often followed by 3356 GTK-WIDGET-GRAB-FOCUS (TREE-VIEW) in order to give keyboard focus 3357 to the widget. Please note that editing can only happen when the 3358 widget is realized. 3359 3360 TREE-VIEW 3361 A '<gtk-tree-view>' 3362 3363 PATH 3364 A '<gtk-tree-path>' 3365 3366 FOCUS-COLUMN 3367 A '<gtk-tree-view-column>', or ''#f'' 3368 3369 START-EDITING 3370 ''#t'' if the specified cell should start being edited. 3371 3372 -- Function: gtk-tree-view-set-cursor-on-cell (self '<gtk-tree-view>') 3373 (path '<gtk-tree-path>') 3374 (focus_column '<gtk-tree-view-column>') 3375 (focus_cell '<gtk-cell-renderer>') (start_editing 'bool') 3376 -- Method: set-cursor-on-cell 3377 Sets the current keyboard focus to be at PATH, and selects it. 3378 This is useful when you want to focus the user's attention on a 3379 particular row. If FOCUS-COLUMN is not ''#f'', then focus is given 3380 to the column specified by it. If FOCUS-COLUMN and FOCUS-CELL are 3381 not ''#f'', and FOCUS-COLUMN contains 2 or more editable or 3382 activatable cells, then focus is given to the cell specified by 3383 FOCUS-CELL. Additionally, if FOCUS-COLUMN is specified, and 3384 START-EDITING is ''#t'', then editing should be started in the 3385 specified cell. This function is often followed by 3386 GTK-WIDGET-GRAB-FOCUS (TREE-VIEW) in order to give keyboard focus 3387 to the widget. Please note that editing can only happen when the 3388 widget is realized. 3389 3390 TREE-VIEW 3391 A '<gtk-tree-view>' 3392 3393 PATH 3394 A '<gtk-tree-path>' 3395 3396 FOCUS-COLUMN 3397 A '<gtk-tree-view-column>', or ''#f'' 3398 3399 FOCUS-CELL 3400 A '<gtk-cell-renderer>', or ''#f'' 3401 3402 START-EDITING 3403 ''#t'' if the specified cell should start being edited. 3404 3405 Since 2.2 3406 3407 -- Function: gtk-tree-view-row-activated (self '<gtk-tree-view>') 3408 (path '<gtk-tree-path>') (column '<gtk-tree-view-column>') 3409 -- Method: row-activated 3410 Activates the cell determined by PATH and COLUMN. 3411 3412 TREE-VIEW 3413 A '<gtk-tree-view>' 3414 3415 PATH 3416 The '<gtk-tree-path>' to be activated. 3417 3418 COLUMN 3419 The '<gtk-tree-view-column>' to be activated. 3420 3421 -- Function: gtk-tree-view-expand-all (self '<gtk-tree-view>') 3422 -- Method: expand-all 3423 Recursively expands all nodes in the TREE-VIEW. 3424 3425 TREE-VIEW 3426 A '<gtk-tree-view>'. 3427 3428 -- Function: gtk-tree-view-collapse-all (self '<gtk-tree-view>') 3429 -- Method: collapse-all 3430 Recursively collapses all visible, expanded nodes in TREE-VIEW. 3431 3432 TREE-VIEW 3433 A '<gtk-tree-view>'. 3434 3435 -- Function: gtk-tree-view-expand-to-path (self '<gtk-tree-view>') 3436 (path '<gtk-tree-path>') 3437 -- Method: expand-to-path 3438 Expands the row at PATH. This will also expand all parent rows of 3439 PATH as necessary. 3440 3441 TREE-VIEW 3442 A '<gtk-tree-view>'. 3443 3444 PATH 3445 path to a row. 3446 3447 Since 2.2 3448 3449 -- Function: gtk-tree-view-expand-row (self '<gtk-tree-view>') 3450 (path '<gtk-tree-path>') (open_all 'bool') => (ret 'bool') 3451 -- Method: expand-row 3452 Opens the row so its children are visible. 3453 3454 TREE-VIEW 3455 a '<gtk-tree-view>' 3456 3457 PATH 3458 path to a row 3459 3460 OPEN-ALL 3461 whether to recursively expand, or just expand immediate 3462 children 3463 3464 RET 3465 ''#t'' if the row existed and had children 3466 3467 -- Function: gtk-tree-view-collapse-row (self '<gtk-tree-view>') 3468 (path '<gtk-tree-path>') => (ret 'bool') 3469 -- Method: collapse-row 3470 Collapses a row (hides its child rows, if they exist). 3471 3472 TREE-VIEW 3473 a '<gtk-tree-view>' 3474 3475 PATH 3476 path to a row in the TREE-VIEW 3477 3478 RET 3479 ''#t'' if the row was collapsed. 3480 3481 -- Function: gtk-tree-view-row-expanded (self '<gtk-tree-view>') 3482 (path '<gtk-tree-path>') => (ret 'bool') 3483 -- Method: row-expanded 3484 Returns ''#t'' if the node pointed to by PATH is expanded in 3485 TREE-VIEW. 3486 3487 TREE-VIEW 3488 A '<gtk-tree-view>'. 3489 3490 PATH 3491 A '<gtk-tree-path>' to test expansion state. 3492 3493 RET 3494 ''#t'' if '<path>' is expanded. 3495 3496 -- Function: gtk-tree-view-set-reorderable (self '<gtk-tree-view>') 3497 (reorderable 'bool') 3498 -- Method: set-reorderable 3499 This function is a convenience function to allow you to reorder 3500 models that support the '<gtk-drag-source-iface>' and the 3501 '<gtk-drag-dest-iface>'. Both '<gtk-tree-store>' and 3502 '<gtk-list-store>' support these. If REORDERABLE is ''#t'', then 3503 the user can reorder the model by dragging and dropping rows. The 3504 developer can listen to these changes by connecting to the model's 3505 row_inserted and row_deleted signals. 3506 3507 This function does not give you any degree of control over the 3508 order - any reordering is allowed. If more control is needed, you 3509 should probably handle drag and drop manually. 3510 3511 TREE-VIEW 3512 A '<gtk-tree-view>'. 3513 3514 REORDERABLE 3515 ''#t'', if the tree can be reordered. 3516 3517 -- Function: gtk-tree-view-get-reorderable (self '<gtk-tree-view>') => 3518 (ret 'bool') 3519 -- Method: get-reorderable 3520 Retrieves whether the user can reorder the tree via drag-and-drop. 3521 See 'gtk-tree-view-set-reorderable'. 3522 3523 TREE-VIEW 3524 a '<gtk-tree-view>' 3525 3526 RET 3527 ''#t'' if the tree can be reordered. 3528 3529 -- Function: gtk-tree-view-get-bin-window (self '<gtk-tree-view>') => 3530 (ret '<gdk-window>') 3531 -- Method: get-bin-window 3532 Returns the window that TREE-VIEW renders to. This is used 3533 primarily to compare to 'event->window' to confirm that the event 3534 on TREE-VIEW is on the right window. 3535 3536 TREE-VIEW 3537 A '<gtk-tree-view>' 3538 3539 RET 3540 A '<gdk-window>', or ''#f'' when TREE-VIEW hasn't been 3541 realized yet 3542 3543 -- Function: gtk-tree-view-widget-to-tree-coords 3544 (self '<gtk-tree-view>') (wx 'int') (wy 'int') => (tx 'int') 3545 (ty 'int') 3546 -- Method: widget-to-tree-coords 3547 Converts widget coordinates to coordinates for the tree window (the 3548 full scrollable area of the tree). 3549 3550 TREE-VIEW 3551 a '<gtk-tree-view>' 3552 3553 WX 3554 widget X coordinate 3555 3556 WY 3557 widget Y coordinate 3558 3559 TX 3560 return location for tree X coordinate 3561 3562 TY 3563 return location for tree Y coordinate 3564 3565 -- Function: gtk-tree-view-tree-to-widget-coords 3566 (self '<gtk-tree-view>') (tx 'int') (ty 'int') => (wx 'int') 3567 (wy 'int') 3568 -- Method: tree-to-widget-coords 3569 Converts tree coordinates (coordinates in full scrollable area of 3570 the tree) to widget coordinates. 3571 3572 TREE-VIEW 3573 a '<gtk-tree-view>' 3574 3575 TX 3576 tree X coordinate 3577 3578 TY 3579 tree Y coordinate 3580 3581 WX 3582 return location for widget X coordinate 3583 3584 WY 3585 return location for widget Y coordinate 3586 3587 -- Function: gtk-tree-view-unset-rows-drag-dest 3588 (self '<gtk-tree-view>') 3589 -- Method: unset-rows-drag-dest 3590 Undoes the effect of 'gtk-tree-view-enable-model-drag-dest'. 3591 3592 TREE-VIEW 3593 a '<gtk-tree-view>' 3594 3595 -- Function: gtk-tree-view-set-drag-dest-row (self '<gtk-tree-view>') 3596 (path '<gtk-tree-path>') (pos '<gtk-tree-view-drop-position>') 3597 -- Method: set-drag-dest-row 3598 Sets the row that is highlighted for feedback. 3599 3600 TREE-VIEW 3601 a '<gtk-tree-view>' 3602 3603 PATH 3604 The path of the row to highlight, or ''#f''. 3605 3606 POS 3607 Specifies whether to drop before, after or into the row 3608 3609 -- Function: gtk-tree-view-create-row-drag-icon 3610 (self '<gtk-tree-view>') (path '<gtk-tree-path>') => 3611 (ret '<gdk-pixmap>') 3612 -- Method: create-row-drag-icon 3613 Creates a '<gdk-pixmap>' representation of the row at PATH. This 3614 image is used for a drag icon. 3615 3616 TREE-VIEW 3617 a '<gtk-tree-view>' 3618 3619 PATH 3620 a '<gtk-tree-path>' in TREE-VIEW 3621 3622 RET 3623 a newly-allocated pixmap of the drag icon. 3624 3625 -- Function: gtk-tree-view-set-enable-search (self '<gtk-tree-view>') 3626 (enable_search 'bool') 3627 -- Method: set-enable-search 3628 If ENABLE-SEARCH is set, then the user can type in text to search 3629 through the tree interactively (this is sometimes called "typeahead 3630 find"). 3631 3632 Note that even if this is ''#f'', the user can still initiate a 3633 search using the "start-interactive-search" key binding. 3634 3635 TREE-VIEW 3636 A '<gtk-tree-view>' 3637 3638 ENABLE-SEARCH 3639 ''#t'', if the user can search interactively 3640 3641 -- Function: gtk-tree-view-get-enable-search (self '<gtk-tree-view>') 3642 => (ret 'bool') 3643 -- Method: get-enable-search 3644 Returns whether or not the tree allows to start interactive 3645 searching by typing in text. 3646 3647 TREE-VIEW 3648 A '<gtk-tree-view>' 3649 3650 RET 3651 whether or not to let the user search interactively 3652 3653 -- Function: gtk-tree-view-get-search-column (self '<gtk-tree-view>') 3654 => (ret 'int') 3655 -- Method: get-search-column 3656 Gets the column searched on by the interactive search code. 3657 3658 TREE-VIEW 3659 A '<gtk-tree-view>' 3660 3661 RET 3662 the column the interactive search code searches in. 3663 3664 -- Function: gtk-tree-view-set-search-column (self '<gtk-tree-view>') 3665 (column 'int') 3666 -- Method: set-search-column 3667 Sets COLUMN as the column where the interactive search code should 3668 search in. 3669 3670 If the sort column is set, users can use the 3671 "start-interactive-search" key binding to bring up search popup. 3672 The enable-search property controls whether simply typing text will 3673 also start an interactive search. 3674 3675 Note that COLUMN refers to a column of the model. 3676 3677 TREE-VIEW 3678 A '<gtk-tree-view>' 3679 3680 COLUMN 3681 the column of the model to search in, or -1 to disable 3682 searching 3683 3684 -- Function: gtk-tree-view-get-search-entry (self '<gtk-tree-view>') 3685 => (ret '<gtk-entry>') 3686 -- Method: get-search-entry 3687 Returns the GtkEntry which is currently in use as interactive 3688 search entry for TREE-VIEW. In case the built-in entry is being 3689 used, ''#f'' will be returned. 3690 3691 TREE-VIEW 3692 A '<gtk-tree-view>' 3693 3694 RET 3695 the entry currently in use as search entry. 3696 3697 Since 2.10 3698 3699 -- Function: gtk-tree-view-set-search-entry (self '<gtk-tree-view>') 3700 (entry '<gtk-entry>') 3701 -- Method: set-search-entry 3702 Sets the entry which the interactive search code will use for this 3703 TREE-VIEW. This is useful when you want to provide a search entry 3704 in our interface at all time at a fixed position. Passing ''#f'' 3705 for ENTRY will make the interactive search code use the built-in 3706 popup entry again. 3707 3708 TREE-VIEW 3709 A '<gtk-tree-view>' 3710 3711 ENTRY 3712 the entry the interactive search code of TREE-VIEW should use 3713 or ''#f'' 3714 3715 Since 2.10 3716 3717 -- Function: gtk-tree-view-get-fixed-height-mode 3718 (self '<gtk-tree-view>') => (ret 'bool') 3719 -- Method: get-fixed-height-mode 3720 Returns whether fixed height mode is turned on for TREE-VIEW. 3721 3722 TREE-VIEW 3723 a '<gtk-tree-view>' 3724 3725 RET 3726 ''#t'' if TREE-VIEW is in fixed height mode 3727 3728 Since 2.6 3729 3730 -- Function: gtk-tree-view-set-fixed-height-mode 3731 (self '<gtk-tree-view>') (enable 'bool') 3732 -- Method: set-fixed-height-mode 3733 Enables or disables the fixed height mode of TREE-VIEW. Fixed 3734 height mode speeds up '<gtk-tree-view>' by assuming that all rows 3735 have the same height. Only enable this option if all rows are the 3736 same height and all columns are of type 3737 'GTK_TREE_VIEW_COLUMN_FIXED'. 3738 3739 TREE-VIEW 3740 a '<gtk-tree-view>' 3741 3742 ENABLE 3743 ''#t'' to enable fixed height mode 3744 3745 Since 2.6 3746 3747 -- Function: gtk-tree-view-get-hover-selection (self '<gtk-tree-view>') 3748 => (ret 'bool') 3749 -- Method: get-hover-selection 3750 Returns whether hover selection mode is turned on for TREE-VIEW. 3751 3752 TREE-VIEW 3753 a '<gtk-tree-view>' 3754 3755 RET 3756 ''#t'' if TREE-VIEW is in hover selection mode 3757 3758 Since 2.6 3759 3760 -- Function: gtk-tree-view-set-hover-selection (self '<gtk-tree-view>') 3761 (hover 'bool') 3762 -- Method: set-hover-selection 3763 Enables of disables the hover selection mode of TREE-VIEW. Hover 3764 selection makes the selected row follow the pointer. Currently, 3765 this works only for the selection modes 'GTK_SELECTION_SINGLE' and 3766 'GTK_SELECTION_BROWSE'. 3767 3768 TREE-VIEW 3769 a '<gtk-tree-view>' 3770 3771 HOVER 3772 ''#t'' to enable hover selection mode 3773 3774 Since 2.6 3775 3776 -- Function: gtk-tree-view-get-hover-expand (self '<gtk-tree-view>') 3777 => (ret 'bool') 3778 -- Method: get-hover-expand 3779 Returns whether hover expansion mode is turned on for TREE-VIEW. 3780 3781 TREE-VIEW 3782 a '<gtk-tree-view>' 3783 3784 RET 3785 ''#t'' if TREE-VIEW is in hover expansion mode 3786 3787 Since 2.6 3788 3789 -- Function: gtk-tree-view-set-hover-expand (self '<gtk-tree-view>') 3790 (expand 'bool') 3791 -- Method: set-hover-expand 3792 Enables of disables the hover expansion mode of TREE-VIEW. Hover 3793 expansion makes rows expand or collaps if the pointer moves over 3794 them. 3795 3796 TREE-VIEW 3797 a '<gtk-tree-view>' 3798 3799 EXPAND 3800 ''#t'' to enable hover selection mode 3801 3802 Since 2.6 3803 3804 -- Function: gtk-tree-view-get-rubber-banding (self '<gtk-tree-view>') 3805 => (ret 'bool') 3806 -- Method: get-rubber-banding 3807 Returns whether rubber banding is turned on for TREE-VIEW. If the 3808 selection mode is '<gtk-selection-multiple>', rubber banding will 3809 allow the user to select multiple rows by dragging the mouse. 3810 3811 TREE-VIEW 3812 a '<gtk-tree-view>' 3813 3814 RET 3815 ''#t'' if rubber banding in TREE-VIEW is enabled. 3816 3817 Since 2.10 3818 3819 -- Function: gtk-tree-view-set-rubber-banding (self '<gtk-tree-view>') 3820 (enable 'bool') 3821 -- Method: set-rubber-banding 3822 Enables or disables rubber banding in TREE-VIEW. If the selection 3823 mode is '<gtk-selection-multiple>', rubber banding will allow the 3824 user to select multiple rows by dragging the mouse. 3825 3826 TREE-VIEW 3827 a '<gtk-tree-view>' 3828 3829 ENABLE 3830 ''#t'' to enable rubber banding 3831 3832 Since 2.10 3833 3834 -- Function: gtk-tree-view-get-enable-tree-lines 3835 (self '<gtk-tree-view>') => (ret 'bool') 3836 -- Method: get-enable-tree-lines 3837 Returns whether or not tree lines are drawn in TREE-VIEW. 3838 3839 TREE-VIEW 3840 a '<gtk-tree-view>'. 3841 3842 RET 3843 ''#t'' if tree lines are drawn in TREE-VIEW, ''#f'' otherwise. 3844 3845 Since 2.10 3846 3847 -- Function: gtk-tree-view-set-enable-tree-lines 3848 (self '<gtk-tree-view>') (enabled 'bool') 3849 -- Method: set-enable-tree-lines 3850 Sets whether to draw lines interconnecting the expanders in 3851 TREE-VIEW. This does not have any visible effects for lists. 3852 3853 TREE-VIEW 3854 a '<gtk-tree-view>' 3855 3856 ENABLED 3857 ''#t'' to enable tree line drawing, ''#f'' otherwise. 3858 3859 Since 2.10 3860 3861 -- Function: gtk-tree-view-get-grid-lines (self '<gtk-tree-view>') => 3862 (ret '<gtk-tree-view-grid-lines>') 3863 -- Method: get-grid-lines 3864 Returns which grid lines are enabled in TREE-VIEW. 3865 3866 TREE-VIEW 3867 a '<gtk-tree-view>' 3868 3869 RET 3870 a '<gtk-tree-view-grid-lines>' value indicating which grid 3871 lines are enabled. 3872 3873 Since 2.10 3874 3875 -- Function: gtk-tree-view-set-grid-lines (self '<gtk-tree-view>') 3876 (grid_lines '<gtk-tree-view-grid-lines>') 3877 -- Method: set-grid-lines 3878 Sets which grid lines to draw in TREE-VIEW. 3879 3880 TREE-VIEW 3881 a '<gtk-tree-view>' 3882 3883 GRID-LINES 3884 a '<gtk-tree-view-grid-lines>' value indicating which grid 3885 lines to enable. 3886 3887 Since 2.10 3888 3889 3890File: guile-gnome-gtk.info, Node: GtkTreeView drag-and-drop, Next: GtkCellView, Prev: GtkTreeView, Up: Top 3891 389236 GtkTreeView drag-and-drop 3893**************************** 3894 3895Interfaces for drag-and-drop support in GtkTreeView 3896 389736.1 Overview 3898============= 3899 3900GTK+ supports Drag-and-Drop in tree views with a high-level and a 3901low-level API. 3902 3903 The low-level API consists of the GTK+ DND API, augmented by some 3904treeview utility functions: 'gtk-tree-view-set-drag-dest-row', 3905'gtk-tree-view-get-drag-dest-row', 'gtk-tree-view-get-dest-row-at-pos', 3906'gtk-tree-view-create-row-drag-icon', 'gtk-tree-set-row-drag-data' and 3907'gtk-tree-get-row-drag-data'. This API leaves a lot of flexibility, but 3908nothing is done automatically, and implementing advanced features like 3909hover-to-open-rows or autoscrolling on top of this API is a lot of work. 3910 3911 On the other hand, if you write to the high-level API, then all the 3912bookkeeping of rows is done for you, as well as things like 3913hover-to-open and auto-scroll, but your models have to implement the 3914'<gtk-tree-drag-source>' and '<gtk-tree-drag-dest>' interfaces. 3915 391636.2 Usage 3917========== 3918 3919 -- Class: <gtk-tree-drag-source> 3920 Derives from '<ginterface>'. 3921 3922 This class defines no direct slots. 3923 3924 -- Class: <gtk-tree-drag-dest> 3925 Derives from '<ginterface>'. 3926 3927 This class defines no direct slots. 3928 3929 -- Function: gtk-tree-drag-source-drag-data-get 3930 (self '<gtk-tree-drag-source>') (path '<gtk-tree-path>') 3931 (selection_data '<gtk-selection-data>') => (ret 'bool') 3932 -- Method: drag-data-get 3933 Asks the '<gtk-tree-drag-source>' to fill in SELECTION-DATA with a 3934 representation of the row at PATH. SELECTION-DATA->TARGET gives 3935 the required type of the data. Should robustly handle a PATH no 3936 longer found in the model! 3937 3938 DRAG-SOURCE 3939 a '<gtk-tree-drag-source>' 3940 3941 PATH 3942 row that was dragged 3943 3944 SELECTION-DATA 3945 a '<gtk-selection-data>' to fill with data from the dragged 3946 row 3947 3948 RET 3949 ''#t'' if data of the required type was provided 3950 3951 -- Function: gtk-tree-drag-source-row-draggable 3952 (self '<gtk-tree-drag-source>') (path '<gtk-tree-path>') => 3953 (ret 'bool') 3954 -- Method: row-draggable 3955 Asks the '<gtk-tree-drag-source>' whether a particular row can be 3956 used as the source of a DND operation. If the source doesn't 3957 implement this interface, the row is assumed draggable. 3958 3959 DRAG-SOURCE 3960 a '<gtk-tree-drag-source>' 3961 3962 PATH 3963 row on which user is initiating a drag 3964 3965 RET 3966 ''#t'' if the row can be dragged 3967 3968 -- Function: gtk-tree-set-row-drag-data (self '<gtk-selection-data>') 3969 (tree_model '<gtk-tree-model>') (path '<gtk-tree-path>') => 3970 (ret 'bool') 3971 Sets selection data of target type 'GTK_TREE_MODEL_ROW'. Normally 3972 used in a drag_data_get handler. 3973 3974 SELECTION-DATA 3975 some '<gtk-selection-data>' 3976 3977 TREE-MODEL 3978 a '<gtk-tree-model>' 3979 3980 PATH 3981 a row in TREE-MODEL 3982 3983 RET 3984 ''#t'' if the '<gtk-selection-data>' had the proper target 3985 type to allow us to set a tree row 3986 3987 3988File: guile-gnome-gtk.info, Node: GtkCellView, Next: GtkIconView, Prev: GtkTreeView drag-and-drop, Up: Top 3989 399037 GtkCellView 3991************** 3992 3993A widget displaying a single row of a GtkTreeModel 3994 399537.1 Overview 3996============= 3997 3998A '<gtk-cell-view>' displays a single row of a '<gtk-tree-model>', using 3999cell renderers just like '<gtk-tree-view>'. '<gtk-cell-view>' doesn't 4000support some of the more complex features of '<gtk-tree-view>', like 4001cell editing and drag and drop. 4002 400337.2 Usage 4004========== 4005 4006 -- Class: <gtk-cell-view> 4007 Derives from '<gtk-cell-layout>', '<gtk-widget>'. 4008 4009 This class defines the following slots: 4010 4011 'background' 4012 Background color as a string 4013 4014 'background-gdk' 4015 Background color as a GdkColor 4016 4017 'background-set' 4018 Whether this tag affects the background color 4019 4020 'model' 4021 The model for cell view 4022 4023 -- Function: gtk-cell-view-new => (ret '<gtk-widget>') 4024 Creates a new '<gtk-cell-view>' widget. 4025 4026 RET 4027 A newly created '<gtk-cell-view>' widget. 4028 4029 Since 2.6 4030 4031 -- Function: gtk-cell-view-new-with-text (text 'mchars') => 4032 (ret '<gtk-widget>') 4033 Creates a new '<gtk-cell-view>' widget, adds a 4034 '<gtk-cell-renderer-text>' to it, and makes its show TEXT. 4035 4036 TEXT 4037 the text to display in the cell view 4038 4039 RET 4040 A newly created '<gtk-cell-view>' widget. 4041 4042 Since 2.6 4043 4044 -- Function: gtk-cell-view-new-with-markup (markup 'mchars') => 4045 (ret '<gtk-widget>') 4046 Creates a new '<gtk-cell-view>' widget, adds a 4047 '<gtk-cell-renderer-text>' to it, and makes its show MARKUP. The 4048 text can text can be marked up with the Pango text markup language. 4049 4050 MARKUP 4051 the text to display in the cell view 4052 4053 RET 4054 A newly created '<gtk-cell-view>' widget. 4055 4056 Since 2.6 4057 4058 -- Function: gtk-cell-view-new-with-pixbuf (pixbuf '<gdk-pixbuf>') => 4059 (ret '<gtk-widget>') 4060 Creates a new '<gtk-cell-view>' widget, adds a 4061 '<gtk-cell-renderer-pixbuf>' to it, and makes its show PIXBUF. 4062 4063 PIXBUF 4064 the image to display in the cell view 4065 4066 RET 4067 A newly created '<gtk-cell-view>' widget. 4068 4069 Since 2.6 4070 4071 -- Function: gtk-cell-view-set-model (self '<gtk-cell-view>') 4072 (model '<gtk-tree-model>') 4073 -- Method: set-model 4074 Sets the model for CELL-VIEW. If CELL-VIEW already has a model 4075 set, it will remove it before setting the new model. If MODEL is 4076 ''#f'', then it will unset the old model. 4077 4078 CELL-VIEW 4079 a '<gtk-cell-view>' 4080 4081 MODEL 4082 a '<gtk-tree-model>' 4083 4084 Since 2.6 4085 4086 -- Function: gtk-cell-view-set-displayed-row (self '<gtk-cell-view>') 4087 (path '<gtk-tree-path>') 4088 -- Method: set-displayed-row 4089 Sets the row of the model that is currently displayed by the 4090 '<gtk-cell-view>'. If the path is unset, then the contents of the 4091 cellview "stick" at their last value; this is not normally a 4092 desired result, but may be a needed intermediate state if say, the 4093 model for the '<gtk-cell-view>' becomes temporarily empty. 4094 4095 CELL-VIEW 4096 a '<gtk-cell-view>' 4097 4098 PATH 4099 a '<gtk-tree-path>' or ''#f'' to unset. 4100 4101 Since 2.6 4102 4103 -- Function: gtk-cell-view-get-displayed-row (self '<gtk-cell-view>') 4104 => (ret '<gtk-tree-path>') 4105 -- Method: get-displayed-row 4106 Returns a '<gtk-tree-path>' referring to the currently displayed 4107 row. If no row is currently displayed, ''#f'' is returned. 4108 4109 CELL-VIEW 4110 a '<gtk-cell-view>' 4111 4112 RET 4113 the currently displayed row or ''#f'' 4114 4115 Since 2.6 4116 4117 -- Function: gtk-cell-view-get-size-of-row (self '<gtk-cell-view>') 4118 (path '<gtk-tree-path>') (requisition '<gtk-requisition>') => 4119 (ret 'bool') 4120 -- Method: get-size-of-row 4121 Sets REQUISITION to the size needed by CELL-VIEW to display the 4122 model row pointed to by PATH. 4123 4124 CELL-VIEW 4125 a '<gtk-cell-view>' 4126 4127 PATH 4128 a '<gtk-tree-path>' 4129 4130 REQUISITION 4131 return location for the size 4132 4133 RET 4134 ''#t'' 4135 4136 Since 2.6 4137 4138 -- Function: gtk-cell-view-set-background-color 4139 (self '<gtk-cell-view>') (color '<gdk-color>') 4140 -- Method: set-background-color 4141 Sets the background color of VIEW. 4142 4143 CELL-VIEW 4144 a '<gtk-cell-view>' 4145 4146 COLOR 4147 the new background color 4148 4149 Since 2.6 4150 4151 -- Function: gtk-cell-view-get-cell-renderers (self '<gtk-cell-view>') 4152 => (ret 'glist-of') 4153 -- Method: get-cell-renderers 4154 Returns the cell renderers which have been added to CELL-VIEW. 4155 4156 CELL-VIEW 4157 a '<gtk-cell-view>' 4158 4159 RET 4160 a list of cell renderers. The list, but not the renderers has 4161 been newly allocated and should be freed with 'g-list-free' 4162 when no longer needed. 4163 4164 Since 2.6 4165 4166 4167File: guile-gnome-gtk.info, Node: GtkIconView, Next: GtkTreeSortable, Prev: GtkCellView, Up: Top 4168 416938 GtkIconView 4170************** 4171 4172A widget which displays a list of icons in a grid 4173 417438.1 Overview 4175============= 4176 4177'<gtk-icon-view>' provides an alternative view on a list model. It 4178displays the model as a grid of icons with labels. Like 4179'<gtk-tree-view>', it allows to select one or multiple items (depending 4180on the selection mode, see 'gtk-icon-view-set-selection-mode'). In 4181addition to selection with the arrow keys, '<gtk-icon-view>' supports 4182rubberband selection, which is controlled by dragging the pointer. 4183 418438.2 Usage 4185========== 4186 4187 -- Class: <gtk-icon-view> 4188 Derives from '<gtk-cell-layout>', '<gtk-container>'. 4189 4190 This class defines the following slots: 4191 4192 'pixbuf-column' 4193 Model column used to retrieve the icon pixbuf from 4194 4195 'text-column' 4196 Model column used to retrieve the text from 4197 4198 'markup-column' 4199 Model column used to retrieve the text if using Pango markup 4200 4201 'selection-mode' 4202 The selection mode 4203 4204 'orientation' 4205 How the text and icon of each item are positioned relative to 4206 each other 4207 4208 'model' 4209 The model for the icon view 4210 4211 'columns' 4212 Number of columns to display 4213 4214 'item-width' 4215 The width used for each item 4216 4217 'spacing' 4218 Space which is inserted between cells of an item 4219 4220 'row-spacing' 4221 Space which is inserted between grid rows 4222 4223 'column-spacing' 4224 Space which is inserted between grid columns 4225 4226 'margin' 4227 Space which is inserted at the edges of the icon view 4228 4229 'reorderable' 4230 View is reorderable 4231 4232 'tooltip-column' 4233 The column in the model containing the tooltip texts for the 4234 items 4235 4236 -- Signal on <gtk-icon-view>: move-cursor (arg0 '<gtk-movement-step>') 4237 (arg1 '<gint>') => '<gboolean>' 4238 4239 -- Signal on <gtk-icon-view>: selection-changed 4240 4241 -- Signal on <gtk-icon-view>: set-scroll-adjustments 4242 (arg0 '<gtk-adjustment>') (arg1 '<gtk-adjustment>') 4243 4244 -- Signal on <gtk-icon-view>: item-activated (arg0 '<gtk-tree-path>') 4245 4246 -- Signal on <gtk-icon-view>: select-all 4247 4248 -- Signal on <gtk-icon-view>: unselect-all 4249 4250 -- Signal on <gtk-icon-view>: select-cursor-item 4251 4252 -- Signal on <gtk-icon-view>: toggle-cursor-item 4253 4254 -- Signal on <gtk-icon-view>: activate-cursor-item => '<gboolean>' 4255 4256 -- Function: gtk-icon-view-new => (ret '<gtk-widget>') 4257 Creates a new '<gtk-icon-view>' widget 4258 4259 RET 4260 A newly created '<gtk-icon-view>' widget 4261 4262 Since 2.6 4263 4264 -- Function: gtk-icon-view-new-with-model (model '<gtk-tree-model>') 4265 => (ret '<gtk-widget>') 4266 Creates a new '<gtk-icon-view>' widget with the model MODEL. 4267 4268 MODEL 4269 The model. 4270 4271 RET 4272 A newly created '<gtk-icon-view>' widget. 4273 4274 Since 2.6 4275 4276 -- Function: gtk-icon-view-set-model (self '<gtk-icon-view>') 4277 (model '<gtk-tree-model>') 4278 -- Method: set-model 4279 Sets the model for a '<gtk-icon-view>'. If the ICON-VIEW already 4280 has a model set, it will remove it before setting the new model. 4281 If MODEL is ''#f'', then it will unset the old model. 4282 4283 ICON-VIEW 4284 A '<gtk-icon-view>'. 4285 4286 MODEL 4287 The model. 4288 4289 Since 2.6 4290 4291 -- Function: gtk-icon-view-get-model (self '<gtk-icon-view>') => 4292 (ret '<gtk-tree-model>') 4293 -- Method: get-model 4294 Returns the model the '<gtk-icon-view>' is based on. Returns 4295 ''#f'' if the model is unset. 4296 4297 ICON-VIEW 4298 a '<gtk-icon-view>' 4299 4300 RET 4301 A '<gtk-tree-model>', or ''#f'' if none is currently being 4302 used. 4303 4304 Since 2.6 4305 4306 -- Function: gtk-icon-view-set-text-column (self '<gtk-icon-view>') 4307 (column 'int') 4308 -- Method: set-text-column 4309 Sets the column with text for ICON-VIEW to be COLUMN. The text 4310 column must be of type '<g-type-string>'. 4311 4312 ICON-VIEW 4313 A '<gtk-icon-view>'. 4314 4315 COLUMN 4316 A column in the currently used model. 4317 4318 Since 2.6 4319 4320 -- Function: gtk-icon-view-get-text-column (self '<gtk-icon-view>') => 4321 (ret 'int') 4322 -- Method: get-text-column 4323 Returns the column with text for ICON-VIEW. 4324 4325 ICON-VIEW 4326 A '<gtk-icon-view>'. 4327 4328 RET 4329 the text column, or -1 if it's unset. 4330 4331 Since 2.6 4332 4333 -- Function: gtk-icon-view-set-markup-column (self '<gtk-icon-view>') 4334 (column 'int') 4335 -- Method: set-markup-column 4336 Sets the column with markup information for ICON-VIEW to be COLUMN. 4337 The markup column must be of type '<g-type-string>'. If the markup 4338 column is set to something, it overrides the text column set by 4339 'gtk-icon-view-set-text-column'. 4340 4341 ICON-VIEW 4342 A '<gtk-icon-view>'. 4343 4344 COLUMN 4345 A column in the currently used model. 4346 4347 Since 2.6 4348 4349 -- Function: gtk-icon-view-get-markup-column (self '<gtk-icon-view>') 4350 => (ret 'int') 4351 -- Method: get-markup-column 4352 Returns the column with markup text for ICON-VIEW. 4353 4354 ICON-VIEW 4355 A '<gtk-icon-view>'. 4356 4357 RET 4358 the markup column, or -1 if it's unset. 4359 4360 Since 2.6 4361 4362 -- Function: gtk-icon-view-set-pixbuf-column (self '<gtk-icon-view>') 4363 (column 'int') 4364 -- Method: set-pixbuf-column 4365 Sets the column with pixbufs for ICON-VIEW to be COLUMN. The 4366 pixbuf column must be of type '<gdk-type-pixbuf>' 4367 4368 ICON-VIEW 4369 A '<gtk-icon-view>'. 4370 4371 COLUMN 4372 A column in the currently used model. 4373 4374 Since 2.6 4375 4376 -- Function: gtk-icon-view-get-pixbuf-column (self '<gtk-icon-view>') 4377 => (ret 'int') 4378 -- Method: get-pixbuf-column 4379 Returns the column with pixbufs for ICON-VIEW. 4380 4381 ICON-VIEW 4382 A '<gtk-icon-view>'. 4383 4384 RET 4385 the pixbuf column, or -1 if it's unset. 4386 4387 Since 2.6 4388 4389 -- Function: gtk-icon-view-get-path-at-pos (self '<gtk-icon-view>') 4390 (x 'int') (y 'int') => (ret '<gtk-tree-path>') 4391 -- Method: get-path-at-pos 4392 Finds the path at the point (X, Y), relative to widget coordinates. 4393 See 'gtk-icon-view-get-item-at-pos', if you are also interested in 4394 the cell at the specified position. 4395 4396 ICON-VIEW 4397 A '<gtk-icon-view>'. 4398 4399 X 4400 The x position to be identified 4401 4402 Y 4403 The y position to be identified 4404 4405 RET 4406 The '<gtk-tree-path>' corresponding to the icon or ''#f'' if 4407 no icon exists at that position. 4408 4409 Since 2.6 4410 4411 -- Function: gtk-icon-view-set-cursor (self '<gtk-icon-view>') 4412 (path '<gtk-tree-path>') (cell '<gtk-cell-renderer>') 4413 (start_editing 'bool') 4414 -- Method: set-cursor 4415 Sets the current keyboard focus to be at PATH, and selects it. 4416 This is useful when you want to focus the user's attention on a 4417 particular item. If CELL is not ''#f'', then focus is given to the 4418 cell specified by it. Additionally, if START-EDITING is ''#t'', 4419 then editing should be started in the specified cell. 4420 4421 This function is often followed by 'gtk_widget_grab_focus 4422 (icon_view)' in order to give keyboard focus to the widget. Please 4423 note that editing can only happen when the widget is realized. 4424 4425 ICON-VIEW 4426 A '<gtk-icon-view>' 4427 4428 PATH 4429 A '<gtk-tree-path>' 4430 4431 CELL 4432 One of the cell renderers of ICON-VIEW, or ''#f'' 4433 4434 START-EDITING 4435 ''#t'' if the specified cell should start being edited. 4436 4437 Since 2.8 4438 4439 -- Function: gtk-icon-view-set-selection-mode (self '<gtk-icon-view>') 4440 (mode '<gtk-selection-mode>') 4441 -- Method: set-selection-mode 4442 Sets the selection mode of the ICON-VIEW. 4443 4444 ICON-VIEW 4445 A '<gtk-icon-view>'. 4446 4447 MODE 4448 The selection mode 4449 4450 Since 2.6 4451 4452 -- Function: gtk-icon-view-get-selection-mode (self '<gtk-icon-view>') 4453 => (ret '<gtk-selection-mode>') 4454 -- Method: get-selection-mode 4455 Gets the selection mode of the ICON-VIEW. 4456 4457 ICON-VIEW 4458 A '<gtk-icon-view>'. 4459 4460 RET 4461 the current selection mode 4462 4463 Since 2.6 4464 4465 -- Function: gtk-icon-view-set-orientation (self '<gtk-icon-view>') 4466 (orientation '<gtk-orientation>') 4467 -- Method: set-orientation 4468 Sets the ::orientation property which determines whether the labels 4469 are drawn beside the icons instead of below. 4470 4471 ICON-VIEW 4472 a '<gtk-icon-view>' 4473 4474 ORIENTATION 4475 the relative position of texts and icons 4476 4477 Since 2.6 4478 4479 -- Function: gtk-icon-view-get-orientation (self '<gtk-icon-view>') => 4480 (ret '<gtk-orientation>') 4481 -- Method: get-orientation 4482 Returns the value of the ::orientation property which determines 4483 whether the labels are drawn beside the icons instead of below. 4484 4485 ICON-VIEW 4486 a '<gtk-icon-view>' 4487 4488 RET 4489 the relative position of texts and icons 4490 4491 Since 2.6 4492 4493 -- Function: gtk-icon-view-set-columns (self '<gtk-icon-view>') 4494 (columns 'int') 4495 -- Method: set-columns 4496 Sets the ::columns property which determines in how many columns 4497 the icons are arranged. If COLUMNS is -1, the number of columns 4498 will be chosen automatically to fill the available area. 4499 4500 ICON-VIEW 4501 a '<gtk-icon-view>' 4502 4503 COLUMNS 4504 the number of columns 4505 4506 Since 2.6 4507 4508 -- Function: gtk-icon-view-get-columns (self '<gtk-icon-view>') => 4509 (ret 'int') 4510 -- Method: get-columns 4511 Returns the value of the ::columns property. 4512 4513 ICON-VIEW 4514 a '<gtk-icon-view>' 4515 4516 RET 4517 the number of columns, or -1 4518 4519 Since 2.6 4520 4521 -- Function: gtk-icon-view-set-item-width (self '<gtk-icon-view>') 4522 (item_width 'int') 4523 -- Method: set-item-width 4524 Sets the ::item-width property which specifies the width to use for 4525 each item. If it is set to -1, the icon view will automatically 4526 determine a suitable item size. 4527 4528 ICON-VIEW 4529 a '<gtk-icon-view>' 4530 4531 ITEM-WIDTH 4532 the width for each item 4533 4534 Since 2.6 4535 4536 -- Function: gtk-icon-view-get-item-width (self '<gtk-icon-view>') => 4537 (ret 'int') 4538 -- Method: get-item-width 4539 Returns the value of the ::item-width property. 4540 4541 ICON-VIEW 4542 a '<gtk-icon-view>' 4543 4544 RET 4545 the width of a single item, or -1 4546 4547 Since 2.6 4548 4549 -- Function: gtk-icon-view-set-spacing (self '<gtk-icon-view>') 4550 (spacing 'int') 4551 -- Method: set-spacing 4552 Sets the ::spacing property which specifies the space which is 4553 inserted between the cells (i.e. the icon and the text) of an 4554 item. 4555 4556 ICON-VIEW 4557 a '<gtk-icon-view>' 4558 4559 SPACING 4560 the spacing 4561 4562 Since 2.6 4563 4564 -- Function: gtk-icon-view-get-spacing (self '<gtk-icon-view>') => 4565 (ret 'int') 4566 -- Method: get-spacing 4567 Returns the value of the ::spacing property. 4568 4569 ICON-VIEW 4570 a '<gtk-icon-view>' 4571 4572 RET 4573 the space between cells 4574 4575 Since 2.6 4576 4577 -- Function: gtk-icon-view-set-row-spacing (self '<gtk-icon-view>') 4578 (row_spacing 'int') 4579 -- Method: set-row-spacing 4580 Sets the ::row-spacing property which specifies the space which is 4581 inserted between the rows of the icon view. 4582 4583 ICON-VIEW 4584 a '<gtk-icon-view>' 4585 4586 ROW-SPACING 4587 the row spacing 4588 4589 Since 2.6 4590 4591 -- Function: gtk-icon-view-get-row-spacing (self '<gtk-icon-view>') => 4592 (ret 'int') 4593 -- Method: get-row-spacing 4594 Returns the value of the ::row-spacing property. 4595 4596 ICON-VIEW 4597 a '<gtk-icon-view>' 4598 4599 RET 4600 the space between rows 4601 4602 Since 2.6 4603 4604 -- Function: gtk-icon-view-set-column-spacing (self '<gtk-icon-view>') 4605 (column_spacing 'int') 4606 -- Method: set-column-spacing 4607 Sets the ::column-spacing property which specifies the space which 4608 is inserted between the columns of the icon view. 4609 4610 ICON-VIEW 4611 a '<gtk-icon-view>' 4612 4613 COLUMN-SPACING 4614 the column spacing 4615 4616 Since 2.6 4617 4618 -- Function: gtk-icon-view-get-column-spacing (self '<gtk-icon-view>') 4619 => (ret 'int') 4620 -- Method: get-column-spacing 4621 Returns the value of the ::column-spacing property. 4622 4623 ICON-VIEW 4624 a '<gtk-icon-view>' 4625 4626 RET 4627 the space between columns 4628 4629 Since 2.6 4630 4631 -- Function: gtk-icon-view-set-margin (self '<gtk-icon-view>') 4632 (margin 'int') 4633 -- Method: set-margin 4634 Sets the ::margin property which specifies the space which is 4635 inserted at the top, bottom, left and right of the icon view. 4636 4637 ICON-VIEW 4638 a '<gtk-icon-view>' 4639 4640 MARGIN 4641 the margin 4642 4643 Since 2.6 4644 4645 -- Function: gtk-icon-view-get-margin (self '<gtk-icon-view>') => 4646 (ret 'int') 4647 -- Method: get-margin 4648 Returns the value of the ::margin property. 4649 4650 ICON-VIEW 4651 a '<gtk-icon-view>' 4652 4653 RET 4654 the space at the borders 4655 4656 Since 2.6 4657 4658 -- Function: gtk-icon-view-select-path (self '<gtk-icon-view>') 4659 (path '<gtk-tree-path>') 4660 -- Method: select-path 4661 Selects the row at PATH. 4662 4663 ICON-VIEW 4664 A '<gtk-icon-view>'. 4665 4666 PATH 4667 The '<gtk-tree-path>' to be selected. 4668 4669 Since 2.6 4670 4671 -- Function: gtk-icon-view-unselect-path (self '<gtk-icon-view>') 4672 (path '<gtk-tree-path>') 4673 -- Method: unselect-path 4674 Unselects the row at PATH. 4675 4676 ICON-VIEW 4677 A '<gtk-icon-view>'. 4678 4679 PATH 4680 The '<gtk-tree-path>' to be unselected. 4681 4682 Since 2.6 4683 4684 -- Function: gtk-icon-view-path-is-selected (self '<gtk-icon-view>') 4685 (path '<gtk-tree-path>') => (ret 'bool') 4686 -- Method: path-is-selected 4687 Returns ''#t'' if the icon pointed to by PATH is currently 4688 selected. If ICON does not point to a valid location, ''#f'' is 4689 returned. 4690 4691 ICON-VIEW 4692 A '<gtk-icon-view>'. 4693 4694 PATH 4695 A '<gtk-tree-path>' to check selection on. 4696 4697 RET 4698 ''#t'' if PATH is selected. 4699 4700 Since 2.6 4701 4702 -- Function: gtk-icon-view-get-selected-items (self '<gtk-icon-view>') 4703 => (ret 'glist-of') 4704 -- Method: get-selected-items 4705 Creates a list of paths of all selected items. Additionally, if 4706 you are planning on modifying the model after calling this 4707 function, you may want to convert the returned list into a list of 4708 '<gtk-tree-row-reference>'s. To do this, you can use 4709 'gtk-tree-row-reference-new'. 4710 4711 To free the return value, use: 4712 4713 4714 g_list_foreach (list, gtk_tree_path_free, NULL); 4715 g_list_free (list); 4716 4717 ICON-VIEW 4718 A '<gtk-icon-view>'. 4719 4720 RET 4721 A '<g-list>' containing a '<gtk-tree-path>' for each selected 4722 row. 4723 4724 Since 2.6 4725 4726 -- Function: gtk-icon-view-select-all (self '<gtk-icon-view>') 4727 -- Method: select-all 4728 Selects all the icons. ICON-VIEW must has its selection mode set 4729 to '<gtk-selection-multiple>'. 4730 4731 ICON-VIEW 4732 A '<gtk-icon-view>'. 4733 4734 Since 2.6 4735 4736 -- Function: gtk-icon-view-unselect-all (self '<gtk-icon-view>') 4737 -- Method: unselect-all 4738 Unselects all the icons. 4739 4740 ICON-VIEW 4741 A '<gtk-icon-view>'. 4742 4743 Since 2.6 4744 4745 -- Function: gtk-icon-view-item-activated (self '<gtk-icon-view>') 4746 (path '<gtk-tree-path>') 4747 -- Method: item-activated 4748 Activates the item determined by PATH. 4749 4750 ICON-VIEW 4751 A '<gtk-icon-view>' 4752 4753 PATH 4754 The '<gtk-tree-path>' to be activated 4755 4756 Since 2.6 4757 4758 -- Function: gtk-icon-view-scroll-to-path (self '<gtk-icon-view>') 4759 (path '<gtk-tree-path>') (use_align 'bool') 4760 (row_align 'float') (col_align 'float') 4761 -- Method: scroll-to-path 4762 Moves the alignments of ICON-VIEW to the position specified by 4763 PATH. ROW-ALIGN determines where the row is placed, and COL-ALIGN 4764 determines where COLUMN is placed. Both are expected to be between 4765 0.0 and 1.0. 0.0 means left/top alignment, 1.0 means right/bottom 4766 alignment, 0.5 means center. 4767 4768 If USE-ALIGN is ''#f'', then the alignment arguments are ignored, 4769 and the tree does the minimum amount of work to scroll the item 4770 onto the screen. This means that the item will be scrolled to the 4771 edge closest to its current position. If the item is currently 4772 visible on the screen, nothing is done. 4773 4774 This function only works if the model is set, and PATH is a valid 4775 row on the model. If the model changes before the ICON-VIEW is 4776 realized, the centered path will be modified to reflect this 4777 change. 4778 4779 ICON-VIEW 4780 A '<gtk-icon-view>'. 4781 4782 PATH 4783 The path of the item to move to. 4784 4785 USE-ALIGN 4786 whether to use alignment arguments, or ''#f''. 4787 4788 ROW-ALIGN 4789 The vertical alignment of the item specified by PATH. 4790 4791 COL-ALIGN 4792 The horizontal alignment of the item specified by PATH. 4793 4794 Since 2.8 4795 4796 -- Function: gtk-icon-view-unset-model-drag-dest 4797 (self '<gtk-icon-view>') 4798 -- Method: unset-model-drag-dest 4799 Undoes the effect of 'gtk-icon-view-enable-model-drag-dest'. 4800 4801 ICON-VIEW 4802 a '<gtk-icon-view>' 4803 4804 Since 2.8 4805 4806 -- Function: gtk-icon-view-set-reorderable (self '<gtk-icon-view>') 4807 (reorderable 'bool') 4808 -- Method: set-reorderable 4809 This function is a convenience function to allow you to reorder 4810 models that support the '<gtk-tree-drag-source-iface>' and the 4811 '<gtk-tree-drag-dest-iface>'. Both '<gtk-tree-store>' and 4812 '<gtk-list-store>' support these. If REORDERABLE is ''#t'', then 4813 the user can reorder the model by dragging and dropping rows. The 4814 developer can listen to these changes by connecting to the model's 4815 row_inserted and row_deleted signals. 4816 4817 This function does not give you any degree of control over the 4818 order - any reordering is allowed. If more control is needed, you 4819 should probably handle drag and drop manually. 4820 4821 ICON-VIEW 4822 A '<gtk-icon-view>'. 4823 4824 REORDERABLE 4825 ''#t'', if the list of items can be reordered. 4826 4827 Since 2.8 4828 4829 -- Function: gtk-icon-view-get-reorderable (self '<gtk-icon-view>') => 4830 (ret 'bool') 4831 -- Method: get-reorderable 4832 Retrieves whether the user can reorder the list via drag-and-drop. 4833 See 'gtk-icon-view-set-reorderable'. 4834 4835 ICON-VIEW 4836 a '<gtk-icon-view>' 4837 4838 RET 4839 ''#t'' if the list can be reordered. 4840 4841 Since 2.8 4842 4843 -- Function: gtk-icon-view-set-drag-dest-item (self '<gtk-icon-view>') 4844 (path '<gtk-tree-path>') (pos '<gtk-icon-view-drop-position>') 4845 -- Method: set-drag-dest-item 4846 Sets the item that is highlighted for feedback. 4847 4848 ICON-VIEW 4849 a '<gtk-icon-view>' 4850 4851 PATH 4852 The path of the item to highlight, or ''#f''. 4853 4854 POS 4855 Specifies where to drop, relative to the item 4856 4857 Since 2.8 4858 4859 -- Function: gtk-icon-view-create-drag-icon (self '<gtk-icon-view>') 4860 (path '<gtk-tree-path>') => (ret '<gdk-pixmap>') 4861 -- Method: create-drag-icon 4862 Creates a '<gdk-pixmap>' representation of the item at PATH. This 4863 image is used for a drag icon. 4864 4865 ICON-VIEW 4866 a '<gtk-icon-view>' 4867 4868 PATH 4869 a '<gtk-tree-path>' in ICON-VIEW 4870 4871 RET 4872 a newly-allocated pixmap of the drag icon. 4873 4874 Since 2.8 4875 4876 4877File: guile-gnome-gtk.info, Node: GtkTreeSortable, Next: GtkTreeModelSort, Prev: GtkIconView, Up: Top 4878 487939 GtkTreeSortable 4880****************** 4881 4882The interface for sortable models used by GtkTreeView 4883 488439.1 Overview 4885============= 4886 4887'<gtk-tree-sortable>' is an interface to be implemented by tree models 4888which support sorting. The '<gtk-tree-view>' uses the methods provided 4889by this interface to sort the model. 4890 489139.2 Usage 4892========== 4893 4894 -- Class: <gtk-tree-sortable> 4895 Derives from '<ginterface>'. 4896 4897 This class defines no direct slots. 4898 4899 -- Signal on <gtk-tree-sortable>: sort-column-changed 4900 4901 4902File: guile-gnome-gtk.info, Node: GtkTreeModelSort, Next: GtkTreeModelFilter, Prev: GtkTreeSortable, Up: Top 4903 490440 GtkTreeModelSort 4905******************* 4906 4907A GtkTreeModel which makes an underlying tree model sortable 4908 490940.1 Overview 4910============= 4911 4912The '<gtk-tree-model-sort>' is a model which implements the 4913'<gtk-tree-sortable>' interface. It does not hold any data itself, but 4914rather is created with a child model and proxies its data. It has 4915identical column types to this child model, and the changes in the child 4916are propagated. The primary purpose of this model is to provide a way 4917to sort a different model without modifying it. Note that the sort 4918function used by '<gtk-tree-model-sort>' is not guaranteed to be stable. 4919 4920 The use of this is best demonstrated through an example. In the 4921following sample code we create two '<gtk-tree-view>' widgets each with 4922a view of the same data. As the model is wrapped here by a 4923'<gtk-tree-model-sort>', the two '<gtk-tree-view>'s can each sort their 4924view of the data without affecting the other. By contrast, if we simply 4925put the same model in each widget, then sorting the first would sort the 4926second. 4927 4928 4929 { 4930 GtkTreeView *tree_view1; 4931 GtkTreeView *tree_view2; 4932 GtkTreeModel *sort_model1; 4933 GtkTreeModel *sort_model2; 4934 GtkTreeModel *child_model; 4935 4936 /* get the child model */ 4937 child_model = get_my_model (); 4938 4939 /* Create the first tree */ 4940 sort_model1 = gtk_tree_model_sort_new_with_model (child_model); 4941 tree_view1 = gtk_tree_view_new_with_model (sort_model1); 4942 4943 /* Create the second tree */ 4944 sort_model2 = gtk_tree_model_sort_new_with_model (child_model); 4945 tree_view2 = gtk_tree_view_new_with_model (sort_model2); 4946 4947 /* Now we can sort the two models independently */ 4948 gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sort_model1), 4949 COLUMN_1, GTK_SORT_ASCENDING); 4950 gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sort_model2), 4951 COLUMN_1, GTK_SORT_DESCENDING); 4952 } 4953 4954 To demonstrate how to access the underlying child model from the sort 4955model, the next example will be a callback for the 4956'<gtk-tree-selection>' "changed" signal. In this callback, we get a 4957string from COLUMN_1 of the model. We then modify the string, find the 4958same selected row on the child model, and change the row there. 4959 4960 4961 void 4962 selection_changed (GtkTreeSelection *selection, gpointer data) 4963 { 4964 GtkTreeModel *sort_model = NULL; 4965 GtkTreeModel *child_model; 4966 GtkTreeIter sort_iter; 4967 GtkTreeIter child_iter; 4968 char *some_data = NULL; 4969 char *modified_data; 4970 4971 /* Get the current selected row and the model. */ 4972 if (! gtk_tree_selection_get_selected (selection, 4973 &sort_model, 4974 &sort_iter)) 4975 return; 4976 4977 4978 /* Look up the current value on the selected row and get a new value 4979 * to change it to. 4980 */ 4981 gtk_tree_model_get (GTK_TREE_MODEL (sort_model), &sort_iter, 4982 COLUMN_1, &some_data, 4983 -1); 4984 4985 modified_data = change_the_data (some_data); 4986 g_free (some_data); 4987 4988 /* Get an iterator on the child model, instead of the sort model. */ 4989 gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (sort_model), 4990 &child_iter, 4991 &sort_iter); 4992 4993 /* Get the child model and change the value of the row. In this 4994 * example, the child model is a GtkListStore. It could be any other 4995 * type of model, though. 4996 */ 4997 child_model = gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (sort_model)); 4998 gtk_list_store_set (GTK_LIST_STORE (child_model), &child_iter, 4999 COLUMN_1, &modified_data, 5000 -1); 5001 g_free (modified_data); 5002 } 5003 500440.2 Usage 5005========== 5006 5007 -- Class: <gtk-tree-model-sort> 5008 Derives from '<gtk-tree-model>', '<gtk-tree-sortable>', 5009 '<gtk-tree-drag-source>', '<gobject>'. 5010 5011 This class defines the following slots: 5012 5013 'model' 5014 The model for the TreeModelSort to sort 5015 5016 -- Function: gtk-tree-model-sort-new-with-model 5017 (child_model '<gtk-tree-model>') => (ret '<gtk-tree-model>') 5018 Creates a new '<gtk-tree-model>', with CHILD-MODEL as the child 5019 model. 5020 5021 CHILD-MODEL 5022 A '<gtk-tree-model>' 5023 5024 RET 5025 A new '<gtk-tree-model>'. 5026 5027 -- Function: gtk-tree-model-sort-get-model 5028 (self '<gtk-tree-model-sort>') => (ret '<gtk-tree-model>') 5029 -- Method: get-model 5030 Returns the model the '<gtk-tree-model-sort>' is sorting. 5031 5032 TREE-MODEL 5033 a '<gtk-tree-model-sort>' 5034 5035 RET 5036 the "child model" being sorted 5037 5038 -- Function: gtk-tree-model-sort-clear-cache 5039 (self '<gtk-tree-model-sort>') 5040 -- Method: clear-cache 5041 This function should almost never be called. It clears the 5042 TREE-MODEL-SORT of any cached iterators that haven't been reffed 5043 with 'gtk-tree-model-ref-node'. This might be useful if the child 5044 model being sorted is static (and doesn't change often) and there 5045 has been a lot of unreffed access to nodes. As a side effect of 5046 this function, all unreffed iters will be invalid. 5047 5048 TREE-MODEL-SORT 5049 A '<gtk-tree-model-sort>' 5050 5051 -- Function: gtk-tree-model-sort-iter-is-valid 5052 (self '<gtk-tree-model-sort>') (iter '<gtk-tree-iter>') => 5053 (ret 'bool') 5054 -- Method: iter-is-valid 5055 5056 This function is slow. Only use it for debugging and/or testing 5057 purposes. 5058 5059 Checks if the given iter is a valid iter for this 5060 '<gtk-tree-model-sort>'. 5061 5062 TREE-MODEL-SORT 5063 A '<gtk-tree-model-sort>'. 5064 5065 ITER 5066 A '<gtk-tree-iter>'. 5067 5068 RET 5069 ''#t'' if the iter is valid, ''#f'' if the iter is invalid. 5070 5071 Since 2.2 5072 5073 5074File: guile-gnome-gtk.info, Node: GtkTreeModelFilter, Next: GtkCellLayout, Prev: GtkTreeModelSort, Up: Top 5075 507641 GtkTreeModelFilter 5077********************* 5078 5079A GtkTreeModel which hides parts of an underlying tree model 5080 508141.1 Overview 5082============= 5083 5084A '<gtk-tree-model-filter>' is a tree model which wraps another tree 5085model, and can do the following things: 5086 5087 Filter specific rows, based on data from a "visible column", a column 5088storing booleans indicating whether the row should be filtered or not, 5089or based on the return value of a "visible function", which gets a 5090model, iter and user_data and returns a boolean indicating whether the 5091row should be filtered or not. 5092 5093 Modify the "appearance" of the model, using a modify function. This 5094is extremely powerful and allows for just changing some values and also 5095for creating a completely different model based on the given child 5096model. 5097 5098 Set a different root node, also known as a "virtual root". You can 5099pass in a '<gtk-tree-path>' indicating the root node for the filter at 5100construction time. 5101 510241.2 Usage 5103========== 5104 5105 -- Class: <gtk-tree-model-filter> 5106 Derives from '<gtk-tree-model>', '<gtk-tree-drag-source>', 5107 '<gobject>'. 5108 5109 This class defines the following slots: 5110 5111 'child-model' 5112 The model for the filtermodel to filter 5113 5114 'virtual-root' 5115 The virtual root (relative to the child model) for this 5116 filtermodel 5117 5118 -- Function: gtk-tree-model-filter-new (self '<gtk-tree-model>') 5119 (root '<gtk-tree-path>') => (ret '<gtk-tree-model>') 5120 -- Method: filter-new 5121 Creates a new '<gtk-tree-model>', with CHILD-MODEL as the 5122 child_model and ROOT as the virtual root. 5123 5124 CHILD-MODEL 5125 A '<gtk-tree-model>'. 5126 5127 ROOT 5128 A '<gtk-tree-path>' or ''#f''. 5129 5130 RET 5131 A new '<gtk-tree-model>'. 5132 5133 Since 2.4 5134 5135 -- Function: gtk-tree-model-filter-get-model 5136 (self '<gtk-tree-model-filter>') => (ret '<gtk-tree-model>') 5137 -- Method: get-model 5138 Returns a pointer to the child model of FILTER. 5139 5140 FILTER 5141 A '<gtk-tree-model-filter>'. 5142 5143 RET 5144 A pointer to a '<gtk-tree-model>'. 5145 5146 Since 2.4 5147 5148 -- Function: gtk-tree-model-filter-refilter 5149 (self '<gtk-tree-model-filter>') 5150 -- Method: refilter 5151 Emits ::row_changed for each row in the child model, which causes 5152 the filter to re-evaluate whether a row is visible or not. 5153 5154 FILTER 5155 A '<gtk-tree-model-filter>'. 5156 5157 Since 2.4 5158 5159 -- Function: gtk-tree-model-filter-clear-cache 5160 (self '<gtk-tree-model-filter>') 5161 -- Method: clear-cache 5162 This function should almost never be called. It clears the FILTER 5163 of any cached iterators that haven't been reffed with 5164 'gtk-tree-model-ref-node'. This might be useful if the child model 5165 being filtered is static (and doesn't change often) and there has 5166 been a lot of unreffed access to nodes. As a side effect of this 5167 function, all unreffed iters will be invalid. 5168 5169 FILTER 5170 A '<gtk-tree-model-filter>'. 5171 5172 Since 2.4 5173 5174 5175File: guile-gnome-gtk.info, Node: GtkCellLayout, Next: GtkCellRenderer, Prev: GtkTreeModelFilter, Up: Top 5176 517742 GtkCellLayout 5178**************** 5179 5180An interface for packing cells 5181 518242.1 Overview 5183============= 5184 5185'<gtk-cell-layout>' is an interface to be implemented by all objects 5186which want to provide a '<gtk-tree-view-column-like>' API for packing 5187cells, setting attributes and data funcs. 5188 5189 One of the notable features provided by implementations of 5190GtkCellLayout are _attributes_. Attributes let you set the properties 5191in flexible ways. They can just be set to constant values like regular 5192properties. But they can also be mapped to a column of the underlying 5193tree model with 'gtk-cell-layout-set-attributes', which means that the 5194value of the attribute can change from cell to cell as they are rendered 5195by the cell renderer. Finally, it is possible to specify a function 5196with 'gtk-cell-layout-set-cell-data-func' that is called to determine 5197the value of the attribute for each cell that is rendered. 5198 519942.2 Usage 5200========== 5201 5202 -- Class: <gtk-cell-layout> 5203 Derives from '<ginterface>'. 5204 5205 This class defines no direct slots. 5206 5207 -- Function: gtk-cell-layout-pack-start (self '<gtk-cell-layout>') 5208 (cell '<gtk-cell-renderer>') (expand 'bool') 5209 -- Method: pack-start 5210 Packs the CELL into the beginning of CELL-LAYOUT. If EXPAND is 5211 ''#f'', then the CELL is allocated no more space than it needs. 5212 Any unused space is divided evenly between cells for which EXPAND 5213 is ''#t''. 5214 5215 Note that reusing the same cell renderer is not supported. 5216 5217 CELL-LAYOUT 5218 A '<gtk-cell-layout>'. 5219 5220 CELL 5221 A '<gtk-cell-renderer>'. 5222 5223 EXPAND 5224 ''#t'' if CELL is to be given extra space allocated to 5225 CELL-LAYOUT. 5226 5227 Since 2.4 5228 5229 -- Function: gtk-cell-layout-pack-end (self '<gtk-cell-layout>') 5230 (cell '<gtk-cell-renderer>') (expand 'bool') 5231 -- Method: pack-end 5232 Adds the CELL to the end of CELL-LAYOUT. If EXPAND is ''#f'', then 5233 the CELL is allocated no more space than it needs. Any unused 5234 space is divided evenly between cells for which EXPAND is ''#t''. 5235 5236 Note that reusing the same cell renderer is not supported. 5237 5238 CELL-LAYOUT 5239 A '<gtk-cell-layout>'. 5240 5241 CELL 5242 A '<gtk-cell-renderer>'. 5243 5244 EXPAND 5245 ''#t'' if CELL is to be given extra space allocated to 5246 CELL-LAYOUT. 5247 5248 Since 2.4 5249 5250 -- Function: gtk-cell-layout-reorder (self '<gtk-cell-layout>') 5251 (cell '<gtk-cell-renderer>') (position 'int') 5252 -- Method: reorder 5253 Re-inserts CELL at POSITION. Note that CELL has already to be 5254 packed into CELL-LAYOUT for this to function properly. 5255 5256 CELL-LAYOUT 5257 A '<gtk-cell-layout>'. 5258 5259 CELL 5260 A '<gtk-cell-renderer>' to reorder. 5261 5262 POSITION 5263 New position to insert CELL at. 5264 5265 Since 2.4 5266 5267 -- Function: gtk-cell-layout-clear (self '<gtk-cell-layout>') 5268 -- Method: clear 5269 Unsets all the mappings on all renderers on CELL-LAYOUT and removes 5270 all renderers from CELL-LAYOUT. 5271 5272 CELL-LAYOUT 5273 A '<gtk-cell-layout>'. 5274 5275 Since 2.4 5276 5277 -- Function: gtk-cell-layout-add-attribute (self '<gtk-cell-layout>') 5278 (cell '<gtk-cell-renderer>') (attribute 'mchars') 5279 (column 'int') 5280 -- Method: add-attribute 5281 Adds an attribute mapping to the list in CELL-LAYOUT. The COLUMN 5282 is the column of the model to get a value from, and the ATTRIBUTE 5283 is the parameter on CELL to be set from the value. So for example 5284 if column 2 of the model contains strings, you could have the 5285 "text" attribute of a '<gtk-cell-renderer-text>' get its values 5286 from column 2. 5287 5288 CELL-LAYOUT 5289 A '<gtk-cell-layout>'. 5290 5291 CELL 5292 A '<gtk-cell-renderer>'. 5293 5294 ATTRIBUTE 5295 An attribute on the renderer. 5296 5297 COLUMN 5298 The column position on the model to get the attribute from. 5299 5300 Since 2.4 5301 5302 -- Function: gtk-cell-layout-clear-attributes 5303 (self '<gtk-cell-layout>') (cell '<gtk-cell-renderer>') 5304 -- Method: clear-attributes 5305 Clears all existing attributes previously set with 5306 'gtk-cell-layout-set-attributes'. 5307 5308 CELL-LAYOUT 5309 A '<gtk-cell-layout>'. 5310 5311 CELL 5312 A '<gtk-cell-renderer>' to clear the attribute mapping on. 5313 5314 Since 2.4 5315 5316 5317File: guile-gnome-gtk.info, Node: GtkCellRenderer, Next: GtkCellEditable, Prev: GtkCellLayout, Up: Top 5318 531943 GtkCellRenderer 5320****************** 5321 5322An object for rendering a single cell on a 5323 532443.1 Overview 5325============= 5326 5327The '<gtk-cell-renderer>' is a base class of a set of objects used for 5328rendering a cell to a '<gdk-drawable>'. These objects are used 5329primarily by the '<gtk-tree-view>' widget, though they aren't tied to 5330them in any specific way. It is worth noting that '<gtk-cell-renderer>' 5331is not a '<gtk-widget>' and cannot be treated as such. 5332 5333 The primary use of a '<gtk-cell-renderer>' is for drawing a certain 5334graphical elements on a '<gdk-drawable>'. Typically, one cell renderer 5335is used to draw many cells on the screen. To this extent, it isn't 5336expected that a CellRenderer keep any permanent state around. Instead, 5337any state is set just prior to use using '<gobject>'s property system. 5338Then, the cell is measured using 'gtk-cell-renderer-get-size'. Finally, 5339the cell is rendered in the correct location using 5340'gtk-cell-renderer-render'. 5341 5342 There are a number of rules that must be followed when writing a new 5343'<gtk-cell-renderer>'. First and formost, it's important that a certain 5344set of properties will always yield a cell renderer of the same size, 5345barring a '<gtk-style>' change. The '<gtk-cell-renderer>' also has a 5346number of generic properties that are expected to be honored by all 5347children. 5348 5349 Beyond merely rendering a cell, cell renderers can optionally provide 5350active user interface elements. A cell renderer can be "activatable" 5351like '<gtk-cell-renderer-toggle>', which toggles when it gets activated 5352by a mouse click, or it can be "editable" like 5353'<gtk-cell-renderer-text>', which allows the user to edit the text using 5354a '<gtk-entry>'. To make a cell renderer activatable or editable, you 5355have to implement the ACTIVATE or START-EDITING virtual functions, 5356respectively. 5357 535843.2 Usage 5359========== 5360 5361 -- Class: <gtk-cell-renderer> 5362 Derives from '<gtk-object>'. 5363 5364 This class defines the following slots: 5365 5366 'mode' 5367 Editable mode of the CellRenderer 5368 5369 'visible' 5370 Display the cell 5371 5372 'sensitive' 5373 Display the cell sensitive 5374 5375 'xalign' 5376 The x-align 5377 5378 'yalign' 5379 The y-align 5380 5381 'xpad' 5382 The xpad 5383 5384 'ypad' 5385 The ypad 5386 5387 'width' 5388 The fixed width 5389 5390 'height' 5391 The fixed height 5392 5393 'is-expander' 5394 Row has children 5395 5396 'is-expanded' 5397 Row is an expander row, and is expanded 5398 5399 'cell-background' 5400 Cell background color as a string 5401 5402 'cell-background-gdk' 5403 Cell background color as a GdkColor 5404 5405 'cell-background-set' 5406 Whether this tag affects the cell background color 5407 5408 -- Signal on <gtk-cell-renderer>: editing-canceled 5409 This signal gets emitted when the user cancels the process of 5410 editing a cell. For example, an editable cell renderer could be 5411 written to cancel editing when the user presses Escape. 5412 5413 See also: 'gtk-cell-renderer-editing-canceled' 5414 5415 Since 2.4 5416 5417 -- Signal on <gtk-cell-renderer>: editing-started 5418 (arg0 '<gtk-cell-editable>') (arg1 '<gchararray>') 5419 This signal gets emitted when a cell starts to be edited. The 5420 indended use of this signal is to do special setup on EDITABLE, 5421 e.g. adding a '<gtk-entry-completion>' or setting up additional 5422 columns in a '<gtk-combo-box>'. 5423 5424 Note that GTK+ doesn't guarantee that cell renderers will continue 5425 to use the same kind of widget for editing in future releases, 5426 therefore you should check the type of EDITABLE before doing any 5427 specific setup, as in the following example: 5428 5429 5430 static void 5431 text_editing_started (GtkCellRenderer *cell, 5432 GtkCellEditable *editable, 5433 const gchar *path, 5434 gpointer data) 5435 { 5436 if (GTK_IS_ENTRY (editable)) 5437 { 5438 GtkEntry *entry = GTK_ENTRY (editable); 5439 5440 /* ... create a GtkEntryCompletion */ 5441 5442 gtk_entry_set_completion (entry, completion); 5443 } 5444 } 5445 5446 Since 2.6 5447 5448 -- Function: gtk-cell-renderer-render (self '<gtk-cell-renderer>') 5449 (window '<gdk-window>') (widget '<gtk-widget>') 5450 (background_area '<gdk-rectangle>') 5451 (cell_area '<gdk-rectangle>') (expose_area '<gdk-rectangle>') 5452 (flags '<gtk-cell-renderer-state>') 5453 -- Method: render 5454 Invokes the virtual render function of the '<gtk-cell-renderer>'. 5455 The three passed-in rectangles are areas of WINDOW. Most renderers 5456 will draw within CELL-AREA; the xalign, yalign, xpad, and ypad 5457 fields of the '<gtk-cell-renderer>' should be honored with respect 5458 to CELL-AREA. BACKGROUND-AREA includes the blank space around the 5459 cell, and also the area containing the tree expander; so the 5460 BACKGROUND-AREA rectangles for all cells tile to cover the entire 5461 WINDOW. EXPOSE-AREA is a clip rectangle. 5462 5463 CELL 5464 a '<gtk-cell-renderer>' 5465 5466 WINDOW 5467 a '<gdk-drawable>' to draw to 5468 5469 WIDGET 5470 the widget owning WINDOW 5471 5472 BACKGROUND-AREA 5473 entire cell area (including tree expanders and maybe padding 5474 on the sides) 5475 5476 CELL-AREA 5477 area normally rendered by a cell renderer 5478 5479 EXPOSE-AREA 5480 area that actually needs updating 5481 5482 FLAGS 5483 flags that affect rendering 5484 5485 -- Function: gtk-cell-renderer-activate (self '<gtk-cell-renderer>') 5486 (event '<gdk-event>') (widget '<gtk-widget>') (path 'mchars') 5487 (background_area '<gdk-rectangle>') 5488 (cell_area '<gdk-rectangle>') 5489 (flags '<gtk-cell-renderer-state>') => (ret 'bool') 5490 -- Method: activate 5491 Passes an activate event to the cell renderer for possible 5492 processing. Some cell renderers may use events; for example, 5493 '<gtk-cell-renderer-toggle>' toggles when it gets a mouse click. 5494 5495 CELL 5496 a '<gtk-cell-renderer>' 5497 5498 EVENT 5499 a '<gdk-event>' 5500 5501 WIDGET 5502 widget that received the event 5503 5504 PATH 5505 widget-dependent string representation of the event location; 5506 e.g. for '<gtk-tree-view>', a string representation of 5507 '<gtk-tree-path>' 5508 5509 BACKGROUND-AREA 5510 background area as passed to GTK-CELL-RENDERER-RENDER 5511 5512 CELL-AREA 5513 cell area as passed to GTK-CELL-RENDERER-RENDER 5514 5515 FLAGS 5516 render flags 5517 5518 RET 5519 ''#t'' if the event was consumed/handled 5520 5521 -- Function: gtk-cell-renderer-start-editing 5522 (self '<gtk-cell-renderer>') (event '<gdk-event>') 5523 (widget '<gtk-widget>') (path 'mchars') 5524 (background_area '<gdk-rectangle>') 5525 (cell_area '<gdk-rectangle>') 5526 (flags '<gtk-cell-renderer-state>') => 5527 (ret '<gtk-cell-editable>') 5528 -- Method: start-editing 5529 Passes an activate event to the cell renderer for possible 5530 processing. 5531 5532 CELL 5533 a '<gtk-cell-renderer>' 5534 5535 EVENT 5536 a '<gdk-event>' 5537 5538 WIDGET 5539 widget that received the event 5540 5541 PATH 5542 widget-dependent string representation of the event location; 5543 e.g. for '<gtk-tree-view>', a string representation of 5544 '<gtk-tree-path>' 5545 5546 BACKGROUND-AREA 5547 background area as passed to GTK-CELL-RENDERER-RENDER 5548 5549 CELL-AREA 5550 cell area as passed to GTK-CELL-RENDERER-RENDER 5551 5552 FLAGS 5553 render flags 5554 5555 RET 5556 A new '<gtk-cell-editable>', or ''#f'' 5557 5558 -- Function: gtk-cell-renderer-editing-canceled 5559 (self '<gtk-cell-renderer>') 5560 -- Method: editing-canceled 5561 'gtk_cell_renderer_editing_canceled' has been deprecated since 5562 version 2.6 and should not be used in newly-written code. Use 5563 'gtk-cell-renderer-stop-editing' instead 5564 5565 Causes the cell renderer to emit the "editing-canceled" signal. 5566 This function is for use only by implementations of cell renderers 5567 that need to notify the client program that an editing process was 5568 canceled and the changes were not committed. 5569 5570 CELL 5571 A '<gtk-cell-renderer>' 5572 5573 Since 2.4 5574 5575 -- Function: gtk-cell-renderer-stop-editing 5576 (self '<gtk-cell-renderer>') (canceled 'bool') 5577 -- Method: stop-editing 5578 Informs the cell renderer that the editing is stopped. If CANCELED 5579 is ''#t'', the cell renderer will emit the "editing-canceled" 5580 signal. This function should be called by cell renderer 5581 implementations in response to the "editing-done" signal of 5582 '<gtk-cell-editable>'. 5583 5584 CELL 5585 A '<gtk-cell-renderer>' 5586 5587 CANCELED 5588 ''#t'' if the editing has been canceled 5589 5590 Since 2.6 5591 5592 -- Function: gtk-cell-renderer-get-fixed-size 5593 (self '<gtk-cell-renderer>') => (width 'int') (height 'int') 5594 -- Method: get-fixed-size 5595 Fills in WIDTH and HEIGHT with the appropriate size of CELL. 5596 5597 CELL 5598 A '<gtk-cell-renderer>' 5599 5600 WIDTH 5601 location to fill in with the fixed width of the widget, or 5602 ''#f'' 5603 5604 HEIGHT 5605 location to fill in with the fixed height of the widget, or 5606 ''#f'' 5607 5608 -- Function: gtk-cell-renderer-set-fixed-size 5609 (self '<gtk-cell-renderer>') (width 'int') (height 'int') 5610 -- Method: set-fixed-size 5611 Sets the renderer size to be explicit, independent of the 5612 properties set. 5613 5614 CELL 5615 A '<gtk-cell-renderer>' 5616 5617 WIDTH 5618 the width of the cell renderer, or -1 5619 5620 HEIGHT 5621 the height of the cell renderer, or -1 5622 5623 5624File: guile-gnome-gtk.info, Node: GtkCellEditable, Next: GtkCellRendererAccel, Prev: GtkCellRenderer, Up: Top 5625 562644 GtkCellEditable 5627****************** 5628 5629Interface for widgets which can are used for editing cells 5630 563144.1 Overview 5632============= 5633 5634The '<gtk-cell-editable>' interface must be implemented for widgets to 5635be usable when editing the contents of a '<gtk-tree-view>' cell. 5636 563744.2 Usage 5638========== 5639 5640 -- Class: <gtk-cell-editable> 5641 Derives from '<ginterface>'. 5642 5643 This class defines no direct slots. 5644 5645 -- Signal on <gtk-cell-editable>: editing-done 5646 5647 -- Signal on <gtk-cell-editable>: remove-widget 5648 5649 -- Function: gtk-cell-editable-start-editing 5650 (self '<gtk-cell-editable>') (event '<gdk-event>') 5651 -- Method: start-editing 5652 Begins editing on a CELL-EDITABLE. EVENT is the '<gdk-event>' that 5653 began the editing process. It may be ''#f'', in the instance that 5654 editing was initiated through programatic means. 5655 5656 CELL-EDITABLE 5657 A '<gtk-cell-editable>' 5658 5659 EVENT 5660 A '<gdk-event>', or ''#f'' 5661 5662 -- Function: gtk-cell-editable-editing-done 5663 (self '<gtk-cell-editable>') 5664 -- Method: editing-done 5665 Emits the "editing_done" signal. This signal is a sign for the 5666 cell renderer to update its value from the cell. 5667 5668 CELL-EDITABLE 5669 A '<gtk-tree-editable>' 5670 5671 -- Function: gtk-cell-editable-remove-widget 5672 (self '<gtk-cell-editable>') 5673 -- Method: remove-widget 5674 Emits the "remove_widget" signal. This signal is meant to indicate 5675 that the cell is finished editing, and the widget may now be 5676 destroyed. 5677 5678 CELL-EDITABLE 5679 A '<gtk-tree-editable>' 5680 5681 5682File: guile-gnome-gtk.info, Node: GtkCellRendererAccel, Next: GtkCellRendererCombo, Prev: GtkCellEditable, Up: Top 5683 568445 GtkCellRendererAccel 5685*********************** 5686 5687Renders a keyboard accelerator in a cell 5688 568945.1 Overview 5690============= 5691 5692'<gtk-cell-renderer-accel>' displays a keyboard accelerator (i.e. a key 5693combination like <Control>-a). If the cell renderer is editable, the 5694accelerator can be changed by simply typing the new combination. 5695 5696 The '<gtk-cell-renderer-accel>' cell renderer was added in GTK+ 2.10. 5697 569845.2 Usage 5699========== 5700 5701 -- Class: <gtk-cell-renderer-accel> 5702 Derives from '<gtk-cell-renderer-text>'. 5703 5704 This class defines the following slots: 5705 5706 'accel-key' 5707 The keyval of the accelerator 5708 5709 'accel-mods' 5710 The modifier mask of the accelerator 5711 5712 'keycode' 5713 The hardware keycode of the accelerator 5714 5715 'accel-mode' 5716 The type of accelerators 5717 5718 -- Signal on <gtk-cell-renderer-accel>: accel-edited 5719 (arg0 '<gchararray>') (arg1 '<guint>') 5720 (arg2 '<gdk-modifier-type>') (arg3 '<guint>') 5721 Gets emitted when the user has selected a new accelerator. 5722 5723 Since 2.10 5724 5725 -- Signal on <gtk-cell-renderer-accel>: accel-cleared 5726 (arg0 '<gchararray>') 5727 Gets emitted when the user has removed the accelerator. 5728 5729 Since 2.10 5730 5731 -- Function: gtk-cell-renderer-accel-new => 5732 (ret '<gtk-cell-renderer>') 5733 Creates a new '<gtk-cell-renderer-accel>'. 5734 5735 RET 5736 the new cell renderer 5737 5738 Since 2.10 5739 5740 5741File: guile-gnome-gtk.info, Node: GtkCellRendererCombo, Next: GtkCellRendererPixbuf, Prev: GtkCellRendererAccel, Up: Top 5742 574346 GtkCellRendererCombo 5744*********************** 5745 5746Renders a combobox in a cell 5747 574846.1 Overview 5749============= 5750 5751'<gtk-cell-renderer-combo>' renders text in a cell like 5752'<gtk-cell-renderer-text>' from which it is derived. But while 5753'<gtk-cell-renderer-text>' offers a simple entry to edit the text, 5754'<gtk-cell-renderer-combo>' offers a '<gtk-combo-box>' or 5755'<gtk-combo-box-entry>' widget to edit the text. The values to display 5756in the combo box are taken from the tree model specified in the model 5757property. 5758 5759 The combo cell renderer takes care of adding a text cell renderer to 5760the combo box and sets it to display the column specified by its 5761text-column property. Further properties of the comnbo box can be set 5762in a handler for the editing-started signal. 5763 5764 The '<gtk-cell-renderer-combo>' cell renderer was added in GTK+ 2.6. 5765 576646.2 Usage 5767========== 5768 5769 -- Class: <gtk-cell-renderer-combo> 5770 Derives from '<gtk-cell-renderer-text>'. 5771 5772 This class defines the following slots: 5773 5774 'model' 5775 The model containing the possible values for the combo box 5776 5777 'text-column' 5778 A column in the data source model to get the strings from 5779 5780 'has-entry' 5781 If FALSE, don't allow to enter strings other than the chosen 5782 ones 5783 5784 -- Function: gtk-cell-renderer-combo-new => 5785 (ret '<gtk-cell-renderer>') 5786 Creates a new '<gtk-cell-renderer-combo>'. Adjust how text is 5787 drawn using object properties. Object properties can be set 5788 globally (with 'g-object-set'). Also, with 5789 '<gtk-tree-view-column>', you can bind a property to a value in a 5790 '<gtk-tree-model>'. For example, you can bind the "text" property 5791 on the cell renderer to a string value in the model, thus rendering 5792 a different string in each row of the '<gtk-tree-view>'. 5793 5794 RET 5795 the new cell renderer 5796 5797 Since 2.6 5798 5799 5800File: guile-gnome-gtk.info, Node: GtkCellRendererPixbuf, Next: GtkCellRendererProgress, Prev: GtkCellRendererCombo, Up: Top 5801 580247 GtkCellRendererPixbuf 5803************************ 5804 5805Renders a pixbuf in a cell 5806 580747.1 Overview 5808============= 5809 5810A '<gtk-cell-renderer-pixbuf>' can be used to render an image in a cell. 5811It allows to render either a given '<gdk-pixbuf>' (set via the pixbuf 5812property) or a stock icon (set via the stock-id property). 5813 5814 To support the tree view, '<gtk-cell-renderer-pixbuf>' also supports 5815rendering two alternative pixbufs, when the is-expander property is 5816''#t''. If the is-expanded property is ''#t'' and the 5817pixbuf-expander-open property is set to a pixbuf, it renders that 5818pixbuf, if the is-expanded property is ''#f'' and the 5819pixbuf-expander-closed property is set to a pixbuf, it renders that one. 5820 582147.2 Usage 5822========== 5823 5824 -- Class: <gtk-cell-renderer-pixbuf> 5825 Derives from '<gtk-cell-renderer>'. 5826 5827 This class defines the following slots: 5828 5829 'pixbuf' 5830 The pixbuf to render 5831 5832 'pixbuf-expander-open' 5833 Pixbuf for open expander 5834 5835 'pixbuf-expander-closed' 5836 Pixbuf for closed expander 5837 5838 'stock-id' 5839 The stock ID of the stock icon to render 5840 5841 'stock-size' 5842 The GtkIconSize value that specifies the size of the rendered 5843 icon 5844 5845 'stock-detail' 5846 Render detail to pass to the theme engine 5847 5848 'follow-state' 5849 Whether the rendered pixbuf should be colorized according to 5850 the state 5851 5852 'icon-name' 5853 The name of the icon from the icon theme 5854 5855 -- Function: gtk-cell-renderer-pixbuf-new => 5856 (ret '<gtk-cell-renderer>') 5857 Creates a new '<gtk-cell-renderer-pixbuf>'. Adjust rendering 5858 parameters using object properties. Object properties can be set 5859 globally (with 'g-object-set'). Also, with 5860 '<gtk-tree-view-column>', you can bind a property to a value in a 5861 '<gtk-tree-model>'. For example, you can bind the "pixbuf" 5862 property on the cell renderer to a pixbuf value in the model, thus 5863 rendering a different image in each row of the '<gtk-tree-view>'. 5864 5865 RET 5866 the new cell renderer 5867 5868 5869File: guile-gnome-gtk.info, Node: GtkCellRendererProgress, Next: GtkCellRendererSpin, Prev: GtkCellRendererPixbuf, Up: Top 5870 587148 GtkCellRendererProgress 5872************************** 5873 5874Renders numbers as progress bars 5875 587648.1 Overview 5877============= 5878 5879'<gtk-cell-renderer-progress>' renders a numeric value as a progress par 5880in a cell. Additionally, it can display a text on top of the progress 5881bar. 5882 5883 The '<gtk-cell-renderer-progress>' cell renderer was added in GTK+ 58842.6. 5885 588648.2 Usage 5887========== 5888 5889 -- Class: <gtk-cell-renderer-progress> 5890 Derives from '<gtk-cell-renderer>'. 5891 5892 This class defines the following slots: 5893 5894 'value' 5895 Value of the progress bar 5896 5897 'text' 5898 Text on the progress bar 5899 5900 'pulse' 5901 Set this to positive values to indicate that some progress is 5902 made, but you don't know how much. 5903 5904 'text-xalign' 5905 The horizontal text alignment, from 0 (left) to 1 (right). 5906 Reversed for RTL layouts. 5907 5908 'text-yalign' 5909 The vertical text alignment, from 0 (top) to 1 (bottom). 5910 5911 'orientation' 5912 Orientation and growth direction of the progress bar 5913 5914 -- Function: gtk-cell-renderer-progress-new => 5915 (ret '<gtk-cell-renderer>') 5916 Creates a new '<gtk-cell-renderer-progress>'. 5917 5918 RET 5919 the new cell renderer 5920 5921 Since 2.6 5922 5923 5924File: guile-gnome-gtk.info, Node: GtkCellRendererSpin, Next: GtkCellRendererText, Prev: GtkCellRendererProgress, Up: Top 5925 592649 GtkCellRendererSpin 5927********************** 5928 5929Renders a spin button in a cell 5930 593149.1 Overview 5932============= 5933 5934'<gtk-cell-renderer-spin>' renders text in a cell like 5935'<gtk-cell-renderer-text>' from which it is derived. But while 5936'<gtk-cell-renderer-text>' offers a simple entry to edit the text, 5937'<gtk-cell-renderer-spin>' offers a '<gtk-spin-button>' widget. Of 5938course, that means that the text has to be parseable as a floating point 5939number. 5940 5941 The range of the spinbutton is taken from the adjustment property of 5942the cell renderer, which can be set explicitly or mapped to a column in 5943the tree model, like all properties of cell renders. 5944'<gtk-cell-renderer-spin>' also has properties for the climb rate and 5945the number of digits to display. Other '<gtk-spin-button>' properties 5946can be set in a handler for the start-editing signal. 5947 5948 The '<gtk-cell-renderer-spin>' cell renderer was added in GTK+ 2.10. 5949 595049.2 Usage 5951========== 5952 5953 -- Class: <gtk-cell-renderer-spin> 5954 Derives from '<gtk-cell-renderer-text>'. 5955 5956 This class defines the following slots: 5957 5958 'adjustment' 5959 The adjustment that holds the value of the spinbutton. 5960 5961 'climb-rate' 5962 The acceleration rate when you hold down a button 5963 5964 'digits' 5965 The number of decimal places to display 5966 5967 -- Function: gtk-cell-renderer-spin-new => (ret '<gtk-cell-renderer>') 5968 Creates a new '<gtk-cell-renderer-spin>'. 5969 5970 RET 5971 a new '<gtk-cell-renderer-spin>' 5972 5973 Since 2.10 5974 5975 5976File: guile-gnome-gtk.info, Node: GtkCellRendererText, Next: GtkCellRendererToggle, Prev: GtkCellRendererSpin, Up: Top 5977 597850 GtkCellRendererText 5979********************** 5980 5981Renders text in a cell 5982 598350.1 Overview 5984============= 5985 5986A '<gtk-cell-renderer-text>' renders a given text in its cell, using the 5987font, color and style information provided by its properties. The text 5988will be ellipsized if it is too long and the ellipsize property allows 5989it. 5990 5991 If the mode is 'GTK_CELL_RENDERER_MODE_EDITABLE', the 5992'<gtk-cell-renderer-text>' allows to edit its text using an entry. 5993 599450.2 Usage 5995========== 5996 5997 -- Class: <gtk-cell-renderer-text> 5998 Derives from '<gtk-cell-renderer>'. 5999 6000 This class defines the following slots: 6001 6002 'text' 6003 Text to render 6004 6005 'markup' 6006 Marked up text to render 6007 6008 'attributes' 6009 A list of style attributes to apply to the text of the 6010 renderer 6011 6012 'single-paragraph-mode' 6013 Whether or not to keep all text in a single paragraph 6014 6015 'width-chars' 6016 The desired width of the label, in characters 6017 6018 'wrap-width' 6019 The width at which the text is wrapped 6020 6021 'alignment' 6022 How to align the lines 6023 6024 'background' 6025 Background color as a string 6026 6027 'foreground' 6028 Foreground color as a string 6029 6030 'background-gdk' 6031 Background color as a GdkColor 6032 6033 'foreground-gdk' 6034 Foreground color as a GdkColor 6035 6036 'font' 6037 Font description as a string, e.g. "Sans Italic 12" 6038 6039 'font-desc' 6040 Font description as a PangoFontDescription struct 6041 6042 'family' 6043 Name of the font family, e.g. Sans, Helvetica, Times, 6044 Monospace 6045 6046 'style' 6047 Font style 6048 6049 'variant' 6050 Font variant 6051 6052 'weight' 6053 Font weight 6054 6055 'stretch' 6056 Font stretch 6057 6058 'size' 6059 Font size 6060 6061 'size-points' 6062 Font size in points 6063 6064 'scale' 6065 Font scaling factor 6066 6067 'editable' 6068 Whether the text can be modified by the user 6069 6070 'strikethrough' 6071 Whether to strike through the text 6072 6073 'underline' 6074 Style of underline for this text 6075 6076 'rise' 6077 Offset of text above the baseline (below the baseline if rise 6078 is negative) 6079 6080 'language' 6081 The language this text is in, as an ISO code. Pango can use 6082 this as a hint when rendering the text. If you don't 6083 understand this parameter, you probably don't need it 6084 6085 'ellipsize' 6086 The preferred place to ellipsize the string, if the cell 6087 renderer does not have enough room to display the entire 6088 string 6089 6090 'wrap-mode' 6091 How to break the string into multiple lines, if the cell 6092 renderer does not have enough room to display the entire 6093 string 6094 6095 'background-set' 6096 Whether this tag affects the background color 6097 6098 'foreground-set' 6099 Whether this tag affects the foreground color 6100 6101 'family-set' 6102 Whether this tag affects the font family 6103 6104 'style-set' 6105 Whether this tag affects the font style 6106 6107 'variant-set' 6108 Whether this tag affects the font variant 6109 6110 'weight-set' 6111 Whether this tag affects the font weight 6112 6113 'stretch-set' 6114 Whether this tag affects the font stretch 6115 6116 'size-set' 6117 Whether this tag affects the font size 6118 6119 'scale-set' 6120 Whether this tag scales the font size by a factor 6121 6122 'editable-set' 6123 Whether this tag affects text editability 6124 6125 'strikethrough-set' 6126 Whether this tag affects strikethrough 6127 6128 'underline-set' 6129 Whether this tag affects underlining 6130 6131 'rise-set' 6132 Whether this tag affects the rise 6133 6134 'language-set' 6135 Whether this tag affects the language the text is rendered as 6136 6137 'ellipsize-set' 6138 Whether this tag affects the ellipsize mode 6139 6140 'align-set' 6141 Whether this tag affects the alignment mode 6142 6143 -- Signal on <gtk-cell-renderer-text>: edited (arg0 '<gchararray>') 6144 (arg1 '<gchararray>') 6145 This signal is emitted after RENDERER has been edited. 6146 6147 -- Function: gtk-cell-renderer-text-new => (ret '<gtk-cell-renderer>') 6148 Creates a new '<gtk-cell-renderer-text>'. Adjust how text is drawn 6149 using object properties. Object properties can be set globally 6150 (with 'g-object-set'). Also, with '<gtk-tree-view-column>', you 6151 can bind a property to a value in a '<gtk-tree-model>'. For 6152 example, you can bind the "text" property on the cell renderer to a 6153 string value in the model, thus rendering a different string in 6154 each row of the '<gtk-tree-view>' 6155 6156 RET 6157 the new cell renderer 6158 6159 6160File: guile-gnome-gtk.info, Node: GtkCellRendererToggle, Next: GtkListStore, Prev: GtkCellRendererText, Up: Top 6161 616251 GtkCellRendererToggle 6163************************ 6164 6165Renders a toggle button in a cell 6166 616751.1 Overview 6168============= 6169 6170'<gtk-cell-renderer-toggle>' renders a toggle button in a cell. The 6171button is drawn as a radio- or checkbutton, depending on the radio 6172property. When activated, it emits the toggled signal. 6173 617451.2 Usage 6175========== 6176 6177 -- Class: <gtk-cell-renderer-toggle> 6178 Derives from '<gtk-cell-renderer>'. 6179 6180 This class defines the following slots: 6181 6182 'activatable' 6183 The toggle button can be activated 6184 6185 'active' 6186 The toggle state of the button 6187 6188 'radio' 6189 Draw the toggle button as a radio button 6190 6191 'inconsistent' 6192 The inconsistent state of the button 6193 6194 'indicator-size' 6195 Size of check or radio indicator 6196 6197 -- Signal on <gtk-cell-renderer-toggle>: toggled (arg0 '<gchararray>') 6198 The ::toggled signal is emitted when the cell is toggled. 6199 6200 -- Function: gtk-cell-renderer-toggle-new => 6201 (ret '<gtk-cell-renderer>') 6202 Creates a new '<gtk-cell-renderer-toggle>'. Adjust rendering 6203 parameters using object properties. Object properties can be set 6204 globally (with 'g-object-set'). Also, with 6205 '<gtk-tree-view-column>', you can bind a property to a value in a 6206 '<gtk-tree-model>'. For example, you can bind the "active" 6207 property on the cell renderer to a boolean value in the model, thus 6208 causing the check button to reflect the state of the model. 6209 6210 RET 6211 the new cell renderer 6212 6213 -- Function: gtk-cell-renderer-toggle-get-radio 6214 (self '<gtk-cell-renderer-toggle>') => (ret 'bool') 6215 -- Method: get-radio 6216 Returns whether we're rendering radio toggles rather than 6217 checkboxes. 6218 6219 TOGGLE 6220 a '<gtk-cell-renderer-toggle>' 6221 6222 RET 6223 ''#t'' if we're rendering radio toggles rather than checkboxes 6224 6225 -- Function: gtk-cell-renderer-toggle-set-radio 6226 (self '<gtk-cell-renderer-toggle>') (radio 'bool') 6227 -- Method: set-radio 6228 If RADIO is ''#t'', the cell renderer renders a radio toggle (i.e. 6229 a toggle in a group of mutually-exclusive toggles). If ''#f'', it 6230 renders a check toggle (a standalone boolean option). This can be 6231 set globally for the cell renderer, or changed just before 6232 rendering each cell in the model (for '<gtk-tree-view>', you set up 6233 a per-row setting using '<gtk-tree-view-column>' to associate model 6234 columns with cell renderer properties). 6235 6236 TOGGLE 6237 a '<gtk-cell-renderer-toggle>' 6238 6239 RADIO 6240 ''#t'' to make the toggle look like a radio button 6241 6242 -- Function: gtk-cell-renderer-toggle-get-active 6243 (self '<gtk-cell-renderer-toggle>') => (ret 'bool') 6244 -- Method: get-active 6245 Returns whether the cell renderer is active. See 6246 'gtk-cell-renderer-toggle-set-active'. 6247 6248 TOGGLE 6249 a '<gtk-cell-renderer-toggle>' 6250 6251 RET 6252 ''#t'' if the cell renderer is active. 6253 6254 -- Function: gtk-cell-renderer-toggle-set-active 6255 (self '<gtk-cell-renderer-toggle>') (setting 'bool') 6256 -- Method: set-active 6257 Activates or deactivates a cell renderer. 6258 6259 TOGGLE 6260 a '<gtk-cell-renderer-toggle>'. 6261 6262 SETTING 6263 the value to set. 6264 6265 6266File: guile-gnome-gtk.info, Node: GtkListStore, Next: GtkTreeStore, Prev: GtkCellRendererToggle, Up: Top 6267 626852 GtkListStore 6269*************** 6270 6271A list-like data structure that can be used with the 6272 627352.1 Overview 6274============= 6275 6276The '<gtk-list-store>' object is a list model for use with a 6277'<gtk-tree-view>' widget. It implements the '<gtk-tree-model>' 6278interface, and consequentialy, can use all of the methods available 6279there. It also implements the '<gtk-tree-sortable>' interface so it can 6280be sorted by the view. Finally, it also implements the tree drag and 6281drop interfaces. 6282 6283 The '<gtk-list-store>' can accept most GObject types as a column 6284type, though it can't accept all custom types. Internally, it will keep 6285a copy of data passed in (such as a string or a boxed pointer). Columns 6286that accept '<gobject>'s are handled a little differently. The 6287'<gtk-list-store>' will keep a reference to the object instead of 6288copying the value. As a result, if the object is modified, it is up to 6289the application writer to call GTK-TREE-MODEL-ROW-CHANGED to emit the 6290"row_changed" signal. This most commonly affects lists with 6291'<gdk-pixbuf>'s stored. 6292 6293 6294 enum { 6295 COLUMN_STRING, 6296 COLUMN_INT, 6297 COLUMN_BOOLEAN, 6298 N_COLUMNS 6299 }; 6300 6301 { 6302 GtkListStore *list_store; 6303 GtkTreePath *path; 6304 GtkTreeIter iter; 6305 gint i; 6306 6307 list_store = gtk_list_store_new (N_COLUMNS, 6308 G_TYPE_STRING, 6309 G_TYPE_INT, 6310 G_TYPE_BOOLEAN); 6311 6312 for (i = 0; i < 10; i++) 6313 { 6314 gchar *some_data; 6315 6316 some_data = get_some_data (i); 6317 6318 /* Add a new row to the model */ 6319 gtk_list_store_append (list_store, &iter); 6320 gtk_list_store_set (list_store, &iter, 6321 COLUMN_STRING, some_data, 6322 COLUMN_INT, i, 6323 COLUMN_BOOLEAN, FALSE, 6324 -1); 6325 6326 /* As the store will keep a copy of the string internally, we 6327 * free some_data. 6328 */ 6329 g_free (some_data); 6330 } 6331 6332 /* Modify a particular row */ 6333 path = gtk_tree_path_new_from_string ("4"); 6334 gtk_tree_model_get_iter (GTK_TREE_MODEL (list_store), 6335 &iter, 6336 path); 6337 gtk_tree_path_free (path); 6338 gtk_list_store_set (list_store, &iter, 6339 COLUMN_BOOLEAN, TRUE, 6340 -1); 6341 } 6342 634352.2 Performance Considerations 6344=============================== 6345 6346Internally, the '<gtk-list-store>' was implemented with a linked list 6347with a tail pointer prior to GTK+ 2.6. As a result, it was fast at data 6348insertion and deletion, and not fast at random data access. The 6349'<gtk-list-store>' sets the '<gtk-tree-model-iters-persist>' flag, which 6350means that '<gtk-tree-iter>'s can be cached while the row exists. Thus, 6351if access to a particular row is needed often and your code is expected 6352to run on older versions of GTK+, it is worth keeping the iter around. 6353 6354 It is important to note that only the methods 6355GTK-LIST-STORE-INSERT-WITH-VALUES and GTK-LIST-STORE-INSERT-WITH-VALUESV 6356are atomic, in the sense that the row is being appended to the store and 6357the values filled in in a single operation with regard to 6358'<gtk-tree-model>' signaling. In contrast, using e.g. 6359GTK-LIST-STORE-APPEND and then GTK-LIST-STORE-SET will first create a 6360row, which triggers the "row_inserted" '<gtk-tree-model>' signal on 6361'<gtk-list-store>'. The row, however, is still empty, and any signal 6362handler connecting to "row_inserted" on this particular store should be 6363prepared for the situation that the row might be empty. This is 6364especially important if you are wrapping the '<gtk-list-store>' inside a 6365'<gtk-tree-model-filter>' and are using a 6366'<gtk-tree-model-filter-visible-func>'. Using any of the non-atomic 6367operations to append rows to the '<gtk-list-store>' will cause the 6368'<gtk-tree-model-filter-visible-func>' to be visited with an empty row 6369first; the function must be prepared for that. 6370 637152.3 Usage 6372========== 6373 6374 -- Class: <gtk-list-store> 6375 Derives from '<gtk-tree-model>', '<gtk-tree-sortable>', 6376 '<gtk-buildable>', '<gtk-tree-drag-dest>', 6377 '<gtk-tree-drag-source>', '<gobject>'. 6378 6379 This class defines no direct slots. 6380 6381 -- Function: gtk-list-store-new (types 'scm') => 6382 (ret '<gtk-list-store>') 6383 Creates a new list store as with N-COLUMNS columns each of the 6384 types passed in. Note that only types derived from standard 6385 GObject fundamental types are supported. 6386 6387 As an example, 'gtk_tree_store_new (3, G_TYPE_INT, G_TYPE_STRING, 6388 GDK_TYPE_PIXBUF);' will create a new '<gtk-list-store>' with three 6389 columns, of type int, string and '<gdk-pixbuf>' respectively. 6390 6391 N-COLUMNS 6392 number of columns in the list store 6393 6394 ... 6395 all '<g-type>' types for the columns, from first to last 6396 6397 RET 6398 a new '<gtk-list-store>' 6399 6400 -- Function: gtk-list-store-set-value (self '<gtk-list-store>') 6401 (iter '<gtk-tree-iter>') (column 'int') (value 'scm') 6402 -- Method: set-value 6403 Sets the data in the cell specified by ITER and COLUMN. The type 6404 of VALUE must be convertible to the type of the column. 6405 6406 LIST-STORE 6407 A '<gtk-list-store>' 6408 6409 ITER 6410 A valid '<gtk-tree-iter>' for the row being modified 6411 6412 COLUMN 6413 column number to modify 6414 6415 VALUE 6416 new value for the cell 6417 6418 -- Function: gtk-list-store-remove (self '<gtk-list-store>') 6419 (iter '<gtk-tree-iter>') => (ret '<gtk-tree-iter>') 6420 -- Method: remove 6421 Removes the given row from the list store. After being removed, 6422 ITER is set to be the next valid row, or invalidated if it pointed 6423 to the last row in LIST-STORE. 6424 6425 LIST-STORE 6426 A '<gtk-list-store>' 6427 6428 ITER 6429 A valid '<gtk-tree-iter>' 6430 6431 RET 6432 ''#t'' if ITER is valid, ''#f'' if not. 6433 6434 -- Function: gtk-list-store-insert (self '<gtk-list-store>') 6435 (position 'int') => (ret '<gtk-tree-iter>') 6436 -- Method: insert 6437 Creates a new row at POSITION. ITER will be changed to point to 6438 this new row. If POSITION is larger than the number of rows on the 6439 list, then the new row will be appended to the list. The row will 6440 be empty after this function is called. To fill in values, you 6441 need to call 'gtk-list-store-set' or 'gtk-list-store-set-value'. 6442 6443 LIST-STORE 6444 A '<gtk-list-store>' 6445 6446 ITER 6447 An unset '<gtk-tree-iter>' to set to the new row 6448 6449 POSITION 6450 position to insert the new row 6451 6452 -- Function: gtk-list-store-insert-before (self '<gtk-list-store>') 6453 (sibling '<gtk-tree-iter>') => (ret '<gtk-tree-iter>') 6454 -- Method: insert-before 6455 Inserts a new row before SIBLING. If SIBLING is ''#f'', then the 6456 row will be appended to the end of the list. ITER will be changed 6457 to point to this new row. The row will be empty after this 6458 function is called. To fill in values, you need to call 6459 'gtk-list-store-set' or 'gtk-list-store-set-value'. 6460 6461 LIST-STORE 6462 A '<gtk-list-store>' 6463 6464 ITER 6465 An unset '<gtk-tree-iter>' to set to the new row 6466 6467 SIBLING 6468 A valid '<gtk-tree-iter>', or ''#f'' 6469 6470 -- Function: gtk-list-store-insert-after (self '<gtk-list-store>') 6471 (sibling '<gtk-tree-iter>') => (ret '<gtk-tree-iter>') 6472 -- Method: insert-after 6473 Inserts a new row after SIBLING. If SIBLING is ''#f'', then the 6474 row will be prepended to the beginning of the list. ITER will be 6475 changed to point to this new row. The row will be empty after this 6476 function is called. To fill in values, you need to call 6477 'gtk-list-store-set' or 'gtk-list-store-set-value'. 6478 6479 LIST-STORE 6480 A '<gtk-list-store>' 6481 6482 ITER 6483 An unset '<gtk-tree-iter>' to set to the new row 6484 6485 SIBLING 6486 A valid '<gtk-tree-iter>', or ''#f'' 6487 6488 -- Function: gtk-list-store-prepend (self '<gtk-list-store>') => 6489 (ret '<gtk-tree-iter>') 6490 -- Method: prepend 6491 Prepends a new row to LIST-STORE. ITER will be changed to point to 6492 this new row. The row will be empty after this function is called. 6493 To fill in values, you need to call 'gtk-list-store-set' or 6494 'gtk-list-store-set-value'. 6495 6496 LIST-STORE 6497 A '<gtk-list-store>' 6498 6499 ITER 6500 An unset '<gtk-tree-iter>' to set to the prepend row 6501 6502 -- Function: gtk-list-store-append (self '<gtk-list-store>') => 6503 (ret '<gtk-tree-iter>') 6504 -- Method: append 6505 Appends a new row to LIST-STORE. ITER will be changed to point to 6506 this new row. The row will be empty after this function is called. 6507 To fill in values, you need to call 'gtk-list-store-set' or 6508 'gtk-list-store-set-value'. 6509 6510 LIST-STORE 6511 A '<gtk-list-store>' 6512 6513 ITER 6514 An unset '<gtk-tree-iter>' to set to the appended row 6515 6516 -- Function: gtk-list-store-clear (self '<gtk-list-store>') 6517 -- Method: clear 6518 Removes all rows from the list store. 6519 6520 LIST-STORE 6521 a '<gtk-list-store>'. 6522 6523 -- Function: gtk-list-store-iter-is-valid (self '<gtk-list-store>') 6524 (iter '<gtk-tree-iter>') => (ret 'bool') 6525 -- Method: iter-is-valid 6526 purposes.") 6527 6528 Checks if the given iter is a valid iter for this 6529 '<gtk-list-store>'. 6530 6531 LIST-STORE 6532 A '<gtk-list-store>'. 6533 6534 ITER 6535 A '<gtk-tree-iter>'. 6536 6537 RET 6538 ''#t'' if the iter is valid, ''#f'' if the iter is invalid. 6539 6540 Since 2.2 6541 6542 -- Function: gtk-list-store-reorder (self '<gtk-list-store>') => 6543 (new_order 'int') 6544 -- Method: reorder 6545 Reorders STORE to follow the order indicated by NEW-ORDER. Note 6546 that this function only works with unsorted stores. 6547 6548 STORE 6549 A '<gtk-list-store>'. 6550 6551 NEW-ORDER 6552 an array of integers mapping the new position of each child to 6553 its old position before the re-ordering, i.e. 6554 NEW-ORDER'[newpos] = oldpos'. 6555 6556 Since 2.2 6557 6558 -- Function: gtk-list-store-swap (self '<gtk-list-store>') 6559 (a '<gtk-tree-iter>') (b '<gtk-tree-iter>') 6560 -- Method: swap 6561 Swaps A and B in STORE. Note that this function only works with 6562 unsorted stores. 6563 6564 STORE 6565 A '<gtk-list-store>'. 6566 6567 A 6568 A '<gtk-tree-iter>'. 6569 6570 B 6571 Another '<gtk-tree-iter>'. 6572 6573 Since 2.2 6574 6575 -- Function: gtk-list-store-move-before (self '<gtk-list-store>') 6576 (iter '<gtk-tree-iter>') (position '<gtk-tree-iter>') 6577 -- Method: move-before 6578 Moves ITER in STORE to the position before POSITION. Note that 6579 this function only works with unsorted stores. If POSITION is 6580 ''#f'', ITER will be moved to the end of the list. 6581 6582 STORE 6583 A '<gtk-list-store>'. 6584 6585 ITER 6586 A '<gtk-tree-iter>'. 6587 6588 POSITION 6589 A '<gtk-tree-iter>', or ''#f''. 6590 6591 Since 2.2 6592 6593 -- Function: gtk-list-store-move-after (self '<gtk-list-store>') 6594 (iter '<gtk-tree-iter>') (position '<gtk-tree-iter>') 6595 -- Method: move-after 6596 Moves ITER in STORE to the position after POSITION. Note that this 6597 function only works with unsorted stores. If POSITION is ''#f'', 6598 ITER will be moved to the start of the list. 6599 6600 STORE 6601 A '<gtk-list-store>'. 6602 6603 ITER 6604 A '<gtk-tree-iter>'. 6605 6606 POSITION 6607 A '<gtk-tree-iter>' or ''#f''. 6608 6609 Since 2.2 6610 6611 6612File: guile-gnome-gtk.info, Node: GtkTreeStore, Next: GtkComboBox, Prev: GtkListStore, Up: Top 6613 661453 GtkTreeStore 6615*************** 6616 6617A tree-like data structure that can be used with the 6618 661953.1 Overview 6620============= 6621 6622The '<gtk-tree-store>' object is a list model for use with a 6623'<gtk-tree-view>' widget. It implements the '<gtk-tree-model>' 6624interface, and consequentialy, can use all of the methods available 6625there. It also implements the '<gtk-tree-sortable>' interface so it can 6626be sorted by the view. Finally, it also implements the tree drag and 6627drop interfaces. 6628 662953.2 Usage 6630========== 6631 6632 -- Class: <gtk-tree-store> 6633 Derives from '<gtk-tree-model>', '<gtk-tree-sortable>', 6634 '<gtk-buildable>', '<gtk-tree-drag-dest>', 6635 '<gtk-tree-drag-source>', '<gobject>'. 6636 6637 This class defines no direct slots. 6638 6639 -- Function: gtk-tree-store-new (types 'scm') => 6640 (ret '<gtk-tree-store>') 6641 Creates a new tree store as with N-COLUMNS columns each of the 6642 types passed in. Note that only types derived from standard 6643 GObject fundamental types are supported. 6644 6645 As an example, 'gtk_tree_store_new (3, G_TYPE_INT, G_TYPE_STRING, 6646 GDK_TYPE_PIXBUF);' will create a new '<gtk-tree-store>' with three 6647 columns, of type '<int>', '<string>' and '<gdk-pixbuf>' 6648 respectively. 6649 6650 N-COLUMNS 6651 number of columns in the tree store 6652 6653 ... 6654 all '<g-type>' types for the columns, from first to last 6655 6656 RET 6657 a new '<gtk-tree-store>' 6658 6659 -- Function: gtk-tree-store-set-value (self '<gtk-tree-store>') 6660 (iter '<gtk-tree-iter>') (column 'int') (value 'scm') 6661 -- Method: set-value 6662 Sets the data in the cell specified by ITER and COLUMN. The type 6663 of VALUE must be convertible to the type of the column. 6664 6665 TREE-STORE 6666 a '<gtk-tree-store>' 6667 6668 ITER 6669 A valid '<gtk-tree-iter>' for the row being modified 6670 6671 COLUMN 6672 column number to modify 6673 6674 VALUE 6675 new value for the cell 6676 6677 -- Function: gtk-tree-store-remove (self '<gtk-tree-store>') 6678 (iter '<gtk-tree-iter>') => (ret '<gtk-tree-iter>') 6679 -- Method: remove 6680 Removes ITER from TREE-STORE. After being removed, ITER is set to 6681 the next valid row at that level, or invalidated if it previously 6682 pointed to the last one. 6683 6684 TREE-STORE 6685 A '<gtk-tree-store>' 6686 6687 ITER 6688 A valid '<gtk-tree-iter>' 6689 6690 RET 6691 ''#t'' if ITER is still valid, ''#f'' if not. 6692 6693 -- Function: gtk-tree-store-insert (self '<gtk-tree-store>') 6694 (parent '<gtk-tree-iter>') (position 'int') => 6695 (ret '<gtk-tree-iter>') 6696 -- Method: insert 6697 Creates a new row at POSITION. If parent is non-''#f'', then the 6698 row will be made a child of PARENT. Otherwise, the row will be 6699 created at the toplevel. If POSITION is larger than the number of 6700 rows at that level, then the new row will be inserted to the end of 6701 the list. ITER will be changed to point to this new row. The row 6702 will be empty after this function is called. To fill in values, 6703 you need to call 'gtk-tree-store-set' or 6704 'gtk-tree-store-set-value'. 6705 6706 TREE-STORE 6707 A '<gtk-tree-store>' 6708 6709 ITER 6710 An unset '<gtk-tree-iter>' to set to the new row 6711 6712 PARENT 6713 A valid '<gtk-tree-iter>', or ''#f'' 6714 6715 POSITION 6716 position to insert the new row 6717 6718 -- Function: gtk-tree-store-insert-before (self '<gtk-tree-store>') 6719 (parent '<gtk-tree-iter>') (sibling '<gtk-tree-iter>') => 6720 (ret '<gtk-tree-iter>') 6721 -- Method: insert-before 6722 Inserts a new row before SIBLING. If SIBLING is ''#f'', then the 6723 row will be appended to PARENT 's children. If PARENT and SIBLING 6724 are ''#f'', then the row will be appended to the toplevel. If both 6725 SIBLING and PARENT are set, then PARENT must be the parent of 6726 SIBLING. When SIBLING is set, PARENT is optional. 6727 6728 ITER will be changed to point to this new row. The row will be 6729 empty after this function is called. To fill in values, you need 6730 to call 'gtk-tree-store-set' or 'gtk-tree-store-set-value'. 6731 6732 TREE-STORE 6733 A '<gtk-tree-store>' 6734 6735 ITER 6736 An unset '<gtk-tree-iter>' to set to the new row 6737 6738 PARENT 6739 A valid '<gtk-tree-iter>', or ''#f'' 6740 6741 SIBLING 6742 A valid '<gtk-tree-iter>', or ''#f'' 6743 6744 -- Function: gtk-tree-store-insert-after (self '<gtk-tree-store>') 6745 (parent '<gtk-tree-iter>') (sibling '<gtk-tree-iter>') => 6746 (ret '<gtk-tree-iter>') 6747 -- Method: insert-after 6748 Inserts a new row after SIBLING. If SIBLING is ''#f'', then the 6749 row will be prepended to PARENT 's children. If PARENT and SIBLING 6750 are ''#f'', then the row will be prepended to the toplevel. If 6751 both SIBLING and PARENT are set, then PARENT must be the parent of 6752 SIBLING. When SIBLING is set, PARENT is optional. 6753 6754 ITER will be changed to point to this new row. The row will be 6755 empty after this function is called. To fill in values, you need 6756 to call 'gtk-tree-store-set' or 'gtk-tree-store-set-value'. 6757 6758 TREE-STORE 6759 A '<gtk-tree-store>' 6760 6761 ITER 6762 An unset '<gtk-tree-iter>' to set to the new row 6763 6764 PARENT 6765 A valid '<gtk-tree-iter>', or ''#f'' 6766 6767 SIBLING 6768 A valid '<gtk-tree-iter>', or ''#f'' 6769 6770 -- Function: gtk-tree-store-prepend (self '<gtk-tree-store>') 6771 (parent '<gtk-tree-iter>') => (ret '<gtk-tree-iter>') 6772 -- Method: prepend 6773 Prepends a new row to TREE-STORE. If PARENT is non-''#f'', then it 6774 will prepend the new row before the first child of PARENT, 6775 otherwise it will prepend a row to the top level. ITER will be 6776 changed to point to this new row. The row will be empty after this 6777 function is called. To fill in values, you need to call 6778 'gtk-tree-store-set' or 'gtk-tree-store-set-value'. 6779 6780 TREE-STORE 6781 A '<gtk-tree-store>' 6782 6783 ITER 6784 An unset '<gtk-tree-iter>' to set to the prepended row 6785 6786 PARENT 6787 A valid '<gtk-tree-iter>', or ''#f'' 6788 6789 -- Function: gtk-tree-store-append (self '<gtk-tree-store>') 6790 (parent '<gtk-tree-iter>') => (ret '<gtk-tree-iter>') 6791 -- Method: append 6792 Appends a new row to TREE-STORE. If PARENT is non-''#f'', then it 6793 will append the new row after the last child of PARENT, otherwise 6794 it will append a row to the top level. ITER will be changed to 6795 point to this new row. The row will be empty after this function 6796 is called. To fill in values, you need to call 6797 'gtk-tree-store-set' or 'gtk-tree-store-set-value'. 6798 6799 TREE-STORE 6800 A '<gtk-tree-store>' 6801 6802 ITER 6803 An unset '<gtk-tree-iter>' to set to the appended row 6804 6805 PARENT 6806 A valid '<gtk-tree-iter>', or ''#f'' 6807 6808 -- Function: gtk-tree-store-is-ancestor (self '<gtk-tree-store>') 6809 (iter '<gtk-tree-iter>') (descendant '<gtk-tree-iter>') => 6810 (ret 'bool') 6811 -- Method: is-ancestor 6812 Returns ''#t'' if ITER is an ancestor of DESCENDANT. That is, ITER 6813 is the parent (or grandparent or great-grandparent) of DESCENDANT. 6814 6815 TREE-STORE 6816 A '<gtk-tree-store>' 6817 6818 ITER 6819 A valid '<gtk-tree-iter>' 6820 6821 DESCENDANT 6822 A valid '<gtk-tree-iter>' 6823 6824 RET 6825 ''#t'', if ITER is an ancestor of DESCENDANT 6826 6827 -- Function: gtk-tree-store-iter-depth (self '<gtk-tree-store>') 6828 (iter '<gtk-tree-iter>') => (ret 'int') 6829 -- Method: iter-depth 6830 Returns the depth of ITER. This will be 0 for anything on the root 6831 level, 1 for anything down a level, etc. 6832 6833 TREE-STORE 6834 A '<gtk-tree-store>' 6835 6836 ITER 6837 A valid '<gtk-tree-iter>' 6838 6839 RET 6840 The depth of ITER 6841 6842 -- Function: gtk-tree-store-clear (self '<gtk-tree-store>') 6843 -- Method: clear 6844 Removes all rows from TREE-STORE 6845 6846 TREE-STORE 6847 a '<gtk-tree-store>' 6848 6849 -- Function: gtk-tree-store-iter-is-valid (self '<gtk-tree-store>') 6850 (iter '<gtk-tree-iter>') => (ret 'bool') 6851 -- Method: iter-is-valid 6852 WARNING: This function is slow. Only use it for debugging and/or 6853 testing purposes. 6854 6855 Checks if the given iter is a valid iter for this 6856 '<gtk-tree-store>'. 6857 6858 TREE-STORE 6859 A '<gtk-tree-store>'. 6860 6861 ITER 6862 A '<gtk-tree-iter>'. 6863 6864 RET 6865 ''#t'' if the iter is valid, ''#f'' if the iter is invalid. 6866 6867 Since 2.2 6868 6869 -- Function: gtk-tree-store-reorder (self '<gtk-tree-store>') 6870 (parent '<gtk-tree-iter>') => (new_order 'int') 6871 -- Method: reorder 6872 Reorders the children of PARENT in TREE-STORE to follow the order 6873 indicated by NEW-ORDER. Note that this function only works with 6874 unsorted stores. 6875 6876 TREE-STORE 6877 A '<gtk-tree-store>'. 6878 6879 PARENT 6880 A '<gtk-tree-iter>'. 6881 6882 NEW-ORDER 6883 an array of integers mapping the new position of each child to 6884 its old position before the re-ordering, i.e. 6885 NEW-ORDER'[newpos] = oldpos'. 6886 6887 Since 2.2 6888 6889 -- Function: gtk-tree-store-swap (self '<gtk-tree-store>') 6890 (a '<gtk-tree-iter>') (b '<gtk-tree-iter>') 6891 -- Method: swap 6892 Swaps A and B in the same level of TREE-STORE. Note that this 6893 function only works with unsorted stores. 6894 6895 TREE-STORE 6896 A '<gtk-tree-store>'. 6897 6898 A 6899 A '<gtk-tree-iter>'. 6900 6901 B 6902 Another '<gtk-tree-iter>'. 6903 6904 Since 2.2 6905 6906 -- Function: gtk-tree-store-move-before (self '<gtk-tree-store>') 6907 (iter '<gtk-tree-iter>') (position '<gtk-tree-iter>') 6908 -- Method: move-before 6909 Moves ITER in TREE-STORE to the position before POSITION. ITER and 6910 POSITION should be in the same level. Note that this function only 6911 works with unsorted stores. If POSITION is ''#f'', ITER will be 6912 moved to the end of the level. 6913 6914 TREE-STORE 6915 A '<gtk-tree-store>'. 6916 6917 ITER 6918 A '<gtk-tree-iter>'. 6919 6920 POSITION 6921 A '<gtk-tree-iter>' or ''#f''. 6922 6923 Since 2.2 6924 6925 -- Function: gtk-tree-store-move-after (self '<gtk-tree-store>') 6926 (iter '<gtk-tree-iter>') (position '<gtk-tree-iter>') 6927 -- Method: move-after 6928 Moves ITER in TREE-STORE to the position after POSITION. ITER and 6929 POSITION should be in the same level. Note that this function only 6930 works with unsorted stores. If POSITION is ''#f'', ITER will be 6931 moved to the start of the level. 6932 6933 TREE-STORE 6934 A '<gtk-tree-store>'. 6935 6936 ITER 6937 A '<gtk-tree-iter>'. 6938 6939 POSITION 6940 A '<gtk-tree-iter>'. 6941 6942 Since 2.2 6943 6944 6945File: guile-gnome-gtk.info, Node: GtkComboBox, Next: GtkComboBoxEntry, Prev: GtkTreeStore, Up: Top 6946 694754 GtkComboBox 6948************** 6949 6950A widget used to choose from a list of items 6951 695254.1 Overview 6953============= 6954 6955A '<gtk-combo-box>' is a widget that allows the user to choose from a 6956list of valid choices. The '<gtk-combo-box>' displays the selected 6957choice. When activated, the '<gtk-combo-box>' displays a popup which 6958allows the user to make a new choice. The style in which the selected 6959value is displayed, and the style of the popup is determined by the 6960current theme. It may be similar to a '<gtk-option-menu>', or similar 6961to a Windows-style combo box. 6962 6963 Unlike its predecessors '<gtk-combo>' and '<gtk-option-menu>', the 6964'<gtk-combo-box>' uses the model-view pattern; the list of valid choices 6965is specified in the form of a tree model, and the display of the choices 6966can be adapted to the data in the model by using cell renderers, as you 6967would in a tree view. This is possible since '<gtk-combo-box>' 6968implements the '<gtk-cell-layout>' interface. The tree model holding 6969the valid choices is not restricted to a flat list, it can be a real 6970tree, and the popup will reflect the tree structure. 6971 6972 In addition to the model-view API, '<gtk-combo-box>' offers a simple 6973API which is suitable for text-only combo boxes, and hides the 6974complexity of managing the data in a model. It consists of the 6975functions 'gtk-combo-box-new-text', 'gtk-combo-box-append-text', 6976'gtk-combo-box-insert-text', 'gtk-combo-box-prepend-text', 6977'gtk-combo-box-remove-text' and 'gtk-combo-box-get-active-text'. 6978 697954.2 Usage 6980========== 6981 6982 -- Class: <gtk-combo-box> 6983 Derives from '<gtk-cell-layout>', '<gtk-cell-editable>', 6984 '<gtk-bin>'. 6985 6986 This class defines the following slots: 6987 6988 'model' 6989 The model for the combo box 6990 6991 'wrap-width' 6992 Wrap width for laying out the items in a grid 6993 6994 'row-span-column' 6995 TreeModel column containing the row span values 6996 6997 'column-span-column' 6998 TreeModel column containing the column span values 6999 7000 'active' 7001 The item which is currently active 7002 7003 'add-tearoffs' 7004 Whether dropdowns should have a tearoff menu item 7005 7006 'tearoff-title' 7007 A title that may be displayed by the window manager when the 7008 popup is torn-off 7009 7010 'has-frame' 7011 Whether the combo box draws a frame around the child 7012 7013 'focus-on-click' 7014 Whether the combo box grabs focus when it is clicked with the 7015 mouse 7016 7017 'popup-shown' 7018 Whether the combo's dropdown is shown 7019 7020 -- Signal on <gtk-combo-box>: changed 7021 The changed signal is emitted when the active item is changed. The 7022 can be due to the user selecting a different item from the list, or 7023 due to a call to 'gtk-combo-box-set-active-iter'. It will also be 7024 emitted while typing into a GtkComboBoxEntry, as well as when 7025 selecting an item from the GtkComboBoxEntry's list. 7026 7027 Since 2.4 7028 7029 -- Signal on <gtk-combo-box>: move-active (arg0 '<gtk-scroll-type>') 7030 undocumented 7031 7032 -- Signal on <gtk-combo-box>: popup 7033 undocumented 7034 7035 -- Signal on <gtk-combo-box>: popdown => '<gboolean>' 7036 undocumented 7037 7038 -- Function: gtk-combo-box-new => (ret '<gtk-widget>') 7039 Creates a new empty '<gtk-combo-box>'. 7040 7041 RET 7042 A new '<gtk-combo-box>'. 7043 7044 Since 2.4 7045 7046 -- Function: gtk-combo-box-new-with-model (model '<gtk-tree-model>') 7047 => (ret '<gtk-widget>') 7048 Creates a new '<gtk-combo-box>' with the model initialized to 7049 MODEL. 7050 7051 MODEL 7052 A '<gtk-tree-model>'. 7053 7054 RET 7055 A new '<gtk-combo-box>'. 7056 7057 Since 2.4 7058 7059 -- Function: gtk-combo-box-get-wrap-width (self '<gtk-combo-box>') => 7060 (ret 'int') 7061 -- Method: get-wrap-width 7062 Returns the wrap width which is used to determine the number of 7063 columns for the popup menu. If the wrap width is larger than 1, 7064 the combo box is in table mode. 7065 7066 COMBO-BOX 7067 A '<gtk-combo-box>'. 7068 7069 RET 7070 the wrap width. 7071 7072 Since 2.6 7073 7074 -- Function: gtk-combo-box-set-wrap-width (self '<gtk-combo-box>') 7075 (width 'int') 7076 -- Method: set-wrap-width 7077 Sets the wrap width of COMBO-BOX to be WIDTH. The wrap width is 7078 basically the preferred number of columns when you want the popup 7079 to be layed out in a table. 7080 7081 COMBO-BOX 7082 A '<gtk-combo-box>'. 7083 7084 WIDTH 7085 Preferred number of columns. 7086 7087 Since 2.4 7088 7089 -- Function: gtk-combo-box-get-row-span-column (self '<gtk-combo-box>') 7090 => (ret 'int') 7091 -- Method: get-row-span-column 7092 Returns the column with row span information for COMBO-BOX. 7093 7094 COMBO-BOX 7095 A '<gtk-combo-box>'. 7096 7097 RET 7098 the row span column. 7099 7100 Since 2.6 7101 7102 -- Function: gtk-combo-box-set-row-span-column (self '<gtk-combo-box>') 7103 (row_span 'int') 7104 -- Method: set-row-span-column 7105 Sets the column with row span information for COMBO-BOX to be 7106 ROW-SPAN. The row span column contains integers which indicate how 7107 many rows an item should span. 7108 7109 COMBO-BOX 7110 A '<gtk-combo-box>'. 7111 7112 ROW-SPAN 7113 A column in the model passed during construction. 7114 7115 Since 2.4 7116 7117 -- Function: gtk-combo-box-get-active (self '<gtk-combo-box>') => 7118 (ret 'int') 7119 -- Method: get-active 7120 Returns the index of the currently active item, or -1 if there's no 7121 active item. If the model is a non-flat treemodel, and the active 7122 item is not an immediate child of the root of the tree, this 7123 function returns 'gtk_tree_path_get_indices (path)[0]', where 7124 'path' is the '<gtk-tree-path>' of the active item. 7125 7126 COMBO-BOX 7127 A '<gtk-combo-box>'. 7128 7129 RET 7130 An integer which is the index of the currently active item, or 7131 -1 if there's no active item. 7132 7133 Since 2.4 7134 7135 -- Function: gtk-combo-box-set-active (self '<gtk-combo-box>') 7136 (index_ 'int') 7137 -- Method: set-active 7138 Sets the active item of COMBO-BOX to be the item at INDEX. 7139 7140 COMBO-BOX 7141 A '<gtk-combo-box>'. 7142 7143 INDEX 7144 An index in the model passed during construction, or -1 to 7145 have no active item. 7146 7147 Since 2.4 7148 7149 -- Function: gtk-combo-box-get-active-iter (self '<gtk-combo-box>') 7150 (iter '<gtk-tree-iter>') => (ret 'bool') 7151 -- Method: get-active-iter 7152 Sets ITER to point to the current active item, if it exists. 7153 7154 COMBO-BOX 7155 A '<gtk-combo-box>' 7156 7157 ITER 7158 The uninitialized '<gtk-tree-iter>'. 7159 7160 RET 7161 ''#t'', if ITER was set 7162 7163 Since 2.4 7164 7165 -- Function: gtk-combo-box-set-active-iter (self '<gtk-combo-box>') 7166 (iter '<gtk-tree-iter>') 7167 -- Method: set-active-iter 7168 Sets the current active item to be the one referenced by ITER. 7169 ITER must correspond to a path of depth one. 7170 7171 COMBO-BOX 7172 A '<gtk-combo-box>' 7173 7174 ITER 7175 The '<gtk-tree-iter>'. 7176 7177 Since 2.4 7178 7179 -- Function: gtk-combo-box-get-model (self '<gtk-combo-box>') => 7180 (ret '<gtk-tree-model>') 7181 -- Method: get-model 7182 Returns the '<gtk-tree-model>' which is acting as data source for 7183 COMBO-BOX. 7184 7185 COMBO-BOX 7186 A '<gtk-combo-box>'. 7187 7188 RET 7189 A '<gtk-tree-model>' which was passed during construction. 7190 7191 Since 2.4 7192 7193 -- Function: gtk-combo-box-set-model (self '<gtk-combo-box>') 7194 (model '<gtk-tree-model>') 7195 -- Method: set-model 7196 Sets the model used by COMBO-BOX to be MODEL. Will unset a 7197 previously set model (if applicable). If model is ''#f'', then it 7198 will unset the model. 7199 7200 Note that this function does not clear the cell renderers, you have 7201 to call 'gtk-combo-box-cell-layout-clear' yourself if you need to 7202 set up different cell renderers for the new model. 7203 7204 COMBO-BOX 7205 A '<gtk-combo-box>'. 7206 7207 MODEL 7208 A '<gtk-tree-model>'. 7209 7210 Since 2.4 7211 7212 -- Function: gtk-combo-box-new-text => (ret '<gtk-widget>') 7213 Convenience function which constructs a new text combo box, which 7214 is a '<gtk-combo-box>' just displaying strings. If you use this 7215 function to create a text combo box, you should only manipulate its 7216 data source with the following convenience functions: 7217 'gtk-combo-box-append-text', 'gtk-combo-box-insert-text', 7218 'gtk-combo-box-prepend-text' and 'gtk-combo-box-remove-text'. 7219 7220 RET 7221 A new text combo box. 7222 7223 Since 2.4 7224 7225 -- Function: gtk-combo-box-append-text (self '<gtk-combo-box>') 7226 (text 'mchars') 7227 -- Method: append-text 7228 Appends STRING to the list of strings stored in COMBO-BOX. Note 7229 that you can only use this function with combo boxes constructed 7230 with 'gtk-combo-box-new-text'. 7231 7232 COMBO-BOX 7233 A '<gtk-combo-box>' constructed using 7234 'gtk-combo-box-new-text'. 7235 7236 TEXT 7237 A string. 7238 7239 Since 2.4 7240 7241 -- Function: gtk-combo-box-insert-text (self '<gtk-combo-box>') 7242 (position 'int') (text 'mchars') 7243 -- Method: insert-text 7244 Inserts STRING at POSITION in the list of strings stored in 7245 COMBO-BOX. Note that you can only use this function with combo 7246 boxes constructed with 'gtk-combo-box-new-text'. 7247 7248 COMBO-BOX 7249 A '<gtk-combo-box>' constructed using 7250 'gtk-combo-box-new-text'. 7251 7252 POSITION 7253 An index to insert TEXT. 7254 7255 TEXT 7256 A string. 7257 7258 Since 2.4 7259 7260 -- Function: gtk-combo-box-prepend-text (self '<gtk-combo-box>') 7261 (text 'mchars') 7262 -- Method: prepend-text 7263 Prepends STRING to the list of strings stored in COMBO-BOX. Note 7264 that you can only use this function with combo boxes constructed 7265 with 'gtk-combo-box-new-text'. 7266 7267 COMBO-BOX 7268 A '<gtk-combo-box>' constructed with 'gtk-combo-box-new-text'. 7269 7270 TEXT 7271 A string. 7272 7273 Since 2.4 7274 7275 -- Function: gtk-combo-box-remove-text (self '<gtk-combo-box>') 7276 (position 'int') 7277 -- Method: remove-text 7278 Removes the string at POSITION from COMBO-BOX. Note that you can 7279 only use this function with combo boxes constructed with 7280 'gtk-combo-box-new-text'. 7281 7282 COMBO-BOX 7283 A '<gtk-combo-box>' constructed with 'gtk-combo-box-new-text'. 7284 7285 POSITION 7286 Index of the item to remove. 7287 7288 Since 2.4 7289 7290 -- Function: gtk-combo-box-get-active-text (self '<gtk-combo-box>') => 7291 (ret 'mchars') 7292 -- Method: get-active-text 7293 Returns the currently active string in COMBO-BOX or ''#f'' if none 7294 is selected. Note that you can only use this function with combo 7295 boxes constructed with 'gtk-combo-box-new-text' and with 7296 '<gtk-combo-box-entry>'s. 7297 7298 COMBO-BOX 7299 A '<gtk-combo-box>' constructed with 'gtk-combo-box-new-text'. 7300 7301 RET 7302 a newly allocated string containing the currently active text. 7303 7304 Since 2.6 7305 7306 -- Function: gtk-combo-box-popup (self '<gtk-combo-box>') 7307 -- Method: popup 7308 Pops up the menu or dropdown list of COMBO-BOX. 7309 7310 This function is mostly intended for use by accessibility 7311 technologies; applications should have little use for it. 7312 7313 COMBO-BOX 7314 a '<gtk-combo-box>' 7315 7316 Since 2.4 7317 7318 -- Function: gtk-combo-box-popdown (self '<gtk-combo-box>') 7319 -- Method: popdown 7320 Hides the menu or dropdown list of COMBO-BOX. 7321 7322 This function is mostly intended for use by accessibility 7323 technologies; applications should have little use for it. 7324 7325 COMBO-BOX 7326 a '<gtk-combo-box>' 7327 7328 Since 2.4 7329 7330 -- Function: gtk-combo-box-get-popup-accessible 7331 (self '<gtk-combo-box>') => (ret '<atk-object>') 7332 -- Method: get-popup-accessible 7333 Gets the accessible object corresponding to the combo box's popup. 7334 7335 This function is mostly intended for use by accessibility 7336 technologies; applications should have little use for it. 7337 7338 COMBO-BOX 7339 a '<gtk-combo-box>' 7340 7341 RET 7342 the accessible object corresponding to the combo box's popup. 7343 7344 Since 2.6 7345 7346 -- Function: gtk-combo-box-set-add-tearoffs (self '<gtk-combo-box>') 7347 (add_tearoffs 'bool') 7348 -- Method: set-add-tearoffs 7349 Sets whether the popup menu should have a tearoff menu item. 7350 7351 COMBO-BOX 7352 a '<gtk-combo-box>' 7353 7354 ADD-TEAROFFS 7355 ''#t'' to add tearoff menu items 7356 7357 Since 2.6 7358 7359 -- Function: gtk-combo-box-get-add-tearoffs (self '<gtk-combo-box>') 7360 => (ret 'bool') 7361 -- Method: get-add-tearoffs 7362 Gets the current value of the :add-tearoffs property. 7363 7364 COMBO-BOX 7365 a '<gtk-combo-box>' 7366 7367 RET 7368 the current value of the :add-tearoffs property. 7369 7370 -- Function: gtk-combo-box-set-title (self '<gtk-combo-box>') 7371 (title 'mchars') 7372 -- Method: set-title 7373 Sets the menu's title in tearoff mode. 7374 7375 COMBO-BOX 7376 a '<gtk-combo-box>' 7377 7378 TITLE 7379 a title for the menu in tearoff mode. 7380 7381 Since 2.10 7382 7383 -- Function: gtk-combo-box-get-title (self '<gtk-combo-box>') => 7384 (ret 'mchars') 7385 -- Method: get-title 7386 Gets the current title of the menu in tearoff mode. See 7387 'gtk-combo-box-set-add-tearoffs'. 7388 7389 COMBO-BOX 7390 a '<gtk-combo-box>' 7391 7392 RET 7393 the menu's title in tearoff mode. This is an internal copy of 7394 the string which must not be freed. 7395 7396 Since 2.10 7397 7398 -- Function: gtk-combo-box-set-focus-on-click (self '<gtk-combo-box>') 7399 (focus_on_click 'bool') 7400 -- Method: set-focus-on-click 7401 Sets whether the combo box will grab focus when it is clicked with 7402 the mouse. Making mouse clicks not grab focus is useful in places 7403 like toolbars where you don't want the keyboard focus removed from 7404 the main area of the application. 7405 7406 COMBO 7407 a '<gtk-combo-box>' 7408 7409 FOCUS-ON-CLICK 7410 whether the combo box grabs focus when clicked with the mouse 7411 7412 Since 2.6 7413 7414 -- Function: gtk-combo-box-get-focus-on-click (self '<gtk-combo-box>') 7415 => (ret 'bool') 7416 -- Method: get-focus-on-click 7417 Returns whether the combo box grabs focus when it is clicked with 7418 the mouse. See 'gtk-combo-box-set-focus-on-click'. 7419 7420 COMBO 7421 a '<gtk-combo-box>' 7422 7423 RET 7424 ''#t'' if the combo box grabs focus when it is clicked with 7425 the mouse. 7426 7427 Since 2.6 7428 7429 7430File: guile-gnome-gtk.info, Node: GtkComboBoxEntry, Next: GtkMenu, Prev: GtkComboBox, Up: Top 7431 743255 GtkComboBoxEntry 7433******************* 7434 7435A text entry field with a dropdown list 7436 743755.1 Overview 7438============= 7439 7440A '<gtk-combo-box-entry>' is a widget that allows the user to choose 7441from a list of valid choices or enter a different value. It is very 7442similar to a '<gtk-combo-box>', but it displays the selected value in an 7443entry to allow modifying it. 7444 7445 In contrast to a '<gtk-combo-box>', the underlying model of a 7446'<gtk-combo-box-entry>' must always have a text column (see 7447'gtk-combo-box-entry-set-text-column'), and the entry will show the 7448content of the text column in the selected row. To get the text from 7449the entry, use 'gtk-combo-box-get-active-text'. 7450 7451 The changed signal will be emitted while typing into a 7452GtkComboBoxEntry, as well as when selecting an item from the 7453GtkComboBoxEntry's list. Use 'gtk-combo-box-get-active' or 7454'gtk-combo-box-get-active-iter' to discover whether an item was actually 7455selected from the list. 7456 7457 Connect to the activate signal of the GtkEntry (use 7458'gtk-bin-get-child') to detect when the user actually finishes entering 7459text. 7460 7461 The convenience API to construct simple text-only '<gtk-combo-box>'es 7462can also be used with '<gtk-combo-box-entry>'s which have been 7463constructed with 'gtk-combo-box-entry-new-text'. 7464 746555.2 Usage 7466========== 7467 7468 -- Class: <gtk-combo-box-entry> 7469 Derives from '<gtk-combo-box>'. 7470 7471 This class defines the following slots: 7472 7473 'text-column' 7474 A column in the data source model to get the strings from 7475 7476 -- Function: gtk-combo-box-entry-new => (ret '<gtk-widget>') 7477 Creates a new '<gtk-combo-box-entry>' which has a '<gtk-entry>' as 7478 child. After construction, you should set a model using 7479 'gtk-combo-box-set-model' and a text_column * using 7480 'gtk-combo-box-entry-set-text-column'. 7481 7482 RET 7483 A new '<gtk-combo-box-entry>'. 7484 7485 Since 2.4 7486 7487 -- Function: gtk-combo-box-entry-new-with-model 7488 (model '<gtk-tree-model>') (text_column 'int') => 7489 (ret '<gtk-widget>') 7490 Creates a new '<gtk-combo-box-entry>' which has a '<gtk-entry>' as 7491 child and a list of strings as popup. You can get the 7492 '<gtk-entry>' from a '<gtk-combo-box-entry>' using GTK_ENTRY 7493 (GTK_BIN (combo_box_entry)->child). To add and remove strings from 7494 the list, just modify MODEL using its data manipulation API. 7495 7496 MODEL 7497 A '<gtk-tree-model>'. 7498 7499 TEXT-COLUMN 7500 A column in MODEL to get the strings from. 7501 7502 RET 7503 A new '<gtk-combo-box-entry>'. 7504 7505 Since 2.4 7506 7507 -- Function: gtk-combo-box-entry-new-text => (ret '<gtk-widget>') 7508 Convenience function which constructs a new editable text combo 7509 box, which is a '<gtk-combo-box-entry>' just displaying strings. 7510 If you use this function to create a text combo box, you should 7511 only manipulate its data source with the following convenience 7512 functions: 'gtk-combo-box-append-text', 7513 'gtk-combo-box-insert-text', 'gtk-combo-box-prepend-text' and 7514 'gtk-combo-box-remove-text'. 7515 7516 RET 7517 A new text '<gtk-combo-box-entry>'. 7518 7519 Since 2.4 7520 7521 -- Function: gtk-combo-box-entry-set-text-column 7522 (self '<gtk-combo-box-entry>') (text_column 'int') 7523 -- Method: set-text-column 7524 Sets the model column which ENTRY-BOX should use to get strings 7525 from to be TEXT-COLUMN. 7526 7527 ENTRY-BOX 7528 A '<gtk-combo-box-entry>'. 7529 7530 TEXT-COLUMN 7531 A column in MODEL to get the strings from. 7532 7533 Since 2.4 7534 7535 -- Function: gtk-combo-box-entry-get-text-column 7536 (self '<gtk-combo-box-entry>') => (ret 'int') 7537 -- Method: get-text-column 7538 Returns the column which ENTRY-BOX is using to get the strings 7539 from. 7540 7541 ENTRY-BOX 7542 A '<gtk-combo-box-entry>'. 7543 7544 RET 7545 A column in the data source model of ENTRY-BOX. 7546 7547 Since 2.4 7548 7549 7550File: guile-gnome-gtk.info, Node: GtkMenu, Next: GtkMenuBar, Prev: GtkComboBoxEntry, Up: Top 7551 755256 GtkMenu 7553********** 7554 7555A menu widget 7556 755756.1 Overview 7558============= 7559 7560A '<gtk-menu>' is a '<gtk-menu-shell>' that implements a drop down menu 7561consisting of a list of '<gtk-menu-item>' objects which can be navigated 7562and activated by the user to perform application functions. 7563 7564 A '<gtk-menu>' is most commonly dropped down by activating a 7565'<gtk-menu-item>' in a '<gtk-menu-bar>' or popped up by activating a 7566'<gtk-menu-item>' in another '<gtk-menu>'. 7567 7568 A '<gtk-menu>' can also be popped up by activating a 7569'<gtk-option-menu>'. Other composite widgets such as the 7570'<gtk-notebook>' can pop up a '<gtk-menu>' as well. 7571 7572 Applications can display a '<gtk-menu>' as a popup menu by calling 7573the 'gtk-menu-popup' function. The example below shows how an 7574application can pop up a menu when the 3rd mouse button is pressed. 7575 7576 7577 /* connect our handler which will popup the menu */ 7578 g_signal_connect_swapped (window, "button_press_event", 7579 G_CALLBACK (my_popup_handler), menu); 7580 7581 7582 static gint 7583 my_popup_handler (GtkWidget *widget, GdkEvent *event) 7584 { 7585 GtkMenu *menu; 7586 GdkEventButton *event_button; 7587 7588 g_return_val_if_fail (widget != NULL, FALSE); 7589 g_return_val_if_fail (GTK_IS_MENU (widget), FALSE); 7590 g_return_val_if_fail (event != NULL, FALSE); 7591 7592 /* The "widget" is the menu that was supplied when 7593 * g_signal_connect_swapped() was called. 7594 */ 7595 menu = GTK_MENU (widget); 7596 7597 if (event->type == GDK_BUTTON_PRESS) 7598 { 7599 event_button = (GdkEventButton *) event; 7600 if (event_button->button == 3) 7601 { 7602 gtk_menu_popup (menu, NULL, NULL, NULL, NULL, 7603 event_button->button, event_button->time); 7604 return TRUE; 7605 } 7606 } 7607 7608 return FALSE; 7609 } 7610 761156.2 Usage 7612========== 7613 7614 -- Class: <gtk-menu> 7615 Derives from '<gtk-menu-shell>'. 7616 7617 This class defines the following slots: 7618 7619 'tearoff-state' 7620 A boolean that indicates whether the menu is torn-off 7621 7622 'tearoff-title' 7623 A title that may be displayed by the window manager when this 7624 menu is torn-off 7625 7626 -- Signal on <gtk-menu>: move-scroll (arg0 '<gtk-scroll-type>') 7627 7628 -- Function: gtk-menu-new => (ret '<gtk-widget>') 7629 Creates a new '<gtk-menu>'. 7630 7631 RET 7632 a new '<gtk-menu>'. 7633 7634 -- Function: gtk-menu-set-screen (self '<gtk-menu>') 7635 (screen '<gdk-screen>') 7636 -- Method: set-screen 7637 Sets the '<gdk-screen>' on which the menu will be displayed. 7638 7639 MENU 7640 a '<gtk-menu>'. 7641 7642 SCREEN 7643 a '<gdk-screen>', or ''#f'' if the screen should be determined 7644 by the widget the menu is attached to. 7645 7646 Since 2.2 7647 7648 -- Function: gtk-menu-reorder-child (self '<gtk-menu>') 7649 (child '<gtk-widget>') (position 'int') 7650 -- Method: reorder-child 7651 Moves a '<gtk-menu-item>' to a new position within the 7652 '<gtk-menu>'. 7653 7654 MENU 7655 a '<gtk-menu>'. 7656 7657 CHILD 7658 the '<gtk-menu-item>' to move. 7659 7660 POSITION 7661 the new position to place CHILD. Positions are numbered from 7662 0 to n-1. 7663 7664 -- Function: gtk-menu-attach (self '<gtk-menu>') (child '<gtk-widget>') 7665 (left_attach 'unsigned-int') (right_attach 'unsigned-int') 7666 (top_attach 'unsigned-int') (bottom_attach 'unsigned-int') 7667 -- Method: attach 7668 Adds a new '<gtk-menu-item>' to a (table) menu. The number of 7669 'cells' that an item will occupy is specified by LEFT-ATTACH, 7670 RIGHT-ATTACH, TOP-ATTACH and BOTTOM-ATTACH. These each represent 7671 the leftmost, rightmost, uppermost and lower column and row numbers 7672 of the table. (Columns and rows are indexed from zero). 7673 7674 Note that this function is not related to 'gtk-menu-detach'. 7675 7676 MENU 7677 a '<gtk-menu>'. 7678 7679 CHILD 7680 a '<gtk-menu-item>'. 7681 7682 LEFT-ATTACH 7683 The column number to attach the left side of the item to. 7684 7685 RIGHT-ATTACH 7686 The column number to attach the right side of the item to. 7687 7688 TOP-ATTACH 7689 The row number to attach the top of the item to. 7690 7691 BOTTOM-ATTACH 7692 The row number to attach the bottom of the item to. 7693 7694 Since 2.4 7695 7696 -- Function: gtk-menu-popup (self '<gtk-menu>') 7697 (parent_menu_shell '<gtk-widget>') 7698 (parent_menu_item '<gtk-widget>') (menu_position_func 'scm') 7699 (button 'unsigned-int') (activate_time 'unsigned-int32') 7700 -- Method: popup 7701 Displays a menu and makes it available for selection. Applications 7702 can use this function to display context-sensitive menus, and will 7703 typically supply ''#f'' for the PARENT-MENU-SHELL, 7704 PARENT-MENU-ITEM, FUNC and DATA parameters. The default menu 7705 positioning function will position the menu at the current mouse 7706 cursor position. 7707 7708 The BUTTON parameter should be the mouse button pressed to initiate 7709 the menu popup. If the menu popup was initiated by something other 7710 than a mouse button press, such as a mouse button release or a 7711 keypress, BUTTON should be 0. 7712 7713 The ACTIVATE-TIME parameter should be the time stamp of the event 7714 that initiated the popup. If such an event is not available, use 7715 'gtk-get-current-event-time' instead. 7716 7717 MENU 7718 a '<gtk-menu>'. 7719 7720 PARENT-MENU-SHELL 7721 the menu shell containing the triggering menu item, or ''#f'' 7722 7723 PARENT-MENU-ITEM 7724 the menu item whose activation triggered the popup, or ''#f'' 7725 7726 FUNC 7727 a user supplied function used to position the menu, or ''#f'' 7728 7729 DATA 7730 user supplied data to be passed to FUNC. 7731 7732 BUTTON 7733 the mouse button which was pressed to initiate the event. 7734 7735 ACTIVATE-TIME 7736 the time at which the activation event occurred. 7737 7738 -- Function: gtk-menu-set-accel-group (self '<gtk-menu>') 7739 (accel_group '<gtk-accel-group>') 7740 -- Method: set-accel-group 7741 Set the '<gtk-accel-group>' which holds global accelerators for the 7742 menu. This accelerator group needs to also be added to all windows 7743 that this menu is being used in with 'gtk-window-add-accel-group', 7744 in order for those windows to support all the accelerators 7745 contained in this group. 7746 7747 MENU 7748 a '<gtk-menu>'. 7749 7750 ACCEL-GROUP 7751 the '<gtk-accel-group>' to be associated with the menu. 7752 7753 -- Function: gtk-menu-get-accel-group (self '<gtk-menu>') => 7754 (ret '<gtk-accel-group>') 7755 -- Method: get-accel-group 7756 Gets the '<gtk-accel-group>' which holds global accelerators for 7757 the menu. See 'gtk-menu-set-accel-group'. 7758 7759 MENU 7760 a '<gtk-menu>'. 7761 7762 RET 7763 the '<gtk-accel-group>' associated with the menu. 7764 7765 -- Function: gtk-menu-set-accel-path (self '<gtk-menu>') 7766 (accel_path 'mchars') 7767 -- Method: set-accel-path 7768 Sets an accelerator path for this menu from which accelerator paths 7769 for its immediate children, its menu items, can be constructed. 7770 The main purpose of this function is to spare the programmer the 7771 inconvenience of having to call 'gtk-menu-item-set-accel-path' on 7772 each menu item that should support runtime user changable 7773 accelerators. Instead, by just calling 'gtk-menu-set-accel-path' 7774 on their parent, each menu item of this menu, that contains a label 7775 describing its purpose, automatically gets an accel path assigned. 7776 For example, a menu containing menu items "New" and "Exit", will, 7777 after 'gtk_menu_set_accel_path (menu, "<Gnumeric-Sheet>/File");' 7778 has been called, assign its items the accel paths: 7779 '"<Gnumeric-Sheet>/File/New"' and '"<Gnumeric-Sheet>/File/Exit"'. 7780 Assigning accel paths to menu items then enables the user to change 7781 their accelerators at runtime. More details about accelerator 7782 paths and their default setups can be found at 7783 'gtk-accel-map-add-entry'. 7784 7785 MENU 7786 a valid '<gtk-menu>' 7787 7788 ACCEL-PATH 7789 a valid accelerator path 7790 7791 -- Function: gtk-menu-set-title (self '<gtk-menu>') (title 'mchars') 7792 -- Method: set-title 7793 Sets the title string for the menu. The title is displayed when 7794 the menu is shown as a tearoff menu. If TITLE is ''#f'', the menu 7795 will see if it is attached to a parent menu item, and if so it will 7796 try to use the same text as that menu item's label. 7797 7798 MENU 7799 a '<gtk-menu>' 7800 7801 TITLE 7802 a string containing the title for the menu. 7803 7804 -- Function: gtk-menu-get-tearoff-state (self '<gtk-menu>') => 7805 (ret 'bool') 7806 -- Method: get-tearoff-state 7807 Returns whether the menu is torn off. See 7808 'gtk-menu-set-tearoff-state'. 7809 7810 MENU 7811 a '<gtk-menu>' 7812 7813 RET 7814 ''#t'' if the menu is currently torn off. 7815 7816 -- Function: gtk-menu-get-title (self '<gtk-menu>') => (ret 'mchars') 7817 -- Method: get-title 7818 Returns the title of the menu. See 'gtk-menu-set-title'. 7819 7820 MENU 7821 a '<gtk-menu>' 7822 7823 RET 7824 the title of the menu, or ''#f'' if the menu has no title set 7825 on it. This string is owned by the widget and should not be 7826 modified or freed. 7827 7828 -- Function: gtk-menu-popdown (self '<gtk-menu>') 7829 -- Method: popdown 7830 Removes the menu from the screen. 7831 7832 MENU 7833 a '<gtk-menu>'. 7834 7835 -- Function: gtk-menu-reposition (self '<gtk-menu>') 7836 -- Method: reposition 7837 Repositions the menu according to its position function. 7838 7839 MENU 7840 a '<gtk-menu>'. 7841 7842 -- Function: gtk-menu-get-active (self '<gtk-menu>') => 7843 (ret '<gtk-widget>') 7844 -- Method: get-active 7845 Returns the selected menu item from the menu. This is used by the 7846 '<gtk-option-menu>'. 7847 7848 MENU 7849 a '<gtk-menu>'. 7850 7851 RET 7852 the '<gtk-menu-item>' that was last selected in the menu. If 7853 a selection has not yet been made, the first menu item is 7854 selected. 7855 7856 -- Function: gtk-menu-set-active (self '<gtk-menu>') 7857 (index 'unsigned-int') 7858 -- Method: set-active 7859 Selects the specified menu item within the menu. This is used by 7860 the '<gtk-option-menu>' and should not be used by anyone else. 7861 7862 MENU 7863 a '<gtk-menu>'. 7864 7865 INDEX 7866 the index of the menu item to select. Index values are from 0 7867 to n-1. 7868 7869 -- Function: gtk-menu-set-tearoff-state (self '<gtk-menu>') 7870 (torn_off 'bool') 7871 -- Method: set-tearoff-state 7872 Changes the tearoff state of the menu. A menu is normally 7873 displayed as drop down menu which persists as long as the menu is 7874 active. It can also be displayed as a tearoff menu which persists 7875 until it is closed or reattached. 7876 7877 MENU 7878 a '<gtk-menu>'. 7879 7880 TORN-OFF 7881 If ''#t'', menu is displayed as a tearoff menu. 7882 7883 -- Function: gtk-menu-detach (self '<gtk-menu>') 7884 -- Method: detach 7885 Detaches the menu from the widget to which it had been attached. 7886 This function will call the callback function, DETACHER, provided 7887 when the 'gtk-menu-attach-to-widget' function was called. 7888 7889 MENU 7890 a '<gtk-menu>'. 7891 7892 -- Function: gtk-menu-get-attach-widget (self '<gtk-menu>') => 7893 (ret '<gtk-widget>') 7894 -- Method: get-attach-widget 7895 Returns the '<gtk-widget>' that the menu is attached to. 7896 7897 MENU 7898 a '<gtk-menu>'. 7899 7900 RET 7901 the '<gtk-widget>' that the menu is attached to. 7902 7903 -- Function: gtk-menu-get-for-attach-widget (widget '<gtk-widget>') => 7904 (ret 'glist-of') 7905 Returns a list of the menus which are attached to this widget. 7906 This list is owned by GTK+ and must not be modified. 7907 7908 WIDGET 7909 a '<gtk-widget>' 7910 7911 RET 7912 the list of menus attached to his widget. 7913 7914 Since 2.6 7915 7916 -- Function: gtk-menu-set-monitor (self '<gtk-menu>') 7917 (monitor_num 'int') 7918 -- Method: set-monitor 7919 Informs GTK+ on which monitor a menu should be popped up. See 7920 'gdk-screen-get-monitor-geometry'. 7921 7922 This function should be called from a '<gtk-menu-position-func>' if 7923 the menu should not appear on the same monitor as the pointer. 7924 This information can't be reliably inferred from the coordinates 7925 returned by a '<gtk-menu-position-func>', since, for very long 7926 menus, these coordinates may extend beyond the monitor boundaries 7927 or even the screen boundaries. 7928 7929 MENU 7930 a '<gtk-menu>' 7931 7932 MONITOR-NUM 7933 the number of the monitor on which the menu should be popped 7934 up 7935 7936 Since 2.4 7937 7938 7939File: guile-gnome-gtk.info, Node: GtkMenuBar, Next: GtkMenuItem, Prev: GtkMenu, Up: Top 7940 794157 GtkMenuBar 7942************* 7943 7944A subclass widget for which holds widgets 7945 794657.1 Overview 7947============= 7948 7949The '<gtk-menu-bar>' is a subclass of '<gtk-menu-shell>' which contains 7950one to many '<gtk-menu-item>'. The result is a standard menu bar which 7951can hold many menu items. '<gtk-menu-bar>' allows for a shadow type to 7952be set for aesthetic purposes. The shadow types are defined in the 7953'<gtk-menu-bar-set-shadow-type>' function. 7954 795557.2 Usage 7956========== 7957 7958 -- Class: <gtk-menu-bar> 7959 Derives from '<gtk-menu-shell>'. 7960 7961 This class defines the following slots: 7962 7963 'pack-direction' 7964 The pack direction of the menubar 7965 7966 'child-pack-direction' 7967 The child pack direction of the menubar 7968 7969 -- Function: gtk-menu-bar-new => (ret '<gtk-widget>') 7970 Creates the new '<gtk-menu-bar>' 7971 7972 RET 7973 the '<gtk-menu-bar>' 7974 7975 -- Function: gtk-menu-bar-set-pack-direction (self '<gtk-menu-bar>') 7976 (pack_dir '<gtk-pack-direction>') 7977 -- Method: set-pack-direction 7978 Sets how items should be packed inside a menubar. 7979 7980 MENUBAR 7981 a '<gtk-menu-bar>'. 7982 7983 PACK-DIR 7984 a new '<gtk-pack-direction>'. 7985 7986 Since 2.8 7987 7988 -- Function: gtk-menu-bar-get-pack-direction (self '<gtk-menu-bar>') 7989 => (ret '<gtk-pack-direction>') 7990 -- Method: get-pack-direction 7991 Retrieves the current pack direction of the menubar. See 7992 'gtk-menu-bar-set-pack-direction'. 7993 7994 MENUBAR 7995 a '<gtk-menu-bar>' 7996 7997 RET 7998 the pack direction 7999 8000 Since 2.8 8001 8002 8003File: guile-gnome-gtk.info, Node: GtkMenuItem, Next: GtkMenuShell, Prev: GtkMenuBar, Up: Top 8004 800558 GtkMenuItem 8006************** 8007 8008The widget used for item in menus 8009 801058.1 Overview 8011============= 8012 8013The '<gtk-menu-item>' widget and the derived widgets are the only valid 8014childs for menus. Their function is to correctly handle highlighting, 8015alignment, events and submenus. 8016 8017 As it derives from '<gtk-bin>' it can hold any valid child widget, 8018altough only a few are really useful. 8019 802058.2 Usage 8021========== 8022 8023 -- Class: <gtk-menu-item> 8024 Derives from '<gtk-item>'. 8025 8026 This class defines the following slots: 8027 8028 'submenu' 8029 The submenu attached to the menu item, or NULL if it has none 8030 8031 -- Signal on <gtk-menu-item>: activate 8032 Emitted when the item is activated. 8033 8034 -- Signal on <gtk-menu-item>: activate-item 8035 Emitted when the item is activated, but also if the menu item has a 8036 submenu. For normal applications, the relevant signal is 8037 "activate". 8038 8039 -- Signal on <gtk-menu-item>: toggle-size-request (arg0 '<gpointer>') 8040 8041 -- Signal on <gtk-menu-item>: toggle-size-allocate (arg0 '<gint>') 8042 8043 -- Function: gtk-menu-item-new => (ret '<gtk-widget>') 8044 Creates a new '<gtk-menu-item>'. 8045 8046 RET 8047 the newly created '<gtk-menu-item>' 8048 8049 -- Function: gtk-menu-item-new-with-label (label 'mchars') => 8050 (ret '<gtk-widget>') 8051 Creates a new '<gtk-menu-item>' whose child is a '<gtk-label>'. 8052 8053 LABEL 8054 the text for the label 8055 8056 RET 8057 the newly created '<gtk-menu-item>' 8058 8059 -- Function: gtk-menu-item-new-with-mnemonic (label 'mchars') => 8060 (ret '<gtk-widget>') 8061 Creates a new '<gtk-menu-item>' containing a label. The label will 8062 be created using 'gtk-label-new-with-mnemonic', so underscores in 8063 LABEL indicate the mnemonic for the menu item. 8064 8065 LABEL 8066 The text of the button, with an underscore in front of the 8067 mnemonic character 8068 8069 RET 8070 a new '<gtk-menu-item>' 8071 8072 -- Function: gtk-menu-item-set-right-justified (self '<gtk-menu-item>') 8073 (right_justified 'bool') 8074 -- Method: set-right-justified 8075 Sets whether the menu item appears justified at the right side of a 8076 menu bar. This was traditionally done for "Help" menu items, but 8077 is now considered a bad idea. (If the widget layout is reversed 8078 for a right-to-left language like Hebrew or Arabic, 8079 right-justified-menu-items appear at the left.) 8080 8081 MENU-ITEM 8082 a '<gtk-menu-item>'. 8083 8084 RIGHT-JUSTIFIED 8085 if ''#t'' the menu item will appear at the far right if added 8086 to a menu bar. 8087 8088 -- Function: gtk-menu-item-set-submenu (self '<gtk-menu-item>') 8089 (submenu '<gtk-widget>') 8090 -- Method: set-submenu 8091 Sets the widget submenu, or changes it. 8092 8093 MENU-ITEM 8094 the menu item widget 8095 8096 SUBMENU 8097 the submenu 8098 8099 -- Function: gtk-menu-item-set-accel-path (self '<gtk-menu-item>') 8100 (accel_path 'mchars') 8101 -- Method: set-accel-path 8102 Set the accelerator path on MENU-ITEM, through which runtime 8103 changes of the menu item's accelerator caused by the user can be 8104 identified and saved to persistant storage (see 8105 'gtk-accel-map-save' on this). To setup a default accelerator for 8106 this menu item, call 'gtk-accel-map-add-entry' with the same 8107 ACCEL-PATH. See also 'gtk-accel-map-add-entry' on the specifics of 8108 accelerator paths, and 'gtk-menu-set-accel-path' for a more 8109 convenient variant of this function. 8110 8111 This function is basically a convenience wrapper that handles 8112 calling 'gtk-widget-set-accel-path' with the appropriate 8113 accelerator group for the menu item. 8114 8115 Note that you do need to set an accelerator on the parent menu with 8116 'gtk-menu-set-accel-group' for this to work. 8117 8118 MENU-ITEM 8119 a valid '<gtk-menu-item>' 8120 8121 ACCEL-PATH 8122 accelerator path, corresponding to this menu item's 8123 functionality, or ''#f'' to unset the current path. 8124 8125 -- Function: gtk-menu-item-remove-submenu (self '<gtk-menu-item>') 8126 -- Method: remove-submenu 8127 Removes the widget's submenu. 8128 8129 MENU-ITEM 8130 the menu item widget 8131 8132 -- Function: gtk-menu-item-select (self '<gtk-menu-item>') 8133 -- Method: select 8134 Emits the "select" signal on the given item. Behaves exactly like 8135 '<gtk-item-select>'. 8136 8137 MENU-ITEM 8138 the menu item 8139 8140 -- Function: gtk-menu-item-deselect (self '<gtk-menu-item>') 8141 -- Method: deselect 8142 Emits the "deselect" signal on the given item. Behaves exactly 8143 like '<gtk-item-deselect>'. 8144 8145 MENU-ITEM 8146 the menu item 8147 8148 -- Function: gtk-menu-item-activate (self '<gtk-menu-item>') 8149 -- Method: activate 8150 Emits the "activate" signal on the given item 8151 8152 MENU-ITEM 8153 the menu item 8154 8155 -- Function: gtk-menu-item-toggle-size-request (self '<gtk-menu-item>') 8156 => (requisition 'int') 8157 -- Method: toggle-size-request 8158 Emits the "toggle_size_request" signal on the given item. 8159 8160 MENU-ITEM 8161 the menu item 8162 8163 REQUISITION 8164 the requisition to use as signal data. 8165 8166 -- Function: gtk-menu-item-toggle-size-allocate 8167 (self '<gtk-menu-item>') (allocation 'int') 8168 -- Method: toggle-size-allocate 8169 Emits the "toggle_size_allocate" signal on the given item. 8170 8171 MENU-ITEM 8172 the menu item. 8173 8174 ALLOCATION 8175 the allocation to use as signal data. 8176 8177 -- Function: gtk-menu-item-get-right-justified (self '<gtk-menu-item>') 8178 => (ret 'bool') 8179 -- Method: get-right-justified 8180 Gets whether the menu item appears justified at the right side of 8181 the menu bar. 8182 8183 MENU-ITEM 8184 a '<gtk-menu-item>' 8185 8186 RET 8187 ''#t'' if the menu item will appear at the far right if added 8188 to a menu bar. 8189 8190 -- Function: gtk-menu-item-get-submenu (self '<gtk-menu-item>') => 8191 (ret '<gtk-widget>') 8192 -- Method: get-submenu 8193 Gets the submenu underneath this menu item, if any. See 8194 'gtk-menu-item-set-submenu'. 8195 8196 MENU-ITEM 8197 a '<gtk-menu-item>' 8198 8199 RET 8200 submenu for this menu item, or ''#f'' if none. 8201 8202 8203File: guile-gnome-gtk.info, Node: GtkMenuShell, Next: GtkImageMenuItem, Prev: GtkMenuItem, Up: Top 8204 820559 GtkMenuShell 8206*************** 8207 8208A base class for menu objects 8209 821059.1 Overview 8211============= 8212 8213A '<gtk-menu-shell>' is the abstract base class used to derive the 8214'<gtk-menu>' and '<gtk-menu-bar>' subclasses. 8215 8216 A '<gtk-menu-shell>' is a container of '<gtk-menu-item>' objects 8217arranged in a list which can be navigated, selected, and activated by 8218the user to perform application functions. A '<gtk-menu-item>' can have 8219a submenu associated with it, allowing for nested hierarchical menus. 8220 822159.2 Usage 8222========== 8223 8224 -- Class: <gtk-menu-shell> 8225 Derives from '<gtk-container>'. 8226 8227 This class defines the following slots: 8228 8229 'take-focus' 8230 A boolean that determines whether the menu grabs the keyboard 8231 focus 8232 8233 -- Signal on <gtk-menu-shell>: deactivate 8234 This signal is emitted when a menu shell is deactivated. 8235 8236 -- Signal on <gtk-menu-shell>: selection-done 8237 This signal is emitted when a selection has been completed within a 8238 menu shell. 8239 8240 -- Signal on <gtk-menu-shell>: move-current 8241 (arg0 '<gtk-menu-direction-type>') 8242 An action signal which moves the current menu item in the direction 8243 specified by DIRECTION. 8244 8245 -- Signal on <gtk-menu-shell>: activate-current (arg0 '<gboolean>') 8246 An action signal that activates the current menu item within the 8247 menu shell. 8248 8249 -- Signal on <gtk-menu-shell>: cancel 8250 An action signal which cancels the selection within the menu shell. 8251 Causes the GtkMenuShell::selection-done signal to be emitted. 8252 8253 -- Signal on <gtk-menu-shell>: cycle-focus 8254 (arg0 '<gtk-direction-type>') 8255 8256 -- Signal on <gtk-menu-shell>: move-selected (arg0 '<gint>') 8257 => '<gboolean>' 8258 undocumented 8259 8260 -- Function: gtk-menu-shell-append (self '<gtk-menu-shell>') 8261 (child '<gtk-widget>') 8262 -- Method: append 8263 Adds a new '<gtk-menu-item>' to the end of the menu shell's item 8264 list. 8265 8266 MENU-SHELL 8267 a '<gtk-menu-shell>'. 8268 8269 CHILD 8270 The '<gtk-menu-item>' to add. 8271 8272 -- Function: gtk-menu-shell-prepend (self '<gtk-menu-shell>') 8273 (child '<gtk-widget>') 8274 -- Method: prepend 8275 Adds a new '<gtk-menu-item>' to the beginning of the menu shell's 8276 item list. 8277 8278 MENU-SHELL 8279 a '<gtk-menu-shell>'. 8280 8281 CHILD 8282 The '<gtk-menu-item>' to add. 8283 8284 -- Function: gtk-menu-shell-insert (self '<gtk-menu-shell>') 8285 (child '<gtk-widget>') (position 'int') 8286 -- Method: insert 8287 Adds a new '<gtk-menu-item>' to the menu shell's item list at the 8288 position indicated by POSITION. 8289 8290 MENU-SHELL 8291 a '<gtk-menu-shell>'. 8292 8293 CHILD 8294 The '<gtk-menu-item>' to add. 8295 8296 POSITION 8297 The position in the item list where CHILD is added. Positions 8298 are numbered from 0 to n-1. 8299 8300 -- Function: gtk-menu-shell-deactivate (self '<gtk-menu-shell>') 8301 -- Method: deactivate 8302 Deactivates the menu shell. Typically this results in the menu 8303 shell being erased from the screen. 8304 8305 MENU-SHELL 8306 a '<gtk-menu-shell>'. 8307 8308 -- Function: gtk-menu-shell-select-item (self '<gtk-menu-shell>') 8309 (menu_item '<gtk-widget>') 8310 -- Method: select-item 8311 Selects the menu item from the menu shell. 8312 8313 MENU-SHELL 8314 a '<gtk-menu-shell>'. 8315 8316 MENU-ITEM 8317 The '<gtk-menu-item>' to select. 8318 8319 -- Function: gtk-menu-shell-select-first (self '<gtk-menu-shell>') 8320 (search_sensitive 'bool') 8321 -- Method: select-first 8322 Select the first visible or selectable child of the menu shell; 8323 don't select tearoff items unless the only item is a tearoff item. 8324 8325 MENU-SHELL 8326 a '<gtk-menu-shell>' 8327 8328 SEARCH-SENSITIVE 8329 if ''#t'', search for the first selectable menu item, 8330 otherwise select nothing if the first item isn't sensitive. 8331 This should be ''#f'' if the menu is being popped up 8332 initially. 8333 8334 Since 2.2 8335 8336 -- Function: gtk-menu-shell-deselect (self '<gtk-menu-shell>') 8337 -- Method: deselect 8338 Deselects the currently selected item from the menu shell, if any. 8339 8340 MENU-SHELL 8341 a '<gtk-menu-shell>'. 8342 8343 -- Function: gtk-menu-shell-activate-item (self '<gtk-menu-shell>') 8344 (menu_item '<gtk-widget>') (force_deactivate 'bool') 8345 -- Method: activate-item 8346 Activates the menu item within the menu shell. 8347 8348 MENU-SHELL 8349 a '<gtk-menu-shell>'. 8350 8351 MENU-ITEM 8352 The '<gtk-menu-item>' to activate. 8353 8354 FORCE-DEACTIVATE 8355 If TRUE, force the deactivation of the menu shell after the 8356 menu item is activated. 8357 8358 -- Function: gtk-menu-shell-cancel (self '<gtk-menu-shell>') 8359 -- Method: cancel 8360 Cancels the selection within the menu shell. 8361 8362 MENU-SHELL 8363 a '<gtk-menu-shell>' 8364 8365 Since 2.4 8366 8367 -- Function: gtk-menu-shell-set-take-focus (self '<gtk-menu-shell>') 8368 (take_focus 'bool') 8369 -- Method: set-take-focus 8370 If TAKE-FOCUS is ''#t'' (the default) the menu shell will take the 8371 keyboard focus so that it will receive all keyboard events which is 8372 needed to enable keyboard navigation in menus. 8373 8374 Setting TAKE-FOCUS to ''#f'' is useful only for special 8375 applications like virtual keyboard implementations which should not 8376 take keyboard focus. 8377 8378 The TAKE-FOCUS state of a menu or menu bar is automatically 8379 propagated to submenus whenever a submenu is popped up, so you 8380 don't have to worry about recursively setting it for your entire 8381 menu hierarchy. Only when programmatically picking a submenu and 8382 popping it up manually, the TAKE-FOCUS property of the submenu 8383 needs to be set explicitely. 8384 8385 Note that setting it to ''#f'' has side-effects: 8386 8387 If the focus is in some other app, it keeps the focus and keynav in 8388 the menu doesn't work. Consequently, keynav on the menu will only 8389 work if the focus is on some toplevel owned by the onscreen 8390 keyboard. 8391 8392 To avoid confusing the user, menus with TAKE-FOCUS set to ''#f'' 8393 should not display mnemonics or accelerators, since it cannot be 8394 guaranteed that they will work. 8395 8396 See also 'gdk-keyboard-grab' 8397 8398 MENU-SHELL 8399 a '<gtk-menu-shell>' 8400 8401 TAKE-FOCUS 8402 ''#t'' if the menu shell should take the keyboard focus on 8403 popup. 8404 8405 Since 2.8 8406 8407 -- Function: gtk-menu-shell-get-take-focus (self '<gtk-menu-shell>') 8408 => (ret 'bool') 8409 -- Method: get-take-focus 8410 Returns ''#t'' if the menu shell will take the keyboard focus on 8411 popup. 8412 8413 MENU-SHELL 8414 a '<gtk-menu-shell>' 8415 8416 RET 8417 ''#t'' if the menu shell will take the keyboard focus on 8418 popup. 8419 8420 Since 2.8 8421 8422 8423File: guile-gnome-gtk.info, Node: GtkImageMenuItem, Next: GtkRadioMenuItem, Prev: GtkMenuShell, Up: Top 8424 842560 GtkImageMenuItem 8426******************* 8427 8428A menu item with an icon 8429 843060.1 Overview 8431============= 8432 8433A GtkImageMenuItem is a menu item which has an icon next to the text 8434label. 8435 8436 Note that the user can disable display of menu icons, so make sure to 8437still fill in the text label. 8438 843960.2 Usage 8440========== 8441 8442 -- Class: <gtk-image-menu-item> 8443 Derives from '<gtk-menu-item>'. 8444 8445 This class defines the following slots: 8446 8447 'image' 8448 Child widget to appear next to the menu text 8449 8450 -- Function: gtk-image-menu-item-set-image 8451 (self '<gtk-image-menu-item>') (image '<gtk-widget>') 8452 -- Method: set-image 8453 Sets the image of IMAGE-MENU-ITEM to the given widget. Note that 8454 it depends on the show-menu-images setting whether the image will 8455 be displayed or not. 8456 8457 IMAGE-MENU-ITEM 8458 a '<gtk-image-menu-item>'. 8459 8460 IMAGE 8461 a widget to set as the image for the menu item. 8462 8463 -- Function: gtk-image-menu-item-get-image 8464 (self '<gtk-image-menu-item>') => (ret '<gtk-widget>') 8465 -- Method: get-image 8466 Gets the widget that is currently set as the image of 8467 IMAGE-MENU-ITEM. See 'gtk-image-menu-item-set-image'. 8468 8469 IMAGE-MENU-ITEM 8470 a '<gtk-image-menu-item>'. 8471 8472 RET 8473 the widget set as image of IMAGE-MENU-ITEM. 8474 8475 -- Function: gtk-image-menu-item-new => (ret '<gtk-widget>') 8476 Creates a new '<gtk-image-menu-item>' with an empty label. 8477 8478 RET 8479 a new '<gtk-image-menu-item>'. 8480 8481 -- Function: gtk-image-menu-item-new-from-stock (stock_id 'mchars') 8482 (accel_group '<gtk-accel-group>') => (ret '<gtk-widget>') 8483 Creates a new '<gtk-image-menu-item>' containing the image and text 8484 from a stock item. Some stock ids have preprocessor macros like 8485 '<gtk-stock-ok>' and '<gtk-stock-apply>'. 8486 8487 If you want this menu item to have changeable accelerators, then 8488 pass in ''#f'' for accel_group. Next call 8489 'gtk-menu-item-set-accel-path' with an appropriate path for the 8490 menu item, use 'gtk-stock-lookup' to look up the standard 8491 accelerator for the stock item, and if one is found, call 8492 'gtk-accel-map-add-entry' to register it. 8493 8494 STOCK-ID 8495 the name of the stock item. 8496 8497 ACCEL-GROUP 8498 the '<gtk-accel-group>' to add the menu items accelerator to, 8499 or ''#f''. 8500 8501 RET 8502 a new '<gtk-image-menu-item>'. 8503 8504 -- Function: gtk-image-menu-item-new-with-label (label 'mchars') => 8505 (ret '<gtk-widget>') 8506 Creates a new '<gtk-image-menu-item>' containing a label. 8507 8508 LABEL 8509 the text of the menu item. 8510 8511 RET 8512 a new '<gtk-image-menu-item>'. 8513 8514 8515File: guile-gnome-gtk.info, Node: GtkRadioMenuItem, Next: GtkCheckMenuItem, Prev: GtkImageMenuItem, Up: Top 8516 851761 GtkRadioMenuItem 8518******************* 8519 8520A choice from multiple check menu items 8521 852261.1 Overview 8523============= 8524 8525A radio menu item is a check menu item that belongs to a group. At each 8526instant exactly one of the radio menu items from a group is selected. 8527 8528 The group list does not need to be freed, as each 8529'<gtk-radio-menu-item>' will remove itself and its list item when it is 8530destroyed. 8531 8532 The correct way to create a group of radio menu items is 8533approximatively this: 8534 8535 8536 GSList *group = NULL; 8537 GtkWidget *item; 8538 gint i; 8539 8540 for (i = 0; i < 5; i++) 8541 { 8542 item = gtk_radio_menu_item_new_with_label (group, "This is an example"); 8543 group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item)); 8544 if (i == 1) 8545 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); 8546 } 8547 854861.2 Usage 8549========== 8550 8551 -- Class: <gtk-radio-menu-item> 8552 Derives from '<gtk-check-menu-item>'. 8553 8554 This class defines the following slots: 8555 8556 'group' 8557 The radio menu item whose group this widget belongs to. 8558 8559 -- Signal on <gtk-radio-menu-item>: group-changed 8560 8561 -- Function: gtk-radio-menu-item-new (group '<gtk-radio-group*>') => 8562 (ret '<gtk-widget>') 8563 Creates a new '<gtk-radio-menu-item>'. 8564 8565 GROUP 8566 the group to which the radio menu item is to be attached 8567 8568 RET 8569 a new '<gtk-radio-menu-item>' 8570 8571 -- Function: gtk-radio-menu-item-new-with-label 8572 (group '<gtk-radio-group*>') (label 'mchars') => 8573 (ret '<gtk-widget>') 8574 Creates a new '<gtk-radio-menu-item>' whose child is a simple 8575 '<gtk-label>'. 8576 8577 GROUP 8578 the group to which the radio menu item is to be attached 8579 8580 LABEL 8581 the text for the label 8582 8583 RET 8584 a new '<gtk-radio-menu-item>' 8585 8586 -- Function: gtk-radio-menu-item-new-from-widget 8587 (group '<gtk-radio-menu-item>') => (ret '<gtk-widget>') 8588 Creates a new '<gtk-radio-menu-item>' adding it to the same group 8589 as GROUP. 8590 8591 GROUP 8592 An existing '<gtk-radio-menu-item>' 8593 8594 RET 8595 The new '<gtk-radio-menu-item>' 8596 8597 Since 2.4 8598 8599 -- Function: gtk-radio-menu-item-set-group 8600 (self '<gtk-radio-menu-item>') (group '<gtk-radio-group*>') 8601 -- Method: set-group 8602 Sets the group of a radio menu item, or changes it. 8603 8604 RADIO-MENU-ITEM 8605 a '<gtk-radio-menu-item>'. 8606 8607 GROUP 8608 the new group. 8609 8610 -- Function: gtk-radio-menu-item-get-group 8611 (self '<gtk-radio-menu-item>') => (ret '<gtk-radio-group*>') 8612 -- Method: get-group 8613 Returns the group to which the radio menu item belongs, as a 8614 '<g-list>' of '<gtk-radio-menu-item>'. The list belongs to GTK+ 8615 and should not be freed. 8616 8617 RADIO-MENU-ITEM 8618 a '<gtk-radio-menu-item>'. 8619 8620 RET 8621 the group of RADIO-MENU-ITEM. 8622 8623 8624File: guile-gnome-gtk.info, Node: GtkCheckMenuItem, Next: GtkSeparatorMenuItem, Prev: GtkRadioMenuItem, Up: Top 8625 862662 GtkCheckMenuItem 8627******************* 8628 8629A menu item with a check box 8630 863162.1 Overview 8632============= 8633 8634A '<gtk-check-menu-item>' is a menu item that maintains the state of a 8635boolean value in addition to a '<gtk-menu-item>''s usual role in 8636activating application code. 8637 8638 A check box indicating the state of the boolean value is displayed at 8639the left side of the '<gtk-menu-item>'. Activating the 8640'<gtk-menu-item>' toggles the value. 8641 864262.2 Usage 8643========== 8644 8645 -- Class: <gtk-check-menu-item> 8646 Derives from '<gtk-menu-item>'. 8647 8648 This class defines the following slots: 8649 8650 'active' 8651 Whether the menu item is checked 8652 8653 'inconsistent' 8654 Whether to display an "inconsistent" state 8655 8656 'draw-as-radio' 8657 Whether the menu item looks like a radio menu item 8658 8659 -- Signal on <gtk-check-menu-item>: toggled 8660 This signal is emitted when the state of the check box is changed. 8661 8662 A signal handler can examine the '<gtk-check-menu-item>' struct to 8663 discover the new state. 8664 8665 -- Function: gtk-check-menu-item-new => (ret '<gtk-widget>') 8666 Creates a new '<gtk-check-menu-item>'. 8667 8668 RET 8669 a new '<gtk-check-menu-item>'. 8670 8671 -- Function: gtk-check-menu-item-new-with-label (label 'mchars') => 8672 (ret '<gtk-widget>') 8673 Creates a new '<gtk-check-menu-item>' with a label. 8674 8675 LABEL 8676 the string to use for the label. 8677 8678 RET 8679 a new '<gtk-check-menu-item>'. 8680 8681 -- Function: gtk-check-menu-item-get-active 8682 (self '<gtk-check-menu-item>') => (ret 'bool') 8683 -- Method: get-active 8684 Returns whether the check menu item is active. See 8685 'gtk-check-menu-item-set-active'. 8686 8687 CHECK-MENU-ITEM 8688 a '<gtk-check-menu-item>' 8689 8690 RET 8691 ''#t'' if the menu item is checked. 8692 8693 -- Function: gtk-check-menu-item-set-active 8694 (self '<gtk-check-menu-item>') (is_active 'bool') 8695 -- Method: set-active 8696 Sets the active state of the menu item's check box. 8697 8698 CHECK-MENU-ITEM 8699 a '<gtk-check-menu-item>'. 8700 8701 IS-ACTIVE 8702 boolean value indicating whether the check box is active. 8703 8704 -- Function: gtk-check-menu-item-toggled (self '<gtk-check-menu-item>') 8705 -- Method: toggled 8706 Emits the GtkCheckMenuItem::toggled signal. 8707 8708 CHECK-MENU-ITEM 8709 a '<gtk-check-menu-item>'. 8710 8711 8712File: guile-gnome-gtk.info, Node: GtkSeparatorMenuItem, Next: GtkTearoffMenuItem, Prev: GtkCheckMenuItem, Up: Top 8713 871463 GtkSeparatorMenuItem 8715*********************** 8716 8717A separator used in menus 8718 871963.1 Overview 8720============= 8721 8722The '<gtk-separator-menu-item>' is a separator used to group items 8723within a menu. It displays a horizontal line with a shadow to make it 8724appear sunken into the interface. 8725 872663.2 Usage 8727========== 8728 8729 -- Class: <gtk-separator-menu-item> 8730 Derives from '<gtk-menu-item>'. 8731 8732 This class defines no direct slots. 8733 8734 -- Function: gtk-separator-menu-item-new => (ret '<gtk-widget>') 8735 Creates a new '<gtk-separator-menu-item>'. 8736 8737 RET 8738 a new '<gtk-separator-menu-item>'. 8739 8740 8741File: guile-gnome-gtk.info, Node: GtkTearoffMenuItem, Next: GtkToolbar, Prev: GtkSeparatorMenuItem, Up: Top 8742 874364 GtkTearoffMenuItem 8744********************* 8745 8746A menu item used to tear off and reattach its menu 8747 874864.1 Overview 8749============= 8750 8751A '<gtk-tearoff-menu-item>' is a special '<gtk-menu-item>' which is used 8752to tear off and reattach its menu. 8753 8754 When its menu is shown normally, the '<gtk-tearoff-menu-item>' is 8755drawn as a dotted line indicating that the menu can be torn off. 8756Activating it causes its menu to be torn off and displayed in its own 8757window as a tearoff menu. 8758 8759 When its menu is shown as a tearoff menu, the 8760'<gtk-tearoff-menu-item>' is drawn as a dotted line which has a left 8761pointing arrow graphic indicating that the tearoff menu can be 8762reattached. Activating it will erase the tearoff menu window. 8763 876464.2 Usage 8765========== 8766 8767 -- Class: <gtk-tearoff-menu-item> 8768 Derives from '<gtk-menu-item>'. 8769 8770 This class defines no direct slots. 8771 8772 -- Function: gtk-tearoff-menu-item-new => (ret '<gtk-widget>') 8773 Creates a new '<gtk-tearoff-menu-item>'. 8774 8775 RET 8776 a new '<gtk-tearoff-menu-item>'. 8777 8778