TextView Class Reference

Inheritance diagram for TextView:

Container List of all members.

Detailed Description

A container that knows how to display a TextBuffer.

See also:
TextBuffer


Public Member Functions

 this ()
 Creates a new TextView.

 this (TextBuffer textBuffer)
 Creates a new TextView with a textBuffer.

void setBuffer (TextBuffer textBuffer)
 Setst eh text buffer for this text view.

TextBuffer getBuffer ()
 Gets the text buffer of this text view.

bit scrollToIter (TextIter iter, gdouble within_margin, bit use_align, gdouble xalign, gdouble yalign)
 Scrolls text_view so that iter is on the screen in the position indicated by xalign and yalign.

void scrollToMark (TextMark mark, gdouble within_margin, bit use_align, gdouble xalign, gdouble yalign)
 Scroll to make mark visible.

void scrollMarkOnScreen (TextMark mark)
 Scrolls text_view the minimum distance such that mark is contained within the visible area of the widget.

bit moveMarkOnScreen (TextMark mark)
 Moves a mark within the buffer so that it's located within the currently-visible text area.

bit placeCursorOnScreen ()
 Moves the cursor to the currently visible region of the buffer, it it isn't there already.

void getVisibleRect (Rectangle *visible_rect)
 getVisibleRect

void setCursorVisible (bit setting)
 setCursorVisible

bit getCursorVisible ()
 getCursorVisible

void getIterLocation (TextIter iter, Rectangle *location)
 getIterLocation

void getIterAtLocation (TextIter iter, gint x, gint y)
 getIterAtLocation

void getLineYRange (TextIter *iter, gint *y, gint *height)
 getLineYRange

void getLineAt (TextIter target_iter, gint y, gint *line_top)
 getLineAt

void bufferToWindowCoords (TextWindowType win, gint buffer_x, gint buffer_y, gint *window_x, gint *window_y)
 bufferToWindowCoords

void windowToBufferCoords (TextWindowType win, gint window_x, gint window_y, gint *buffer_x, gint *buffer_y)
 windowToBufferCoords

WindowG getWindow (TextWindowType win)
 get window

TextWindowType getWindowType (WindowG windowG)
 get window type

void setBorderWindowSize (TextWindowType type, gint size)
 setBorderWindowSize

gint getBorderWindowSize (TextWindowType type)
 getBorderWindowSize

bit forwardDisplayLine (TextIter iter)
 Moves the given iter forward by one display (wrapped) line.

bit backwardDisplayLine (TextIter iter)
 Moves the given iter backward by one display (wrapped) line.

bit forwardDisplayLineEnd (TextIter iter)
 Moves the given iter forward to the next display line end.

bit backwardDisplayLineStart (TextIter iter)
 Moves the given iter backward to the next display line start.

bit startsDisplayLine (TextIter iter)
 Determines whether iter is at the start of a display line.

bit moveVisually (TextIter iter, gint count)
 moveVisually

void addChildAtAnchor (Widget child, TextChildAnchor anchor)
 adds a widget at the anchor

void addChildInWindow (Widget child, TextWindowType which_window, gint xpos, gint ypos)
 add child in window

void moveChild (Widget child, gint xpos, gint ypos)
 move child

void setWrapMode (WrapMode wrap_mode)
 Sets the line wrapping for the view.

WrapMode getWrapMode ()
 Gets the line wrapping for the view.

void setEditable (bit setting)
 Sets the default editability of this TextView.

bit getEditable ()
 Returns the default editability of this TextView.

void setPixelsAboveLines (int pixels_above_lines)
 Sets the default number of blank pixels above paragraphs in text_view.

gint getPixelsAboveLines ()
 Gets the default number of pixels to put above paragraphs.

void setPixelsBelowLines (int pixels_below_lines)
 Sets the default number of pixels of blank space to put below paragraphs in text_view.

gint getPixelsBelowLines ()
 Gets the number of pixels of blank space to put below paragraphs.

void setPixelsInsideWrap (int pixels_inside_wrap)
 Sets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph.

gint getPixelsInsideWrap ()
 Gets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph.

void setJustification (Justification justification)
 Sets the default justification of text in text_view.

Justification getJustification ()
 Gets the justification of text in text_view.

void setLeftMargin (int left_margin)
 Sets the default left margin for text in text_view.

gint getLeftMargin ()
 Gets the default left margin for text in text_view.

void setRightMargin (int right_margin)
 Sets the default right margin for text in the text view.

