Skip to content

@netvl /ui.go
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
package ui
import (
"github.com/mattn/go-gtk/gtk"
"unsafe"
)
// This is how GtkWidget and GtkEntry are defined in gtk.go source file in the library:
//
// type GtkWidget struct {
// Widget *C.GtkWidget
// }
//
// type GtkEntry struct {
// GtkWidget
// GtkEditable
// }
//
// GtkEditable implicit field is unimportant for now.
var (
messageNameEntry *gtk.GtkEntry
)
func Init(builder *gtk.GtkBuilder) {
// GtkEntry requires GtkWidget, so I need to create GtkWidget instance first
messageNameEntryWidget := gtk.GtkWidget{}
// Code below does not work, as well as many other different attempts
*(unsafe.Pointer(&messageNameEntryWidget.Widget)) = builder.GetObject("messageNameEntry").Object
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.