[wxruby-users] More rubish API

Kirill Likhodedov kirill.likhodedov at gmail.com
Wed Nov 5 08:22:17 EST 2008


What I also would like to propose is to make set-methods "chainable".Currently
I have to do the following:
    style = Wx::RichTextAttr.new
    style.set_font_face_name("Verdana")
    style.set_font_size(10)
I would like to do:
    style = Wx::RichTextAttr.new
    style.set_font_face_name("Verdana").set_font_size(10)
etc.

This can be easily done by returning self object after modifying it.

I also would like to point that set_text_colour and set_background_colour
are named in a british manner (OUR), which is fine for
language, but is not traditional for IT, which uses color (OR). It looks
reasonable to change or at least alias this.

Thanks,
Kirill

2008/11/5 Kirill Likhodedov <kirill.likhodedov at gmail.com>

> Hi,
> Sometimes I find places in WxRuby API which seem to me not quite Ruby way
> compatible. :)
> I know (it's written somewhere on the wxruby site), that there is an acvity
> to make WxRuby more Rubish.
> I don't feel enough confident in Ruby or WxRuby to fully participate, but
> I'd like to point to some places which could be improved.
> Where is the best place to do it? This mailing list or bug tracker or
> somewhere else? :)
>
> For example, that's what I've noticed while examining RichTextAttr#apply:
> "Applies the attributes in style to the original object, but not those
> attributes from style that are the same as those in compareWith (if passed).
> See also RichTextAttr#combine for a function that does almost the same but
> returns a new object instead of modifying the original object."
>
> I'd mark combine as deprecated and use apply! instead, because that's what
> exclamation mark is for. What do you think?
>
> Best regards,
> Kirill.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20081105/a37767ff/attachment.html>


More information about the wxruby-users mailing list