gint getRightMargin ()
 Gets the default right margin for text in the text view.

void setIndent (int indent)
 Sets the default indentation for paragraphs in text_view.

gint getIndent ()
 Gets the default indentation for paragraphs in text_view.

void setTabs (TabArray tabs)
 setTabs

TabArray getTabs ()
 Get tabs.

void appendText (char[] text)
 Simply appends some text to this view.

void appendText (char[] text, bit ensureVisible)
 Simply appends some text to this view.

void insertText (char[] text)
 Simply appends some on the cursor position.


Member Function Documentation

void TextView.addChildAtAnchor Widget  child,
TextChildAnchor  anchor
 

adds a widget at the anchor

Parameters:
child the widget to add
anchor 

void TextView.addChildInWindow Widget  child,
TextWindowType  which_window,
gint  xpos,
gint  ypos
 

add child in window

void TextView.appendText char[]  text,
bit  ensureVisible
 

Simply appends some text to this view.

Parameters:
text the text to append

void TextView.appendText char[]  text  ) 
 

Simply appends some text to this view.

Parameters:
text the text to append

bit TextView.backwardDisplayLine TextIter  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 GtkTextBuffer.

Returns:

bit TextView.backwardDisplayLineStart TextIter  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 GtkTextBuffer.

Returns:

void TextView.bufferToWindowCoords TextWindowType  win,
gint  buffer_x,
gint  buffer_y,
gint *  window_x,
gint *  window_y
 

bufferToWindowCoords

Parameters:
win 
buffer_x 
buffer_y 
window_x 
window_y 

bit TextView.forwardDisplayLine TextIter  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 GtkTextBuffer.

Returns:

bit TextView.forwardDisplayLineEnd TextIter  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 GtkTextBuffer.

Returns:

gint TextView.getBorderWindowSize TextWindowType  type  ) 
 

getBorderWindowSize

Parameters:
type 
Returns:

TextBuffer TextView.getBuffer  ) 
 

Gets the text buffer of this text view.

Returns:
the text buffer

bit TextView.getCursorVisible  ) 
 

getCursorVisible

Returns:

bit TextView.getEditable  ) 
 

Returns the default editability of this TextView.

Tags in the buffer may override this setting for some ranges of text.

Returns:
true if editable

gint TextView.getIndent  ) 
 

Gets the default indentation for paragraphs in text_view.

Returns:

void TextView.getIterAtLocation TextIter  iter,
gint  x,
gint  y
 

getIterAtLocation

Parameters:
iter 
x 
y 

void TextView.getIterLocation TextIter  iter,
Rectangle *  location
 

getIterLocation

Parameters:
iter 
location 

Justification TextView.getJustification  ) 
 

Gets the justification of text in text_view.

Returns:

gint TextView.getLeftMargin  ) 
 

Gets the default left margin for text in text_view.

Returns:

void TextView.getLineAt TextIter  target_iter,
gint  y,
gint *  line_top
 

getLineAt

Parameters:
target_iter 
y 
line_top 

void TextView.getLineYRange TextIter iter,
gint *  y,
gint *  height
 

getLineYRange

Parameters:
iter 
y 
height 

gint TextView.getPixelsAboveLines  ) 
 

Gets the default number of pixels to put above paragraphs.

Returns:
number of blank pixels above paragraphs in text_view.

gint TextView.getPixelsBelowLines  ) 
 

Gets the number of pixels of blank space to put below paragraphs.

Returns:

gint TextView.getPixelsInsideWrap  ) 
 

Gets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph.

Returns:

gint TextView.getRightMargin  ) 
 

Gets the default right margin for text in the text view.

Returns:

TabArray TextView.getTabs  ) 
 

Get tabs.

Returns:
a new TabArray wrapping the PatnTabArray

void TextView.getVisibleRect Rectangle *  visible_rect  ) 
 

getVisibleRect

Parameters:
visible_rect 

WindowG TextView.getWindow TextWindowType  win  ) 
 

get window

Parameters:
win the text window type
a new WindowG wrapping the gtkWindow

TextWindowType TextView.getWindowType WindowG  windowG  ) 
 

get window type

Parameters:
window 
Returns:
the text window type

WrapMode TextView.getWrapMode  ) 
 

Gets the line wrapping for the view.

Returns:
the line wrapping for the view.

void TextView.insertText char[]  text  ) 
 

Simply appends some on the cursor position.

Parameters:
text the text to append

