OxyScripts.com
Menu spacer Home Tutorials Articles Code Forums irc.freenode.net #oxyscripts
Main (PHP)
Home Forums PHP News PHP Tutorials Articles PHP Code Snippets Contact Us Sysadmin Resources Books Template Shop
3rd Party Streams
SlashDot PHPDeveloper.org PHP.Net
Resources
PHP Manual MySQL Manual Smarty Manual PEAR Manual PHP-GTK Manual Symfony Manual
Code Snippets
Authentication Database Graphics HTTP Miscellaneous Time/Date
Affiliates
Scripts TutorialMan TutorialGuide CodingForums.com PHP Scripts Cheap Web Hosting Affordable Web Hosting Dreamweaver Templates

Search This Site :     PHP Function Reference :
 
GtkText

GtkText

Editable text-display widget.

Object Hierarchy

GtkObject
`-- GtkWidget
       `-- GtkEditable
              `-- GtkText

Direct subclasses

None.

Description

GtkText provides a scrolling widget with a white background which can have text strings passed to it programmatically or directly from the keyboard (if it is set to be editable). There are a number of keybindings for the editing features; these are listed under GtkEditable, as they are generally shared by the GtkEntry widget.

GtkText is one of two widgets marked as BROKEN throughout the 1.3 series of GTK+ releases, and is being replaced entirely by a new set of text and editing widgets in GTK 2.0. If you can avoid using it, do so. If you can't, be aware that it has issues which are never going to be fixed.

One of these issues is that the horizontal GtkAdjustment does not work in the GtkText widget, and that trying to declare it as anything other than NULL causes the application to stall. There is no problem with the vertical adjustment, and a vertical scrollbar associated with the text widget will work just fine.

Another feature is that it cannot cope with very frequent text updates for long, that being when you're most likely to generate a string that is too big for its XWindow to handle. You may find it better to use a GtkCList if you are using it to display the output for any form of network monitoring, for example.

There is also a problem with the linewrap when the GtkText widget is utilised under Windows, causing it to display 'little black boxes' at every soft wrap. You can get around this by using PHP's wordwrap() function to create a line-end within the GTK line-end, but bear in mind that PHP uses a given number of characters to determine the length of the line, whereas GTK uses pixels to configure the relationship between the font size, the line-end, and the container's border.

See also: GtkEditable, GdkFont, GtkFontSelectionDialog.

A final note: the signal set_scroll_adjustments has not been covered here as it is purely used internally to allow the text widget to communicate with scrolling-aware container widgets.

Constructor

GtkText ([ GtkAdjustment hadj = NULL , [ GtkAdjustment vadj = NULL ]]);
-- Creates a scrollable text widget.

Methods

set_editable()
  Toggles whether text widget is editable.
set_word_wrap()
  Toggles whether words at the end of a line can be broken.
set_line_wrap()
  Toggles whether text should be wrapped at the widget boundary.
set_adjustments()
  Specifies the GtkAdjustments to be used.
set_point()
  Sets insertion point.
get_point()
  Returns the current insertion point.
get_length()
  Returns length of string.
freeze()
  Freezes display.
thaw()
  Thaws display.
insert()
  Inserts a string of text.
backward_delete()
  Deletes characters prior to insertion point.
forward_delete()
  Deletes characters ahead of insertion point.

Properties

hadj:
  Horizontal adjustment. *broken*
vadj:
  Vertical adjustment.

 
   Print this page

Top Sponsor
Symantec\'s Norton SystemWorks 2006
Sponsors
CA
Sponsors
AdWords Dominator 125*125
Advertisting

Affiliates
VertexTemplates PHPFreaks CodeWalkers StarGeek DevScripts CGI & PHP Scripts PHP CMS

Shopping Rebates   Sell It 4 You   Flash Page Counters   Get Insured
GPS Tracking Service   Charity Donate Info   Web Site Hosting   VOIP Service

Privacy Policy | Links | Site Map | Advertising

All content on OxyScripts.com is (©)2002-2007

 
Powered by Adrastea - Version 1.0.0. Copyright © Rune Solutions, 2004-2005