// OptionText adds a radio button to win. If is_active is true the
// radio button will be drawn selected. Returns true when the button
// is clicked once.
// You are responsible for ensuring that only one radio button is selected at once.
540668
func (win *Window) OptionText(text string, is_active bool) bool {
	style := &win.ctx.Style
	state, bounds, fitting := win.widget()
	if fitting != nil {
		fitting(toggleWidth(text, toggleOption, &style.Option, style.Font))
	}
	if !state {
		return false
	}
	in := win.inputMaybe(state)
	is_active = doToggle(win, bounds, is_active, text, toggleOption, &style.Option, in, style.Font)
	return is_active
}
150063
func writeText(w io.Writer, text []byte, html bool) {
	if html {
		template.HTMLEscape(w, text)
		return
	}
	w.Write(text)
}
795958
func (c *ChatPostMessageCall) Text(text string) *ChatPostMessageCall {
	c.text = text
	return c
}
706605
func (p *parser) addText(text string) {
	if text == "" {
		return
	}

	if p.shouldFosterParent() {
		p.fosterParent(&Node{
			Type: TextNode,
			Data: text,
		})
		return
	}

	t := p.top()
	if n := t.LastChild; n != nil && n.Type == TextNode {
		n.Data += text
		return
	}
	p.addChild(&Node{
		Type: TextNode,
		Data: text,
	})
}
1092151
func (gp *GoPdf) Text(text string) error {

	err := gp.curr.Font_ISubset.AddChars(text)
	if err != nil {
		return err
	}

	err = gp.getContent().AppendStreamText(text)
	if err != nil {
		return err
	}

	return nil
}
1196961
func (vr *vectorRenderer) Text(body string, x, y int) {
	vr.c.Text(x, y, body, vr.s.GetTextOptions())
}
1143362
func OptionInputTextColor(x Color) Option {
	return func(p *Prompt) error {
		p.renderer.inputTextColor = x
		return nil
	}
}
243750
func (s *DetectDominantLanguageInput) SetText(v string) *DetectDominantLanguageInput {
	s.Text = &v
	return s
}
1026171
func (ui *UI) DisplayTextMenu(choices []string, promptTemplate string, templateValues ...map[string]interface{}) (string, error) {
	for i, c := range choices {
		t := fmt.Sprintf("%d. %s", i+1, c)
		ui.DisplayText(t)
	}

	translatedPrompt := ui.TranslateText(promptTemplate, templateValues...)

	interactivePrompt := ui.Interactor.NewInteraction(translatedPrompt)

	interactivePrompt.SetIn(ui.In)
	interactivePrompt.SetOut(ui.OutForInteration)

	var value string = "enter to skip"
	err := interactivePrompt.Resolve(&value)

	if isInterrupt(err) {
		ui.Exiter.Exit(sigIntExitCode)
	}

	if err != nil {
		return "", err
	}

	if value == "enter to skip" {
		return "", nil
	}

	i, err := strconv.Atoi(value)
	if err != nil {
		if contains(choices, value) {
			return value, nil
		}
		return "", InvalidChoiceError{Choice: value}
	}

	if i > len(choices) || i <= 0 {
		return "", ErrInvalidIndex
	}
	return choices[i-1], nil
}
1113272
func (win *Window) Button(lbl label.Label, repeat bool) bool {
	style := &win.ctx.Style
	state, bounds, fitting := win.widget()
	if fitting != nil {
		buttonWidth(lbl, &style.Button, style.Font)
	}
	if !state {
		return false
	}
	in := win.inputMaybe(state)
	return doButton(win, lbl, bounds, &style.Button, in, repeat)
}
594511
func (fci *FakeCallInfo) Text() string {
	return fmt.Sprintf("%s:%s(fakeRPC)", fci.Remote, fci.Method)
}
385824
func (s *Selection) SetText(text string) *Selection {
	return s.SetHtml(html.EscapeString(text))
}
514264
func (s *StartSpeechSynthesisTaskInput) SetText(v string) *StartSpeechSynthesisTaskInput {
	s.Text = &v
	return s
}
23068
func (c *Menu) GetOptionFromText(v string) *MenuOption {
	for idx := range c.options {
		testOption := &c.options[idx]
		if testOption.GetText() == v {
			return testOption
		}
	}
	return nil
}
60427
func Choose(prefix string, choices []string, opts ...Option) string {
	completer := newChoiceCompleter(choices, FilterHasPrefix)
	pt := New(dummyExecutor, completer)
	pt.renderer.prefixTextColor = DefaultColor
	pt.renderer.prefix = prefix

	for _, opt := range opts {
		if err := opt(pt); err != nil {
			panic(err)
		}
	}
	return pt.Input()
}
785789
func (r *RadioButtons) Draw(screen tcell.Screen) {
	r.Box.Draw(screen)
	x, y, width, height := r.GetInnerRect()

	for index, option := range r.options {
		if index >= height {
			break
		}
		radioButton := "\u25ef" // Unchecked.
		if index == r.currentOption {
			radioButton = "\u25c9" // Checked.
		}
		line := fmt.Sprintf(`%s[white]  %s`, radioButton, option)
		tview.Print(screen, line, x, y+index, width, tview.AlignLeft, tcell.ColorYellow)
	}
}
922794
func (v *ComboBox) PrependText(text string) {
	deprecated_since(2, 24, 0, "gtk_combo_box_prepend_text()")
	ptr := C.CString(text)
	defer cfree(ptr)
	C.gtk_combo_box_prepend_text(COMBO_BOX(v), gstring(ptr))
}