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>sAnother means of finding a text position is provided by the Resolve function:void Resolve( w, fromPos, width, *pos_return);wfromPosfromXwidthpos_returnSpecifies the TextSink object.Specifies a reference position, usually the first characterin this line. This character is always to the left of thedesired 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 reference positionto the desired character position.Returns the character position that corresponds to thelocation that has been specified, or the word break immediatelyto the left if stopAtWordBreak is True.This function need make no attempt to deal with line feeds. The text widget will onlycall it one line at a time. This is a more convenient interface to the FindPositionfunction, and provides a subset of its functionality.Finding the Distance Between two Text PositionsTo find the distance in pixels between two text positions on the same line use thefunction FindDistance.void FindDistance( w, toPos, fromX, *pos_return, *height_return);wfromPosfromXtoPosresWidthresPosheight_returnSpecifies the TextSink object.Specifies the text buffer position, in characters, ofthe first position.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 text buffer position, in characters, ofthe second position.Return the actual distance between fromPos andpos_return.Returns the character position that corresponds tothe actual character position used for toPos in thecalculations. This may be different than toPos, for exampleif fromPos and toPos are on different lines inthe file.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.87

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

Saved successfully!

Ooh no, something went wrong!