<commit_before>// fyne1, going thru examples from fyne.io website.
/*
REVISION HISTORY
-------- -------
29 Aug 21 -- Copied from a web example
*/

package main

import (
	"fmt"
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/widget"
	"image/color"
	"log"
	"runtime"
)

const LastModified = "August 29, 2021"

var globalA fyne.App
var globalW fyne.Window
var red, green, blue color.Color
var input *widget.Entry

// ---------------------------------------------------- main --------------------------------------------------
func main() {

	str := fmt.Sprintf("fyneEntry example last modified %s, compiled using %s", LastModified, runtime.Version())

	globalA = app.New()
	globalW = globalA.NewWindow(str)
	globalW.Canvas().SetOnTypedKey(keyTyped)
	globalW.SetTitle(str)

	input = widget.NewEntry()
	input.SetPlaceHolder(" Entry Widget ...")
	btnfunc := func() {
		log.Println(" text entered:", input.Text)
	}

	input.OnSubmitted = func(s string) {
		log.Println(" closure func: ENTER was hit: ", s)
	}

	btn := widget.NewButton("Wider save me", btnfunc)<commit_msg>modified:   fyneentry/fyneentry.go<commit_after>// fyne1, going thru examples from fyne.io website.
/*
REVISION HISTORY
-------- -------
29 Aug 21 -- Copied from a web example
*/

package main

import (
	"fmt"
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/widget"
	"image/color"
	"log"
	"runtime"
)

const LastModified = "August 29, 2021"

var globalA fyne.App
var globalW fyne.Window
var red, green, blue color.Color
var input *widget.Entry

// ---------------------------------------------------- main --------------------------------------------------
func main() {

	str := fmt.Sprintf("fyneEntry example last modified %s, compiled using %s", LastModified, runtime.Version())

	globalA = app.New()
	globalW = globalA.NewWindow(str)
	globalW.Canvas().SetOnTypedKey(keyTyped)
	globalW.SetTitle(str)

	input = widget.NewEntry()
	input.SetPlaceHolder(" Entry Widget ...")
	btnfunc := func() {
		log.Println(" text entered:", input.Text)
	}
/*
Trying out alternate syntaxes.  This works as a func literal.
	input.OnSubmitted = func(s string) {
		log.Println(" func literal closure func: ENTER was hit:", s)
	}

 */

	submitted := func(s string) {
		log.Println(" func assigned closure ENTER was hit:", s)
	}
	input.OnSubmitted = submitted // after help from <NAME>, a principal in the fyne.io project.

	btn := widget.NewButton("Wider save me", btnfunc)
{'fraction_non_alphanumeric': 0.22111155537784885, 'fraction_numerical': 0.011995201919232307, 'mean_word_length': 2.5896700143472025, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6575086', 'n_tokens_mistral': 888, 'n_tokens_neox': 837, 'n_words': 223}