Gtk.jl icon indicating copy to clipboard operation
Gtk.jl copied to clipboard

A minor syntax issue with GtkWindowLeaf attributes

Open pauljurczak opened this issue 6 years ago • 4 comments

Evaluating GtkWindowLeaf outputs: GtkWindowLeaf(name="", parent, width-request=600, height-request=-1, visible=TRUE, ... Can it be modified to: GtkWindowLeaf(name="", parent, width_request=600, height_request=-1, visible=true, ... so it's syntactically correct in Julia?

pauljurczak avatar Oct 09 '18 07:10 pauljurczak

not sure why booleans are printed uppercase. @vtjnash may know.

tknopp avatar Oct 09 '18 07:10 tknopp

@tknopp There is also width-request vs width_request.

pauljurczak avatar Oct 09 '18 07:10 pauljurczak

There is a reason for that but I actually don't know exactly what since I did not design that part of Gtk.jl

tknopp avatar Oct 09 '18 15:10 tknopp

I think the reason things are called like is that that's how they are called in Gtk. Gtk.jl just calls a GObject introspection method and prints the results:

https://github.com/JuliaGraphics/Gtk.jl/blob/4190f445872257e7fdf92c96409e48a00380785c/src/GLib/gvalues.jl#L209-L238

I guess one could "translate" those names into Julia friendly ones, since that's just for showing in the REPL it should be safe.

jonathanBieler avatar Oct 09 '18 16:10 jonathanBieler