From: Masao M. <mu...@hi...> - 2005-08-27 04:47:29
|
Hi, This ML is for Ruby-GNOME, not Ruby-GNOME2, Join Ruby-GNOME2 develper mailinglist (ruby-gnome2-devel-en), please. #This message is CCed to ruby-gnome2-devel-en. See: http://sourceforge.net/mail/?group_id=53614 On Fri, 26 Aug 2005 19:32:28 +0200 Paul van Tilburg <pa...@lu...> wrote: > Hi, > > Having been able to use Ruby/GNOME2 for my job, and because of this I & > a colleague ran into some issues and got some ideas. We wrote them down > and I would like to post them here for discussion, discarding or TODO > purposes. > > Gdk > * Let Gdk::Event<type>.new defer to Gdk::Event.new(<type>) with the right type > (e.g. Gdk::EventExpose.new -> Gtk::Event.new(Gdk::Event::Type::EXPOSE)) > It isn't very Rubyish now, you have to do for example: > Gdk::EventExpose.new(Gdk::Event::Type::EXPOSE) You can omit ::Type:: here. Gdk::EventExpose.new(Gdk::Event::EXPOSE) How about the events which has plural type like below? Gdk::EventButton.new(Gdk::Event::BUTTON_PRESS) Gdk::EventButton.new(Gdk::Event::BUTTON_PRESS1) Gdk::EventButton.new(Gdk::Event::BUTTON_PRESS2) > Glib2 > * GLib::IOChannel#shutdown is missing, but IOChannel#close (that has > been deprecated) is available. GLib::IOChannel#close is a wrapper of g_io_channel_shutdown(), not g_io_channel_close(). GLib::IOChannel changes the APIs to follow IO, File of Ruby standard library. # Sorry for lack of API documents. > Gtk2 > * Add alias '[]' for Gtk::UIManager#get_widget. Good idea. I'll add it. > * Add alias 'size_request=' for Gtk::Widget#set_size_request for > symmetry. Gtk::Widget#set_size_request(width, height) has 2 parameter. We use "=" parameter which method has A parameter. This is one of ruby-gnome2 API rule. > * Gtk::Dialog#run doesn't call it's own destroy when a block was a > provided. I would've suspected it to be analogous with File.open > (if block given, file is closed afterwords automatically, if not, > you have to do it yourself) Sure. This is a bug. I'll fix it. > * Can't the TreeModel include Enumerable? This would make it much > more Rubyish. Gtk::TreeModel? Hmm. I can't understand your idea. I want to know what you use them. Could you tell us the details with a simple sample(but executable) ? > * Raise an error for Gtk::UIManager when trying to merge /foo/bar when > /foo does not exist (this might be a Gtk issue though). Agreed. I'll fix it. #you mention Gtk::UIManager#get_widget, doesn't you? > * Trying to retrieve the ID of a Gtk::Plug when Gtk.init has not been > called leads to a segfault, try: Gtk::Plug.new.id. > Note that in many more occasions I have encountered that forgetting a > Gtk.init leads to a segfault. It's well know issue. But I don't have good idea to avoid it. > GStreamer I hope Laurent reply GStreamer's comments below. > * Add alias '>>' to Gst::Pad#link for symmetry with Gst::Element#link. > (This might pose a problem though, because it is not chainable.) > * Add alias [](pad) to Gst::Element#get_pad(pad) > * Alias Gst::Bin#each_element to Gst::Bin#each. > * Add Gst::Element.to_s. > * Gst::Caps#get_structure but no Gst::Caps#structure > * Some inspects of Gst::Pads are shown as #<#<Class:0x.....>>. > It's a pity our time (for the job) was up, I would really have liked to > contribute some stuff, but I am really too busy with a dozen of other > things. > I hope these ideas/suggestions are helpful for the future, if not it's > no bother. :) You're welcome ;). -- .:% Masao Mutoh<mu...@hi...> |