()
| 1287 | ) |
| 1288 | |
| 1289 | func init() { |
| 1290 | TheApp.AddQuitCleanFunc(textFieldBlinker.QuitClean) |
| 1291 | textFieldBlinker.Func = func() { |
| 1292 | w := textFieldBlinker.Widget |
| 1293 | if w == nil { |
| 1294 | return |
| 1295 | } |
| 1296 | tf := AsTextField(w) |
| 1297 | if !w.AsWidget().StateIs(states.Focused) || !w.AsWidget().IsVisible() { |
| 1298 | tf.blinkOn = false |
| 1299 | tf.renderCursor(false) |
| 1300 | } else { |
| 1301 | tf.blinkOn = !tf.blinkOn |
| 1302 | tf.renderCursor(tf.blinkOn) |
| 1303 | } |
| 1304 | } |
| 1305 | } |
| 1306 | |
| 1307 | // startCursor starts the cursor blinking and renders it |
| 1308 | func (tf *TextField) startCursor() { |
nothing calls this directly
no test coverage detected