-
Notifications
You must be signed in to change notification settings - Fork 42
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
Multi-word constructor props should be camelCase, not snake_case #320
Comments
Have you seen the naming conventions? It seems this behavior is intended. As for ts-for-gjs, that's a separate project by a separate developer. If the typedefs don't match up to node-gtk, I would open an issue there. |
@binyamin Maybe I'm not reading it right, but it looks like the naming conventions only strengthen my point. There's isn't any entry in the naming conventions that would use lowercase snake_case, and according to it, properties should be camelCased. |
@Lesik hmm, here's the particular convention I was referring to (italics are my own). If I'm reading it right, maybe there should be a lowercase example.
|
@binyamin No offense, but I think it would be quite a stretch of definition to call properties constants. Example: new Gtk.Image({
"icon_size": Gtk.IconSize.LARGE_TOOLBAR,
}); In this example,
|
Great point. I'm going to hand this one off to @romgrk |
@Lesik is right, the behavior is buggy. If it's |
In order to pass the property "icon name" to the constructor of
Gtk.Image
, as an example, the property name must beicon_name
:But it should be
iconName
according to the types generated byts-for-gjs
, and also as you likely know it's idiomatic for JS.(Really loving the passing of props through the config object btw, very idiomatic, thanks!)
Passing
iconName
results in a crash with the following message:System information:
Edit: To clarify, this has nothing to do with
Gtk.Image
, it holds true for all widgets that have multi-word constructor props.The text was updated successfully, but these errors were encountered: