andlabs / ui

Platform-native GUI library for Go.
Other
8.33k stars 651 forks source link

Table broken (GTK+) #318

Open woat opened 5 years ago

woat commented 5 years ago

When trying out the table example it appears to be broken. I did see the the TODO regarding the thin table on GTK+, forgive my ignorance, but I am wondering if there are any current workarounds or if the example is outdated and it is already fixed.

I am running Linux Mint. Output of dpkg -l libgtk2.0-0 libgtk-3-0:

ii  libgtk-3-0:amd64         3.18.9-1ubuntu3.3 amd64             GTK+ graphical user interface library
ii  libgtk2.0-0:amd64        2.24.30-1ubuntu1. amd64             GTK+ graphical user interface library

After go run table.go: screenshot from 2018-09-04 17-39-57

andlabs commented 5 years ago

There is no bugfix yet; I'm not sure why this happens at all. You can try working around this by, for instance, putting the table in a Box alongside another control.

woat commented 5 years ago

Alright thanks, that workaround is perfect.

// table.go
func setupUI() {
        // ...
    hbox := ui.NewHorizontalBox()
    hbox.SetPadded(true)
    hbox.Append(table, true)
    mainwin.SetChild(hbox)
        // ...
}

screenshot from 2018-09-04 20-33-09