wxruby-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Wxruby-dev] Summary of naming problems


From: repeater
Subject: RE: [Wxruby-dev] Summary of naming problems
Date: Thu, 26 Jun 2003 01:00:19 +0200

Richard Kilmer wrote:
> >
> > -the cultural reorientation of people like me, who through experience
> > with
> > other gui libs would 'include' the first thing that they see.
>
> You can include if you want.  You just have to know that by doing so
> you are bringing in the whole constant pool of Wx...this is no
> different for Fox.

The thing is that with Fox you've got for example FXButton, with two letters
that just makes any possible conflicts far less likely. And it corresponds
with docu, but that isn't that much a biggie.

> You can still access constants that existed before
> the inclusion of the namespace like for Object it would be ::Object
> (accessing the Object constant in the 'root' namespace).

As an aside, it seems that constants in root will not be replaced as include
takes places. Obviously so I suppose. So just don't create a Window class
when you want to use wxwindows...fair enough.

> What is nice
> is by giving you a choice, your example could become:
>
>      include Wx
>      @calendar = CalendarCtrl.new(self, ID_CALENDAR, DefaultDateTime,
>                                       DEFAULT_POSITION, DEFAULT_SIZE,
>                                       CAL_MONDAY_FIRST |
>                                       CAL_SHOW_HOLIDAYS |
>                                       RAISED_BORDER)
>

whoops no 'self' in my example above, we've got pure OO :-)

>      dlgSizer = BoxSizer.new(HORIZONTAL)
>      calendarSizer = BoxSizer.new(VERTICAL)
>      calendarSizer.Add(@calendar, 1, GROW)
>      dlgSizer.Add(calendarSizer, 1, GROW)
>

This looks better yes, I'm satisfied. Using a style with Wx::Button for
classes and just normal included names for the constants, would give you
best of both worlds.

Have a nice day
Peter





reply via email to

[Prev in Thread] Current Thread [Next in Thread]