A text widget is provides a powerful means to display and manipulate text in a window.
interface text: widget { <widgets/text.h>
sources/java/hush.dv.widgets.text
text();
text(const char *p, const char* options = "");
text(const widget* w, const char *p, const char* options = "");
virtual ~text();
virtual void insert(const char* s);
virtual void insert(int l, int n, const char* s, const char* tags="");
virtual void insert(const char* ind, const char* s,const char* tags="");
virtual void del(int fromline, int fromcol, int toline, int tocol);
virtual void del(const char* from ="0.0", const char* to ="end");
virtual char* get(int fromline, int fromcol, int toline, int tocol) const;
virtual char* get(const char* from ="0.0", const char* to ="end") const;
virtual void enable();
virtual void disable();
virtual int enabled() const; // is the widget disabled?
protected:
void install(dvbinding* ac, const char* args );
};
-height <number> -- in characters -state <normal|disabled> -width <number> -- in characters -wrap <none|char|word>
background, borderwidth, cursor, exportselection, font, foreground, insertbackground, insertborderwidth, insertofftime, insertontime, insertwidth, padx, pady , relief, selectbackground, selectborderwidth, selectforeground, setgrid, yscrollcommand
Disabling the text widget prevents users from inserting or deleting characters. However, calling the insert() or del() member functions will temporaly suspend the disabled state.
Warning: the get() member only works for small amounts of text (e.g. #characters < 1000).
t->insert("Hello World"); # insert at cursor
t->insert(10, 20, "Hello World"); # insert at 10.20
t->insert("end", "Hello World", "newtag"); # insert at end with tag "newtag"
char* content = t->get(); # get all text
char* content = t->get("insert", "end"); # get from cursor till end
char* content = t->get(1,0, 10,8); # get from 1.0 to 10.8
slide: EXAMPLES
<h4>LIBRARY</h4>
widget -- file <widgets/text.h>
slide: LIBRARY
<h4>KEYWORDS</h4>
widget(4)
<h4>SEE ALSO</h4>
text(n)
<hr>
[.]
Papers
Tutorials
Examples
Manuals
Interfaces
Sources
Packages
Resources
?
<hr>
<table cellpadding=10>
<tr>
<td>
<address>
Hush Online Technology
</address>
hush@cs.vu.nl
<br>09/24/99
</td><td>
<img src=../../../../@share/base/eye.gif width=30 height=30>
</td>
<td></td><td></td><td></td><td></td><td></td><td></td><td></td>
<td>
<img src=../../../../@share/images/griff.gif>
</td>
</tr>
</table>