12.07.2015 Views

Athena Widget Set - C Language Interface - X Consortium ... - X.Org

Athena Widget Set - C Language Interface - X Consortium ... - X.Org

Athena Widget Set - C Language Interface - X Consortium ... - X.Org

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Text <strong>Widget</strong>sClearing Portions of the Text windowTo clear a portion of the Text window to its background color, the Text widget willcall ClearToBackground. The TextSink object already defines this function as callingXClearArea on the region passed. This behavior will be used if you specify XtInheritClearToBackgroundfor this method.void ClearToBackground( w, y, height);wxywidthheightSpecifies the TextSink object.Specifies the x location, in pixels, of the Region to clear.Specifies the y location, in pixels, of the Region to clear.Specifies the width, in pixels, of the Region to clear.Specifies the height, in pixels, of the Region to clear.X and y denote the upper left hand corner of region to clear.Finding a Text Position Given Pixel ValuesTo find the text character position that will be rendered at a given x location theText widget uses the function FindPosition:void FindPosition( w, fromPos, width, stopAtWordBreak, *pos_return,*height_return);wfromPosfromXwidthstopAtWordBreakpos_returnwidth_returnheight_returnSpecifies the TextSink object.Specifies a reference position, usually the first characterin this line. This character is always to the leftof the desired character location.Specifies the distance that the left edge of fromPos isfrom the left edge of the window. This is the referencex location for the reference position.Specifies the distance, in pixels, from the referenceposition to the desired character position.Specifies whether or not the position that is returnedshould be forced to be on a word boundary.Returns the character position that corresponds tothe location that has been specified, or the workbreak immediately to the left of the position if stopAt-WordBreak is True.Returns the actual distance between fromPos andpos_return.Returns the maximum height of the text betweenfromPos and pos_return.This function need make no attempt to deal with line feeds. The text widget willonly call it one line at a time.86

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!