Re: Gtk/Perl syntax



Words Of Owen Taylor:
>
>I'm ambivalent about exporting - the only thing you gain is one character
>(gtk_init instead of Gtk::init). It would allow making Gtk not a
>toplevel module though ...

I guess I don't like to use ::'s in any of my code because I prefer to
view things inside packages as private.  Most things seem to follow
this by exporting and using objects.

One other thing I was thinking, but might not like as much, is to
create a gtk object (via new) and create all objects from that
"master object" so that you do not have to do Gtk::button_new but
instead $button = $gtk_obj->button_new();  This would not be a parent
in this case, but would allieviate the ::'s.  Everything else you
have would work with this easily and new() would be about 5-10 lines.
New could also do "init", so that it is not an extra call.

That method would also facilitate setting any gtk global variables
without setting mysterious variables in the package; a little "cleaner"
way to do it.  (?? No, I don't know what that would be -- perhaps in 
the future something like which widget style to draw.)

Just additional ideas for the idea pool...

--
Shawn T. Amundson		University of Minnesota
Systems Administration	 	Computer Science System Staff
amundson@cs.umn.edu	  	http://www.cs.umn.edu/~amundson/     	

I'm fairly convinced that when God drinks beer, he drinks Guinness.

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



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