Closed he-la closed 6 years ago
That is already implemented and with exactly the same syntax you thought :) . Here's an example. There's also this syntax for when calling the constructor is not enough and you want to set construct-only properties by name, but it's not safe, unfortunately.
In GTK+, the window type must be set in the window constructor and cannot be changed thereafter (there is no
set_type
method). While I am new to relm, I understand that this makes it impossible to use the view macro when creating a window that is not a toplevel window, such as a popup.A possible solution would be to perhaps introduce a syntax for passing constructor paramters with the view macro. I think something like the following would make sense:
i.e. adding constructor parameters for GTK+ widgets within parentheses. Such a feature addition would be compatible with the current version of relm, as the parentheses may be omitted when no constructor parameters are passed.