Re: Modules and Name space
- From: "Kevin C. Krinke" <kckrinke opendoorsoftware com>
- To: Ross McFarland <rwmcfa1 neces com>
- Cc: Gtk-Perl-List <gtk-perl-list gnome org>
- Subject: Re: Modules and Name space
- Date: Wed, 15 Sep 2004 19:25:12 -0400
On Wed, 2004-09-15 at 18:12, Ross McFarland wrote:
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.
Indeed, I plan on implementing the majority of the UI::Dialog widgets.
Just haven't had the time or the need yet but it'll happen.
my only thought is that the above two examples don't follow the gtk+
naming schemes really. something like
I guess I wasn't too clear but I was asking for help in this arena.
Obviously "Message" is a horrible namespace and I was suggesting
Gtk2::UI::* but Gtk2::Ex::* sounds even better.
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.
This isn't about my wishes, it already does what I need it to do, this
is more about what the community wishes :)
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.
OK
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.
Thanks for the comments!
--
Kevin C. Krinke <kckrinke opendoorsoftware com>
Open Door Software Inc.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]