jeremyletang / rgtk

GTK+ bindings and wrappers for Rust (DEPRECATED SEE https://github.com/rust-gnome )
GNU Lesser General Public License v3.0
121 stars 22 forks source link

Support variadic methods on dialogs #231

Closed gkoz closed 9 years ago

gkoz commented 9 years ago

DialogButtons trait allows to take fixed-length arrays of button definitions generically over their length. Add Dialog::with_buttons and add_buttons that take such an array. While there, publish Dialog::new. Make FileChooserDialog::new take button arrays too. Update the examples.

GuillaumeGomez commented 9 years ago

To wrap the variadic arguments, I was just thinking about doing it with a macro (like print! and stuff). But very nice job ! I'll merge it while waiting for a potentially better way.

gkoz commented 9 years ago

Yeah, I'd like a better way too and the implementation isn't pretty at all. Hopefully we can improve it.

GuillaumeGomez commented 9 years ago

Sure we can and we will !