From e16d6fa878f6eb38ac24605513d562696a14fdc7 Mon Sep 17 00:00:00 2001 From: "Stanislav N. aka pztrn" Date: Tue, 22 Nov 2016 14:25:16 +0500 Subject: [PATCH] Disabling setting default sort column on windows until it will be fixed in go-gtk (https://github.com/mattn/go-gtk/issues/291). --- ui/mainwindow_init.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/mainwindow_init.go b/ui/mainwindow_init.go index 9dab422..38c0ccb 100644 --- a/ui/mainwindow_init.go +++ b/ui/mainwindow_init.go @@ -418,7 +418,11 @@ func (m *MainWindow) InitializeTabs() { width_int, _ := strconv.Atoi(width) col := gtk.NewTreeViewColumnWithAttributes(name, gtk.NewCellRendererText(), "markup", position_int) - col.SetSortColumnId(position_int) + // For some reason this cause panic on Windows, so disabling + // default sorting here. + if runtime.GOOS != "windows" { + col.SetSortColumnId(position_int) + } col.SetReorderable(true) col.SetResizable(true) // GtkTreeViewColumn.SetFixedWidth() accepts only positive integers. @@ -507,7 +511,11 @@ func (m *MainWindow) InitializeTabs() { width_int, _ := strconv.Atoi(width) col := gtk.NewTreeViewColumnWithAttributes(name, gtk.NewCellRendererText(), "markup", position_int) - col.SetSortColumnId(position_int) + // For some reason this cause panic on Windows, so disabling + // default sorting here. + if runtime.GOOS != "windows" { + col.SetSortColumnId(position_int) + } col.SetReorderable(true) col.SetResizable(true) // GtkTreeViewColumn.SetFixedWidth() accepts only positive integers.