Re: Modules and Name space



On Wed, 2004-09-15 at 14:33, Kevin C. Krinke wrote:

# Get a prepped prefab Gtk2::Dialog window with content
$message = new Message ( title => "a title",
                         icon => "gtk-dialog-info",
                         text => "Hello world" );

# display the widget and run a main loop for it
$message->show_all();
$response = $message->run();

# here's the good stuff... same as above in one line
$response = new_run Message ( %options );

# but we don't want to the window to block with a main loop so
# what want is to just show_all and continue on
new_show Message ( %options );

i think extras like this are really cool and useful and i also think
there are nearly endless possibilities to things like this that could be
done. 

my only thought is that the above two examples don't follow the gtk+
naming schemes really. something like

        my $msg = Gtk2::Ex::Dialogs::Messag->new (...)
        $msg->run
and
        Gtk2::Ex::Dialogs::Messag->new_and_run (...)
and
        Gtk2::Ex::Dialogs::Messag->new_and_show (...)

would seem to fit a bit better, but this is all just my opinion, there's
nothing inherently wrong about it and you're welcome to do as you wish.

So what this all boils down to is the following questions:

A) Do I tuck these things into UI::Dialog::PurePerl::Gtk2?
   (my original plan).

if you want people to find them and have a good idea of what they are
they should probably be under the Gtk2 name space.

B) Make a separate module under a different name space, ie: Gtk2::UI::*

we've established
(http://www.google.com/search?q=site%3Amail.gnome.org+Gtk2%3A%3AEx&sourceid=firefox&start=0&start=0&ie=utf-8&oe=utf-8)
 something of a working standard that any non glib/gtk+/gnome bindings should go under the name space 
Gtk2::Ex::. this is to prevent possible future clashes in case gtk+ was to add something that conflicted name 
wise. (Gtk2::SimpleList would be a good example, what's to say they won't create something called 
GtkSimpleList)

C) either A or B but omit the Constants and/or Utils

Glib already has TRUE and FALSE available. (use Glib qw/TRUE FALSE/) as
for the rest of those it's a judgment call. i don't think i'd really use
a module like that, but others may. you're welcome publish them. i would
suggest it be under the Gtk2::Ex name space as well.

D) Get suggestions and implement a best fit solution

i would suggest something like:
        Gtk2::Ex::Dialogs::(Message|Question|etc.)
anything you want to use past Gtk2::Ex:: is fine, it's wide open
territory. just try to think through whatever you decide. obviously
asking the list was a good place to start.

later,
-- 
-rm
http://www.neces.com/




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