Subject: Re: [ruby-gnome2-devel-en] Gtk3: how to use Gtk::DrawingArea
Windows
Date: Thu 12 Jan 12 09:56:19PM +0900
Quoting Kouhei S. ([email protected]):
If you have time, could you make gtk3/sample/**/*.rb GTK+ 3
ready? I you can help us, I’ll add you to the Ruby-GNOME2 team.
Sadly, time is not the most available commodity these days. Yesterday
I tried my hand at the samples/misc directory. I attach a diff file.
Some notes:
First of all, I cannot manage the samples/testgtk part. It uses
Gtk::RC, which is deprecated, and the suggested substitute is
Gtk::StyleContext. They both use external files to define the theming,
but the language they use is different. I never use external theming,
and I should learn both the old and the new definition language to be
able to do a port.
Then, specifically about samples/misc:
-
uimanager.rb failed because of a bug in rbgtkactiongroup.c. The
attached diff file contains the relative patch.
-
combo_check.rb, fileselection.rb, gc.rb, itemfactory.rb,
itemfactory2.rb, pangorenderer.rb, xbm_cursor.rb should be removed
because the related material is deprecated.
-
aboutdialog.rb and aboutdialog2: the hooks for e-mail and url are
deprecated. The recommended way is to use the activate-link
signal. This means that the ‘.show’ method cannot use them anymore
(you need to access the dialog object). The unpleasant thing is that
the signal seems to be only triggered for URL’s, not for e-mail
addresses.
-
alpha-demo.rb and composited-windows.rb: widget.screen returns an
unnamed class (should be an instance of Gtk::Screen). Thus, the
scripts cannot work.
-
bindings.rb: it seems the j/k keys do not work. I never used this
stuff, don’t know what should happen.
-
colorselection.rb: gives this error:
colorselection.rb:15:in set_change_palette_hook': wrong class variable name __palette_proc__ (NameError) from colorselection.rb:15:in
’
The error comes from C; I have no idea about how to solve this.
-
drawing.rb: Gtk::DrawingArea signal ‘configure_event’ returns an
instance of class ‘A’ as first parameter, not a window as it should.
-
keyboard_grab.rb: seems to do nothing… It is material I know
nothing about.
-
misc_button.rb: Gtk::ColorButton.new gives this error message:
Gtk-CRITICAL **:gtk_widget_set_size_request: assertion `width >= -1’
failed
The button appears (although quite thin), and the color selection
dialog appears, too.
-
mouse_gesture.rb: can’t understand what it should do.
-
pointer_grab.rb: segfaults when pressing ‘Grab Window’ button:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff142e306 in gdk_cursor_get_display () from
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0
- properties.rb: gives this error:
properties.rb:72:in initialize': integer 140209423028720 too big to convert to
unsigned int’ (RangeError)
from properties.rb:72:in gtype' from properties.rb:72:in
’
(field in question is gtype, runs OK when line 72 is commented out)
- settings.rb, style_property.rb: both scripts segfault in a similar
way:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5f0ea6d in g_type_is_a () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
(happens in GLib::Param::Enum.new)
-
statusicon.rb: (apart from the fact that tooltip and blinking seem
not to be available anymore for Gtk::StatusIcon): no window appears. I
never used this. Don’t know what it should do.
-
stock.rb: stock image does not appear. I never used the Image class,
so I have no idea how this should be modified.
-
textbuffer_serialize.rb: I can change colors and fonts, but then
when I recover a saved file, I receive something like:
textbuffer_serialize.rb:50:in `deserialize’: Line 17 character 61: Tag
“[7334, 30393, 51410]” does not exist in buffer and tags can not be
created.
I know nothing about this serializing/deserializing stuff…
I will add that, in my version of Gtk3, TextView and ToolBar seem not
to resize correctly - set_size_request seems not to have the desired
effect.
This is all. I will tackle sample/gtk-demo when I come across some
more free time.
Carlo