root/functions/set-text.r

Revision 111, 0.8 kB (checked in by ashley, 8 months ago)

Split requestors off into %rebgui-requestors.r
Requestors and functions now appear in their respective parent objects
Added new on-resize handler
tab-panel.r and chat.r fixes
RebDOC.r enhancements

Line 
1 set-text: make function! [
2         "Set and show a widget's text attribute."
3         face [object!] "Widget"
4         text [any-type!] "Text"
5         /caret "Insert at cursor position (tail if none)"
6         /no-show "Don't show"
7         /focus
8 ][
9         unless string? face/text [exit]
10         either caret [
11                 if all [
12                         face = view*/focal-face
13                         view*/caret
14                 ] [face/caret: index? view*/caret]
15                 either face/caret [
16                         insert at face/text face/caret form text
17                         view*/caret: at face/text face/caret + length? form text
18                         face/caret: index? view*/caret
19                 ] [insert tail face/text form text]
20         ] [insert clear face/text form text]
21         all [
22                 face/para
23                 face/para/scroll: 0x0
24                 all [face/type = 'area face/pane/data: 0]
25         ]
26         face/line-list: none
27         unless no-show [either focus [set-focus face] [show face]]
28 ]
Note: See TracBrowser for help on using the browser.