[ruby-gnome2-doc-cvs] [Hiki] update - Gtk::TextView

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2003年 8月 25日 (月) 10:42:22 JST


-------------------------
REMOTE_ADDR = 61.204.181.66
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/?Gtk%3A%3ATextView
-------------------------
  = class Gtk::TextView
  Widget that displays a Gtk::TextBuffer.
  
- == Super Class
- * Gtk::Container
+ == Object Hierarchy
+ * Object
+   * GLib::Instantiatable
+     * GLib::Object
+       * Gtk::Object
+         * Gtk::Widget
+           * Gtk::Container
+             * Gtk::TextView
  
  == Class Methods
  --- Gtk::TextView.new(buffer = nil)
      Creates a new Gtk::TextView widget displaying the buffer. One buffer can be shared among many widgets. buffer may be nil to create a default buffer.
      * buffer: a Gtk::TextBuffer 
      * Returns: a new Gtk::TextView
  
  == Instance Methods
  --- buffer
      Returns the Gtk::TextBuffer being displayed by the Gtk::TextView.
      * Returns: a Gtk::TextBuffer 
  --- buffer=(buffer)
      Sets buffer as the buffer being displayed by the Gtk::TextView. 
      * buffer: a Gtk::TextBuffer 
      * Returns: buffer
  --- set_buffer(buffer)
      Same as buffer=.
      * buffer: a Gtk::TextBuffer 
      * Returns: self
  
  --- scroll_to_mark(mark, within_margin, use_align, xalign, yalign)
      Scrolls the Gtk::TextView so that mark is on the screen in the position indicated by xalign and yalign. An alignment of 0.0 indicates left or top, 1.0 indicates right or bottom, 0.5 means center. If use_align is false, the text scrolls the minimal distance to get the mark onscreen, possibly not scrolling at all. The effective screen for purposes of this method is reduced by a margin of size within_margin.
      * mark: a Gtk::TextMark 
      * within_margin: margin as a 0.0, 0.5 fraction of screen size 
      * use_align: whether to use alignment arguments (if false, just get the mark onscreen) 
      * xalign: horizontal alignment of mark within visible area. 
      * yalign: vertical alignment of mark within visible area 
      * Returns: self
  
  --- scroll_to_iter(iter, within_margin, xalign, yalign)
      Scrolls the Gtk::TextView so that iter is on the screen in the position indicated by xalign and yalign. An alignment of 0.0 indicates left or top, 1.0 indicates right or bottom, 0.5 means center. If use_align is faose, the text scrolls the minimal distance to get the mark onscreen, possibly not scrolling at all. The effective screen for purposes of this method is reduced by a margin of size within_margin. NOTE: This method uses the currently-computed height of the lines in the text buffer. Note that line heights are computed in an idle handler; so this method may not have the desired effect if it's called before the height computations. To avoid oddness, consider using Gtk::TextView#scroll_to_mark which saves a point to be scrolled to after line validation.
      * iter: a Gtk::TextIter 
      * within_margin: margin as a 0.0, 0.5 fraction of screen size 
      * use_align: whether to use alignment arguments (if false, just get the mark onscreen) 
      * xalign: horizontal alignment of mark within visible area. 
      * yalign: vertical alignment of mark within visible area 
      * Returns: true if scrolling occurred 
  
  --- scroll_mark_onscreen(mark)
      Scrolls the Gtk::TextView the minimum distance such that mark is contained within the visible area of the widget.
      * mark: a mark in the buffer for the Gtk::TextView
      * Returns: self
  
  --- move_mark_onscreen
      Moves a mark within the buffer so that it's located within the currently-visible text area.
      * mark: a Gtk::TextMark 
      * Returns: true if the mark moved (wasn't already onscreen) 
  
  --- place_cursor_onscreen
      Moves the cursor to the currently visible region of the buffer, if it isn't there already.
      * Returns: true if the cursor had to be moved. 
  
  --- visible_rect
      Returns the currently-visible region of the buffer, in buffer coordinates. Convert to window coordinates with Gtk::TextView#buffer_to_window_coords.
      * Returns: Gdk::Rectangle
  
  --- get_iter_location(iter)
      Gets a Gdk::Rectangle which roughly contains the character at iter. The Gdk::Rectangle position is in buffer coordinates; use Gtk::TextView#buffer_to_window_coords to convert these coordinates to coordinates for one of the windows in the text view.
      * iter : a GtkTextIter 
      * Returns: a Gdk::Rectangle which is the bounds of the character at iter 
  
  --- get_line_at_y(y)
      Gets the Gtk::TextIter at the start of the line containing the coordinate y. y is in buffer coordinates, convert from window coordinates with Gtk::TextView#window_to_buffer_coords. If non-nil, line_top will be the coordinate of the top edge of the line.
      * y : a y coordinate 
      * Returns [target_iter, line_top]
         * target_iter : a Gtk::TextIter 
         * line_top: top coordinate of the line 
  
  --- get_line_yrange(iter)
      Gets the y coordinate of the top of the line containing iter, and the height of the line. The coordinate is a buffer coordinate; convert to window coordinates with Gtk::TextView#buffer_to_window_coords.
      * iter : a GtkTextIter 
      * Returns: [y, height]
         * y: a y coordinate 
         * height: a height 
  
  --- get_iter_at_location(x, y)
      Retrieves the iterator at buffer coordinates x and y. Buffer coordinates are coordinates for the entire buffer, not just the currently-displayed portion. If you have coordinates from an event, you have to convert those to buffer coordinates with Gtk::TextView#window_to_buffer_coords.
      * x: x position, in buffer coordinates 
      * y: y position, in buffer coordinates 
      * Returns: a Gtk::TextIter 
  
  --- buffer_to_window_coords(win_type, buffer_x, buffer_y)
      Converts coordinate (buffer_x, buffer_y) to coordinates for the window win, and stores the result in (window_x, window_y).
      Note that you can't convert coordinates for a nonexisting window (see Gtk::TextView#set_border_window_size).
      * win_type: a ((<GtkTextWindowType|Gtk::TextView#GtkTextWindowType>)) except Gtk::TextView::WINDOW_PRIVATE 
      * buffer_x: buffer x coordinate 
      * buffer_y: buffer y coordinate 
      * Returns: [window_x, window_y]
         * window_x: window x coordinate
         * window_y: window y coordinate
  
  --- window_to_buffer_coords(win_type, buffer_x, buffer_y)
      Converts coordinates on the window identified by win to buffer coordinates, storing the result in (buffer_x,buffer_y).
      Note that you can't convert coordinates for a nonexisting window (see Gtk::TextView#set_border_window_size).
      * win_type : a ((<GtkTextWindowType|Gtk::TextView#GtkTextWindowType>)) except Gtk::TextView::WINDOW_PRIVATE
      * window_x: window x coordinate 
      * window_y: window y coordinate 
      * Returns: [window_x, window_y]
         * buffer_x: buffer x coordinate
         * buffer_y: buffer y coordinate
  
  --- get_window(win_type)
      Retrieves the Gdk::Window corresponding to an area of the text view; possible windows include the overall widget window, child windows on the left, right, top, bottom, and the window that displays the text buffer. Windows are nil and nonexistent if their width or height is 0, and are nonexistent before the widget has been realized.
      * win_type: a ((<GtkTextWindowType|Gtk::TextView#GtkTextWindowType>)) to get 
      * Returns: a Gdk::Window, or nil 
  
  --- get_window_type(window)
      Usually used to find out which window an event corresponds to. If you connect to an event signal on Gtk::TextView, this method should be called on event.window to see which window it was.
      * window: a window type 
      * Returns: the ((<GtkTextWindowType|Gtk::TextView#GtkTextWindowType>)) 
  
  --- get_border_window_size(type)
      Gets the width of the specified border window. See Gtk::TextView#set_border_window_size.
      * type: window to return size from 
      * Returns: width of window 
  
  --- set_border_window_size(type, size)
      Sets the width of Gtk::TextView::WINDOW_LEFT or Gtk::TextView::WINDOW_RIGHT, or the height of Gtk::TextView::WINDOW_TOP or Gtk::TextView::WINDOW_BOTTOM. Automatically destroys the corresponding window if the size is set to 0, and creates the window if the size is set to non-zero. This method can only be used for the "border windows," it doesn't work with Gtk::TextView::WINDOW_WIDGET, Gtk::TextView::WINDOW_TEXT, or Gtk::TextView::WINDOW_PRIVATE.
      * type: ((<GtkTextWindowType|Gtk::TextView#GtkTextWindowType>)) to affect 
      * size: width or height of the window 
      * Returns: self
  
  --- forward_display_line(iter)
      Moves the given iter forward by one display (wrapped) line. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view's width; paragraphs are the same in all views, since they depend on the contents of the Gtk::TextBuffer.
      * iter: a Gtk::TextIter 
      * Returns: true if iter was moved and is not on the end iterator 
  
  --- backward_display_line(iter)
      Moves the given iter backward by one display (wrapped) line. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view's width; paragraphs are the same in all views, since they depend on the contents of the Gtk::TextBuffer.
      * iter: a Gtk::TextIter 
      * Returns: true if iter was moved and is not on the end iterator 
  
  --- forward_display_line_end(iter)
      Moves the given iter forward to the next display line end. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view's width; paragraphs are the same in all views, since they depend on the contents of the Gtk::TextBuffer.
      * iter: a Gtk::TextIter 
      * Returns: true if iter was moved and is not on the end iterator 
  
  --- backward_display_line_start(iter)
      Moves the given iter backward to the next display line start. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view's width; paragraphs are the same in all views, since they depend on the contents of the Gtk::TextBuffer.
      * iter: a Gtk::TextIter 
      * Returns: true if iter was moved and is not on the end iterator 
  
  --- starts_display_line(iter)
      Determines whether iter is at the start of a display line. See Gtk::TextView#forward_display_line for an explanation of display lines vs. paragraphs.
      * iter: a Gtk::TextIter 
      * Returns: true if iter begins a wrapped line 
  
  --- move_visually(iter, count)
      Moves iter up or down by count display (wrapped) lines. See Gtk::TextView#forward_display_line for an explanation of display lines vs. paragraphs.
      * iter: a Gtk::TextIter 
      * count: number of lines to move 
      * Returns: true if iter moved and is not on the end iterator 
  
  --- add_child_at_anchor(child)
      Adds a child widget in the text buffer, at the given anchor.
      * child: a Gtk::Widget 
      * anchor: a Gtk::TextChildAnchor in the Gtk::TextBuffer for the Gtk::TextView 
      * Returns: self
  
  --- add_child_in_window(child, which_window, xpos, ypos)
      Adds a child at fixed coordinates in one of the text widget's windows. The window must have nonzero size (see Gtk::TextView#set_border_window_size). Note that the child coordinates are given relative to the Gdk::Window in question, and that these coordinates have no sane relationship to scrolling. When placing a child in Gtk::TextView::WINDOW_WIDGET, scrolling is irrelevant, the child floats above all scrollable areas. But when placing a child in one of the scrollable windows (border windows or text window), you'll need to compute the child's correct position in buffer coordinates any time scrolling occurs or buffer changes occur, and then call Gtk::TextView#move_child to update the child's position. Unfortunately there's no good way to detect that scrolling has occurred, using the current API; a possible hack would be to update all child positions when the scroll adjustments change or the text buffer changes. See bug 64518 on bugzilla.gnome.org for status of fixing thi
 s issue.
      * child: a Gtk::Widget 
      * which_window: which window the child should appear in 
      * xpos: X position of child in window coordinates 
      * ypos: Y position of child in window coordinates 
      * Returns: self
  
  --- move_child(child, xpos, ypos)
      Updates the position of a child, as for Gtk::TextView#add_child_in_window.
      * child: child widget already added to the text view 
      * xpos: new X position in window coordinates 
      * ypos: new Y position in window coordinates 
      * Returns: self
  
  --- wrap_mode
      Gets the line wrapping for the view.
      * Returns: the line wrap setting 
  --- wrap_mode=(wrap_mode)
      Sets the line wrapping for the view.
      * wrap_mode : a GtkWrapMode 
      * Returns: wrap_mode
  --- set_wrap_mode(wrap_mode)
      Same as wrap_mode=.
      * wrap_mode : a GtkWrapMode 
      * Returns: self
  
  --- editable?
      Returns the default editability of the Gtk::TextView. Tags in the buffer may override this setting for some ranges of text.
      * Returns: whether text is editable by default 
  --- editable=(setting)
      Sets the default editability of the Gtk::TextView. You can override this default setting with tags in the buffer, using the "editable" attribute of tags.
      * setting: true if it's editable 
      * Returns: setting
  --- set_editable
      Same as editable=.
      * setting: true if it's editable 
      * Returns: self
  
  --- cursor_visible?
      Find out whether the cursor is being displayed.
      * Returns: true if the insertion mark is visible 
  --- cursor_visible=(setting)
      Toggles whether the insertion point is displayed. A buffer with no editable text probably shouldn't have a visible cursor, so you may want to turn the cursor off.
      * setting: true if to show the insertion cursor 
      * Returns: setting
  --- set_cursor_visible(setting)
      Same as cursor_visible=.
      * setting: true if to show the insertion cursor 
      * Returns: self
  
  --- pixels_above_lines
      Gets the default number of pixels to put above paragraphs.
      * Returns: default number of pixels above paragraphs 
  --- pixels_above_lines=(pixels_above_lines)
      Sets the default number of blank pixels above paragraphs in the Gtk::TextView. Tags in the buffer for the Gtk::TextView may override the defaults.
      * pixels_above_lines: pixels above paragraphs 
      * Returns: pixels_above_lines
  --- set_pixels_above_lines(pixels_above_lines)
      Same as pixels_above_lines=.
      * pixels_above_lines: pixels above paragraphs 
      * Returns: self
  
  --- pixels_below_lines
      Gets the value set by Gtk::TextView#pixels_below_lines=.
      * Returns: default number of blank pixels below paragraphs 
  --- pixels_below_lines=(pixels below paragraphs)
      Sets the default number of pixels of blank space to put below paragraphs in the Gtk::TextView. May be overridden by tags applied to the Gtk::TextView's buffer.
      * pixels_below_lines: pixels below paragraphs
      * Returns: pixels below paragraphs
  --- set_pixels_below_lines(pixels_below_lines)
      Same as pixels_below_lines=.
      * pixels_below_lines: pixels below paragraphs
      * Returns: self
  
  --- pixels_inside_wrap
      Gets the value set by Gtk::TextView#pixels_inside_wrap=.
      * Returns: default number of pixels of blank space between wrapped lines 
  --- pixels_inside_wrap=(pixels_inside_wrap)
      Sets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph. May be overridden by tags in the Gtk::TextView's buffer.
      * pixels_inside_wrap: default number of pixels between wrapped lines 
      * Returns: pixels_inside_wrap
  --- set_pixels_inside_wrap(pixels_inside_wrap)
      Same as pixels_inside_wrap=.
      * pixels_inside_wrap: default number of pixels between wrapped lines 
      * Returns: self
  
  --- justification
      Gets the default justification of paragraphs in the Gtk::TextView. Tags in the buffer may override the default.
      * Returns: default justification 
  --- justification=(justification)
      Sets the default justification of text in the Gtk::TextView. Tags in the view's buffer may override the default.
      * justification: justification 
      * Returns: justification
  --- set_justification(justification)
      Same as justification=.
      * justification: justification 
      * Returns: self
  
  --- left_margin
      Gets the default left margin size of paragraphs in the Gtk::TextView. Tags in the buffer may override the default.
      * Returns: left margin in pixels 
  --- left_margin=(left_margin)
      Sets the default left margin for text in the Gtk::TextView. Tags in the buffer may override the default.
      * left_margin: left margin in pixels 
      * Returns: left_margin
  --- set_left_margin(left_margin)
      Same as left_margin=.
      * left_margin: left margin in pixels 
      * Returns: self
  
  --- right_margin
      Gets the default right margin for text in the Gtk::TextView. Tags in the buffer may override the default.
      * Returns: right margin in pixels 
  --- right_margin=(right_margin)
      Sets the default right margin for text in the Gtk::TextView. Tags in the buffer may override the default.
      * right_margin: right margin in pixels 
      * Returns: right_margin
  --- set_right_margin(right_margin)
      Same as right_margin=.
      * right_margin: right margin in pixels 
      * Returns: self
  
  --- indent
      Gets the default indentation of paragraphs in the Gtk::TextView. Tags in the view's buffer may override the default. The indentation may be negative.
      * Returns: number of pixels of indentation 
  --- indent=(indent)
      Sets the default indentation for paragraphs in the Gtk::TextView. Tags in the buffer may override the default.
      * indent : indentation in pixels 
      * Returns: indent
  --- set_indent(indent)
      Same as indent=.
      * indent : indentation in pixels 
      * Returns: self
  
  --- tabs
      Gets the default tabs for text_view. Tags in the buffer may override the defaults. The returned array will be nil if "standard" (8-space) tabs are used.
      * Returns: copy of default tab array, or nil if "standard" tabs are used
  --- tabs=(tabs)
      Sets the default tab stops for paragraphs in the Gtk::TextView. Tags in the buffer may override the default.
      * tabs: tabs as a Pango::TabArray 
      * Returns: tabs
  --- set_tabs(tabs)
      Same as tabs=.
      * tabs: tabs as a Pango::TabArray 
      * Returns: self
  
  --- default_attributes
      Returns a copy of the default text attributes. These are the attributes used for text unless a tag overrides them. You'd typically pass the default attributes in to Gtk::TextIter#attributes in order to get the attributes in effect at a given text position.
      * Returns : a new Gtk::TextAttributes 
  
  == Constants
  === GtkTextWindowType
  --- WINDOW_PRIVATE
  --- WINDOW_WIDGET
  --- WINDOW_TEXT
  --- WINDOW_LEFT
  --- WINDOW_RIGHT
  --- WINDOW_TOP
  --- WINDOW_BOTTOM
  
  === Priority
  --- PRIORITY_VALIDATE
  The priority at which the text view validates onscreen lines in an idle job in the background(Gdk::PRIORITY_REDRAW + 5).
+ 
+ == Properties
+ --- cursor-visible: true or false (Read/Write)
+     If the insertion cursor is shown
+ 
+ --- editable: true or false (Read/Write)
+     Whether the text can be modified by the user
+ 
+ --- indent: Integer (Read/Write)
+     Amount to indent the paragraph, in pixels
+ 
+ --- justification: Integer (Read/Write)
+     Left, right, or center justification
+ 
+ --- left-margin: Integer (Read/Write)
+     Width of the left margin in pixels
+ 
+ --- pixels-above-lines: Integer (Read/Write)
+     Pixels of blank space above paragraphs
+ 
+ --- pixels-below-lines: Integer (Read/Write)
+     Pixels of blank space below paragraphs
+ 
+ --- pixels-inside-wrap: Integer (Read/Write)
+     Pixels of blank space between wrapped lines in a paragraph
+ 
+ --- right-margin: Integer (Read/Write)
+     Width of the right margin in pixels
+ 
+ --- tabs: Pango::TabArray (Read/Write)
+     Custom tabs for this text
+ 
+ --- wrap-mode: Integer (Read/Write)
+     Whether to wrap lines never, at word boundaries, or at character boundaries
  
  
  == Signals
  --- copy-clipboard: self
       * self: the Gtk::TextView
  --- cut-clipboard: self
       * self: the Gtk::TextView
  --- delete-from-cursor: self, type, arg2
       * self: the Gtk::TextView
       * type: ((<GtkDeleteType|Gtk#GtkDeleteType>))
       * arg2: Number
  --- insert-at-cursor: self, arg1
       * self: the Gtk::TextView
       * arg1: String
  --- move-cursor: self, step, arg2, arg3
       * self: the Gtk::TextView
       * step: ((<GtkMovementStep|Gtk#GtkMovementStep>))
       * arg2: Number
       * arg3: true or false
  --- move-focus: self, type
       * self: the Gtk::TextView
       * type: ((<GtkDirectionType|Gtk#GtkDirectionType>))
  --- page-horizontally: self, arg1, arg2
       * self: the Gtk::TextView
       * arg1: Number
       * arg2: true or false
  --- paste-clipboard: self
       * self: the Gtk::TextView
  --- populate-popup: self, menu
       * self: the Gtk::TextView
       * menu: Gtk::Menu
  --- set-anchor: self
       * self: the Gtk::TextView
  --- set-scroll-adjustments: self, adj1, adj2
       * self: the Gtk::TextView
       * adj1: Gtk::Adjustment
       * adj2: Gtk::Adjustment
  --- toggle-overwrite: self
       * self: the Gtk::TextView
  
  == See Also
  Gtk::TextBuffer, Gtk::TextIter
  
  - ((<Masao>))





ruby-gnome2-cvs メーリングリストの案内
Back to archive index