Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WidgetAttr fields are unexported #34

Closed
torkus opened this issue Dec 26, 2023 · 1 comment
Closed

WidgetAttr fields are unexported #34

torkus opened this issue Dec 26, 2023 · 1 comment

Comments

@torkus
Copy link

torkus commented Dec 26, 2023

I'm trying to set an attribute on a widget using a tk.WidgetAttr but the key and value fields are not exported:

atk/tk/widget_attr.go

Lines 10 to 13 in 069a392

type WidgetAttr struct {
key string
value interface{}
}

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
Copy link
Author

torkus commented Dec 26, 2023

PR here: #35

@torkus torkus closed this as completed Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant