MCPcopy Create free account
hub / github.com/cogentcore/core / offerComplete

Method offerComplete

core/textfield.go:1207–1218  ·  view source on GitHub ↗

offerComplete pops up a menu of possible completions

()

Source from the content-addressed store, hash-verified

1205
1206// offerComplete pops up a menu of possible completions
1207func (tf *TextField) offerComplete() {
1208 if tf.complete == nil {
1209 return
1210 }
1211 s := string(tf.editText[0:tf.cursorPos])
1212 cpos := tf.charRenderPos(tf.cursorPos, true).ToPoint()
1213 cpos.X += 5
1214 cpos.Y = tf.Geom.TotalBBox.Max.Y
1215 tf.complete.SrcLn = 0
1216 tf.complete.SrcCh = tf.cursorPos
1217 tf.complete.Show(tf, cpos, s)
1218}
1219
1220// cancelComplete cancels any pending completion -- call this when new events
1221// have moved beyond any prior completion scenario

Callers 3

handleKeyEventsMethod · 0.95
InitMethod · 0.45
managerKeyChordEventsMethod · 0.45

Calls 3

charRenderPosMethod · 0.95
ToPointMethod · 0.80
ShowMethod · 0.65

Tested by

no test coverage detected