visualfc / atk

Another Golang Tcl/Tk binding GUI ToolKit
GNU Lesser General Public License v2.1
97 stars 19 forks source link

WidgetAttr fields are unexported #34

Closed torkus closed 8 months ago

torkus commented 8 months ago

I'm trying to set an attribute on a widget using a tk.WidgetAttr but the key and value fields are not exported: https://github.com/visualfc/atk/blob/069a392c3bd61497b4954b5aec98470627d4e49e/tk/widget_attr.go#L10-L13

Outside of the tk package, how is one supposed to create and use these widgets?

This:

disabled := tk.WidgetAttr{"state", "disabled"}

gets this:

implicit assignment to unexported field key in struct literal of type tk.WidgetAttr

and this:

disabled := tk.WidgetAttr{key: "state", value: "disabled"}

gets this:

unknown field key in struct literal of type tk.WidgetAttr

torkus commented 8 months ago

PR here: https://github.com/visualfc/atk/pull/35