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>sFinding the Size of the Drawing areaTo find the maximum number of lines that will fit into the current Text widget, usethe function MaxLines. The TextSink already defines this function to compute themaximum number of lines by using the height of font.int MaxLines( w, height);wheightSpecifies the TextSink object.Specifies the height of the current drawing area.Returns the maximum number of lines that will fit in height.To find the height required for a given number of text lines, use the function Max-Height. The TextSink already defines this function to compute the maximum heightof the window by using the height of font.int MaxHeight( w, lines);wheightSpecifies the TextSink object.Specifies the height of the current drawing area.Returns the height that will be taken up by the number of lines passed.<strong>Set</strong>ting the Tab StopsTo set the tab stops for a text sink use the <strong>Set</strong>Tabs function. The TextSink alreadydefines this function to set the tab x location in pixels to be the number of characterstimes the figure width of font.void <strong>Set</strong>Tabs( w, *tabs);wtab_counttabsSpecifies the TextSink object.Specifies the number of tabs passed in tabs.Specifies the position, in characters, of the tab stops.This function is responsible for the converting character positions passed to it intowhatever internal positions the TextSink uses for tab placement.Getting the Insert Point's Size and LocationTo get the size and location of the insert point use the GetCursorBounds function.void GetCursorBounds( w, *rect_return);wrect_returnSpecifies the TextSinkObject.Returns the location and size of the insert point.Rect will be filled with the current size and location of the insert point.TextSrc Object88

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

Saved successfully!

Ooh no, something went wrong!