void TextView.moveChild Widget  child,
gint  xpos,
gint  ypos
 

move child

bit TextView.moveMarkOnScreen TextMark  mark  ) 
 

Moves a mark within the buffer so that it's located within the currently-visible text area.

Parameters:
mark 
Returns:
true if the mark moved (wasn't already onscreen)

bit TextView.moveVisually TextIter  iter,
gint  count
 

moveVisually

Returns:

bit TextView.placeCursorOnScreen  ) 
 

Moves the cursor to the currently visible region of the buffer, it it isn't there already.

Returns:
true if the cursor had to be moved.

void TextView.scrollMarkOnScreen TextMark  mark  ) 
 

Scrolls text_view the minimum distance such that mark is contained within the visible area of the widget.

Parameters:
mark 

bit TextView.scrollToIter TextIter  iter,
gdouble  within_margin,
bit  use_align,
gdouble  xalign,
gdouble  yalign
 

Scrolls text_view 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 FALSE, the text scrolls the minimal distance to get the mark onscreen, possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size within_margin. NOTE: This function uses the currently-computed height of the lines in the text buffer. Note that line heights are computed in an idle handler; so this function may not have the desired effect if it's called before the height computations. To avoid oddness, consider using gtk_text_view_scroll_to_mark() which saves a point to be scrolled to after line validation.

Parameters:
iter 
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

void TextView.scrollToMark TextMark  mark,
gdouble  within_margin,
bit  use_align,
gdouble  xalign,
gdouble  yalign
 

Scroll to make mark visible.

Parameters:
mark 
within_margin 
use_align 
xalign 
yalign 

void TextView.setBorderWindowSize TextWindowType  type,
gint  size
 

setBorderWindowSize

Parameters:
type 
size 

void TextView.setBuffer TextBuffer  textBuffer  ) 
 

Setst eh text buffer for this text view.

Parameters:
textBuffer the text buffer

void TextView.setCursorVisible bit  setting  ) 
 

setCursorVisible

Parameters:
setting 

void TextView.setEditable bit  setting  ) 
 

Sets the default editability of this TextView.

You can override this default setting with tags in the buffer, using the "editable" attribute of tags.

Parameters:
setting 

void TextView.setIndent int  indent  ) 
 

Sets the default indentation for paragraphs in text_view.

Tags in the buffer may override the default.

Parameters:
indent 

void TextView.setJustification Justification  justification  ) 
 

Sets the default justification of text in text_view.

Tags in the view's buffer may override the default.

Parameters:
justification 

void TextView.setLeftMargin int  left_margin  ) 
 

Sets the default left margin for text in text_view.

Tags in the buffer may override the default.

Parameters:
left_margin 

void TextView.setPixelsAboveLines int  pixels_above_lines  ) 
 

Sets the default number of blank pixels above paragraphs in text_view.

Tags in the buffer for text_view may override the defaults.

Parameters:
pixels_above_lines 

void TextView.setPixelsBelowLines int  pixels_below_lines  ) 
 

Sets the default number of pixels of blank space to put below paragraphs in text_view.

May be overridden by tags applied to text_view's buffer.

Parameters:
pixels_below_lines 

void TextView.setPixelsInsideWrap int  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 text_view's buffer.

Parameters:
pixels_inside_wrap 

void TextView.setRightMargin int  right_margin  ) 
 

Sets the default right margin for text in the text view.

Tags in the buffer may override the default.

Parameters:
right_margin 

void TextView.setTabs TabArray  tabs  ) 
 

setTabs

Parameters:
tabs the tab stops

void TextView.setWrapMode WrapMode  wrap_mode  ) 
 

Sets the line wrapping for the view.

Parameters:
wrap_mode 

bit TextView.startsDisplayLine TextIter  iter  ) 
 

Determines whether iter is at the start of a display line.

See gtk_text_view_forward_display_line() for an explanation of display lines vs. paragraphs.

Returns:

TextView.this TextBuffer  textBuffer  ) 
 

Creates a new TextView with a textBuffer.

Parameters:
textBuffer the text buffer for this text view

TextView.this  ) 
 

Creates a new TextView.

void TextView.windowToBufferCoords TextWindowType  win,
gint  window_x,
gint  window_y,
gint *  buffer_x,
gint *  buffer_y
 

windowToBufferCoords

Parameters:
win 
window_x 
window_y 
buffer_x 
buffer_y 


Generated on Sun Dec 21 02:47:13 2003 for DUI by doxygen 1.3.4