<commit_before>// +build !windows,!darwin

// 7 july 2014

package ui

import (
	"unsafe"
)

// #cgo pkg-config: gtk+-3.0
// #include "gtk_unix.h"
// extern gboolean doissue(gpointer data);
import "C"

func uiinit() error {
	// TODO replace with the error-checking version
	C.gtk_init(nil, nil)
	return nil
}

func uimsgloop() {
	C.gtk_main()
}

func uistop() {
	C.gtk_main_quit()<commit_msg>Switched from gtk_init() to the version that lets us catch and report any errors it encounters.<commit_after>// +build !windows,!darwin

// 7 july 2014

package ui

import (
	"fmt"
	"unsafe"
)

// #cgo pkg-config: gtk+-3.0
// #include "gtk_unix.h"
// extern gboolean doissue(gpointer data);
import "C"

func uiinit() error {
	var err *C.GError = nil		// redundant in Go, but let's explicitly assign it anyway

	// gtk_init_with_args() gives us error info (thanks chpe in irc.gimp.net/#gtk+)
	// don't worry about GTK+'s command-line arguments; they're also available as environment variables (thanks mclasen in irc.gimp.net/#gtk+)
	result := C.gtk_init_with_args(nil, nil, nil, nil, nil, &err)
	if result == C.FALSE {
		return fmt.Errorf("error actually initilaizing GTK+: %s", fromgstr(err.message))
	}
	return nil
}

func uimsgloop() {
	C.gtk_main()
}

func uistop() {
	C.gtk_main_quit()
{'fraction_non_alphanumeric': 0.13973458235753317, 'fraction_numerical': 0.01092896174863388, 'mean_word_length': 3.8745247148288975, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6917362', 'n_tokens_mistral': 520, 'n_tokens_neox': 481, 'n_words': 142}