You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(6) |
Sep
(16) |
Oct
(36) |
Nov
(85) |
Dec
(151) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(49) |
Feb
(51) |
Mar
(71) |
Apr
(87) |
May
(91) |
Jun
(93) |
Jul
(160) |
Aug
(229) |
Sep
(85) |
Oct
(89) |
Nov
(85) |
Dec
(98) |
2004 |
Jan
(40) |
Feb
(98) |
Mar
(149) |
Apr
(106) |
May
(153) |
Jun
(77) |
Jul
(85) |
Aug
(55) |
Sep
(50) |
Oct
(53) |
Nov
(83) |
Dec
(32) |
2005 |
Jan
(97) |
Feb
(124) |
Mar
(60) |
Apr
(79) |
May
(55) |
Jun
(62) |
Jul
(70) |
Aug
(130) |
Sep
(115) |
Oct
(32) |
Nov
(46) |
Dec
(54) |
2006 |
Jan
(114) |
Feb
(78) |
Mar
(37) |
Apr
(54) |
May
(82) |
Jun
(34) |
Jul
(54) |
Aug
(50) |
Sep
(26) |
Oct
(46) |
Nov
(105) |
Dec
(83) |
2007 |
Jan
(105) |
Feb
(64) |
Mar
(57) |
Apr
(20) |
May
(18) |
Jun
(80) |
Jul
(108) |
Aug
(26) |
Sep
(36) |
Oct
(49) |
Nov
(94) |
Dec
(46) |
2008 |
Jan
(24) |
Feb
(24) |
Mar
(200) |
Apr
(92) |
May
(112) |
Jun
(54) |
Jul
(41) |
Aug
(50) |
Sep
(66) |
Oct
(82) |
Nov
(15) |
Dec
(44) |
2009 |
Jan
(68) |
Feb
(34) |
Mar
(55) |
Apr
(50) |
May
(95) |
Jun
(33) |
Jul
(24) |
Aug
(40) |
Sep
(61) |
Oct
(33) |
Nov
(7) |
Dec
(61) |
2010 |
Jan
(18) |
Feb
(47) |
Mar
(24) |
Apr
(24) |
May
(42) |
Jun
(59) |
Jul
(28) |
Aug
(23) |
Sep
(55) |
Oct
(102) |
Nov
(33) |
Dec
(11) |
2011 |
Jan
(37) |
Feb
(115) |
Mar
(96) |
Apr
(37) |
May
(8) |
Jun
(13) |
Jul
(7) |
Aug
(61) |
Sep
(143) |
Oct
(78) |
Nov
(14) |
Dec
(33) |
2012 |
Jan
(49) |
Feb
(57) |
Mar
(62) |
Apr
(38) |
May
(26) |
Jun
(16) |
Jul
(12) |
Aug
(10) |
Sep
(8) |
Oct
(12) |
Nov
(38) |
Dec
(25) |
2013 |
Jan
(55) |
Feb
(53) |
Mar
(39) |
Apr
(37) |
May
(21) |
Jun
(4) |
Jul
(7) |
Aug
(8) |
Sep
(24) |
Oct
(17) |
Nov
(11) |
Dec
(81) |
2014 |
Jan
(22) |
Feb
(9) |
Mar
(29) |
Apr
(133) |
May
(12) |
Jun
(13) |
Jul
(5) |
Aug
(11) |
Sep
|
Oct
(10) |
Nov
(18) |
Dec
(1) |
2015 |
Jan
(18) |
Feb
(2) |
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(28) |
Oct
(15) |
Nov
(8) |
Dec
(7) |
2016 |
Jan
(19) |
Feb
|
Mar
|
Apr
(1) |
May
(10) |
Jun
(3) |
Jul
(19) |
Aug
|
Sep
(5) |
Oct
(1) |
Nov
(9) |
Dec
|
2017 |
Jan
|
Feb
(18) |
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(2) |
Dec
|
From: Kouhei S. <ko...@co...> - 2014-11-02 01:41:13
|
> In Clutter 1.14, this easing_delay property methods work fine. > + omit_on_travis_ci Why did you use Clutter version to determine whether the test is omitted or not? Is there any Travis CI specific problem? In <eb4...@je...> "[ruby-gnome2-cvs] ruby-gnome2/ruby-gnome2@eb4e3a8 [master] clutter test: add omit to easing_delay test" on Sun, 02 Nov 2014 02:00:40 +0900, Hiroshi Hatake <nu...@co...> wrote: > Hiroshi Hatake 2014-11-02 02:00:40 +0900 (Sun, 02 Nov 2014) > > New Revision: eb4e3a8ef298d71e2e22cef6636f786f760e1bd6 > https://github.com/ruby-gnome2/ruby-gnome2/commit/eb4e3a8ef298d71e2e22cef6636f786f760e1bd6 > > Message: > clutter test: add omit to easing_delay test > > Older clutter does not work correctly `Clutter::Actor#easing_delay`? :< > > In Clutter 1.14, this easing_delay property methods work fine. > > Modified files: > clutter/test/test-clutter-actor.rb > > Modified: clutter/test/test-clutter-actor.rb (+1 -0) > =================================================================== > --- clutter/test/test-clutter-actor.rb 2014-11-02 02:00:12 +0900 (9b6b18b) > +++ clutter/test/test-clutter-actor.rb 2014-11-02 02:00:40 +0900 (c8399c6) > @@ -83,6 +83,7 @@ class ClutterActorTest < Test::Unit::TestCase > end > > def test_easing_delay > + omit_on_travis_ci > delay_msec = 300 > @actor.easing_delay = delay_msec > assert_equal(delay_msec, @actor.easing_delay) |
From: Masafumi Y. <my...@gm...> - 2014-10-26 17:43:34
|
Hi, 2014-09-01 0:36 GMT+09:00 Detlef Reichl <det...@gm...>: > `const_missing': uninitialized constant Gdk::Window::ModifierType > (NameError) This problem has fixed in master on GitHub. I would be glad if you could retry. https://github.com/ruby-gnome2/ruby-gnome2/commit/397143ae84f9521c3a89f8ceed6048b4acbf119a > The strange thing is, that if I require gdk3 in irb, Gdk has the > following constants defined: > > irb(main):001:0> require 'gdk3' > => true > irb(main):002:0> Gdk.constants > => [:Pixbuf, :PixbufError, :PixbufAnimation, :PixbufAnimationIter, > :PixbufSimpleAnim, :Pixdata, :PixbufLoader, :PixbufFormat, :GrabStatus, > :Atom, :Color, :Status, :Cursor, :Device, :DeviceManager, :Display, > :DisplayManager, :DragContext, :Event, :EventAny, :EventExpose, > :EventVisibility, :EventMotion, :EventButton, :EventTouch, :EventScroll, > :EventKey, :EventCrossing, :EventFocus, :EventConfigure, :EventProperty, > :EventSelection, :EventOwnerChange, :EventProximity, :EventDND, > :EventWindowState, :EventSetting, :EventGrabBroken, :Geometry, :Keymap, > :Keyval, :Pango, :Property, :Rectangle, :RGBA, :Screen, :Selection, > :Threads, :TimeCoord, :Visual, :Window, :WindowAttr, :LOG_DOMAIN, :Pixmap] > > > but if gdk3 is required from gtk3-gi Gdk has only the following > constants defined: > > irb(main):001:0> require 'gtk3-gi' > => true > irb(main):002:0> Gdk.constants > => [:Pixbuf, :PixbufError, :PixbufAnimation, :PixbufAnimationIter, > :PixbufSimpleAnim, :Pixdata, :PixbufLoader, :PixbufFormat, :Loader, > :LOG_DOMAIN, :Error] This behavior is as expected in GObject-Introspection based bindings. The constants are defined at the first time of calling a constant. --- irb(main):001:0> require "gtk3-gi" => true irb(main):002:0> Gdk.constants => [:Pixbuf, :PixbufError, :PixbufAnimation, :PixbufAnimationIter, :PixbufSimpleAnim, :Pixdata, :PixbufLoader, :PixbufFormat, :Loader, :LOG_DOMAIN, :Error] irb(main):003:0> Gdk::Window => Gdk::Window irb(main):004:0> Gdk.constants => [:Pixbuf, :PixbufError, :PixbufAnimation, :PixbufAnimationIter, :PixbufSimpleAnim, :Pixdata, :PixbufLoader, :PixbufFormat, :Loader, :LOG_DOMAIN, :Error, :Keyval, :Selection, :Rectangle, :AppLaunchContext, :Atom, :AxisUse, :BUTTON_MIDDLE, :BUTTON_PRIMARY, :BUTTON_SECONDARY, :ByteOrder, :CURRENT_TIME, :Color, :CrossingMode, :Cursor, :CursorType, :Device, :DeviceManager, :DeviceType, :Display, :DisplayManager, :DragAction, :DragContext, :DragProtocol, :Event, :EventAny, :EventButton, :EventConfigure, :EventCrossing, :EventDND, :EventExpose, :EventFocus, :EventGrabBroken, :EventKey, :EventMask, :EventMotion, :EventOwnerChange, :EventProperty, :EventProximity, :EventScroll, :EventSelection, :EventSequence, :EventSetting, :EventTouch, :EventType, :EventVisibility, :EventWindowState, :FilterReturn, :FrameClock, :FrameClockPhase, :FrameClockPrivate, :FrameTimings, :FullscreenMode, :Geometry, :GrabOwnership, :GrabStatus, :Gravity, :InputMode, :InputSource, :Keymap, :KeymapKey, :MAX_TIMECOORD_AXES, :ModifierIntent, :ModifierType, :NotifyType, :OwnerChange, :PARENT_RELATIVE, :PRIORITY_REDRAW, :Point, :PropMode, :PropertyState, :RGBA, :Screen, :ScrollDirection, :SettingAction, :Status, :TimeCoord, :VisibilityState, :Visual, :VisualType, :WMDecoration, :WMFunction, :Window, :WindowAttr, :WindowAttributesType, :WindowEdge, :WindowHints, :WindowRedirect, :WindowState, :WindowType, :WindowTypeHint, :WindowWindowClass, :Pixmap, :Property] --- Regards, myokoym |
From: Masafumi Y. <my...@gm...> - 2014-10-26 12:06:20
|
Hi, The Ruby-GNOME2 project released Ruby-GNOME2 2.2.3: http://ruby-gnome2.sourceforge.jp/?News_20141026_1 It's a bug fix release for Ruby-GNOME2 2.2.1 and 2.2.2. We recommend you upgrade, especially if your application uses thread and runs on Ruby 2.0 or later. Best regards, myokoym |
From: Kouhei S. <ko...@co...> - 2014-10-25 09:43:11
|
Hi, In <CAKHkkfPNOfPhkW5Eunef+qCbJyR=kBNN8vKpwfwA-d=Gy...@ma...> "Re: [ruby-gnome2-devel-en] [ruby-gnome2-cvs] ruby-gnome2/ruby-gnome2@0d20af2 [master] clutter test: add Clutter::ShaderEffect tests" on Sat, 25 Oct 2014 18:23:43 +0900, hiroshi hatake <cos...@gm...> wrote: >> Do Ruby/Clutter users want to use Clutter::ShaderEffect? > > > If Ruby/Clutter users want to use Clutter::ShaderEffect, we'll make gi > based cogl binding. > But, Clutter::ShaderEffect is too advanced feature, I think. > For now, it is better to consider as using Clutter::ShaderEffect at your > own risk. It's reasonable. We don't create Cogl bindings for now. Thanks, -- kou |
From: hiroshi h. <cos...@gm...> - 2014-10-25 09:23:51
|
Hi, > But, Ruby-GNOME2 does not have (gi based) cogl binding. > > > > Should it do treat cogl? > > If we need it, we'll do it. > > Yes, we'll do it if needed. ;) > Do Ruby/Clutter users want to use Clutter::ShaderEffect? If Ruby/Clutter users want to use Clutter::ShaderEffect, we'll make gi based cogl binding. But, Clutter::ShaderEffect is too advanced feature, I think. For now, it is better to consider as using Clutter::ShaderEffect at your own risk. |
From: Kouhei S. <ko...@co...> - 2014-10-24 12:25:31
|
> But, Ruby-GNOME2 does not have (gi based) cogl binding. > > Should it do treat cogl? If we need it, we'll do it. Do Ruby/Clutter users want to use Clutter::ShaderEffect? In <0d2...@je...> "[ruby-gnome2-cvs] ruby-gnome2/ruby-gnome2@0d20af2 [master] clutter test: add Clutter::ShaderEffect tests" on Fri, 24 Oct 2014 20:09:20 +0900, Hiroshi Hatake <nu...@co...> wrote: > Hiroshi Hatake 2014-10-24 20:09:20 +0900 (Fri, 24 Oct 2014) > > New Revision: 0d20af2c78790861447c609738c54ea230df2feb > https://github.com/ruby-gnome2/ruby-gnome2/commit/0d20af2c78790861447c609738c54ea230df2feb > > Message: > clutter test: add Clutter::ShaderEffect tests > > * clutter depends cogl. > * Cogl::Handler(CoglHandler) and Cogl::INVALID_HANDLE(COGL_INVALID_HANDLE) > appears in C library code. > But, Ruby-GNOME2 does not have (gi based) cogl binding. > > Should it do treat cogl? > > - make gi based cogl binding to easliy treat cogl related things. > e.g. Cogl::INVALID_HANDLE constant > - use magic number to treat code which is related to cogl.(sees to be > bad.... Now using this workaround, sorry.) > > Added files: > clutter/test/test-clutter-shader-effect.rb > > Added: clutter/test/test-clutter-shader-effect.rb (+65 -0) 100644 > =================================================================== > --- /dev/null > +++ clutter/test/test-clutter-shader-effect.rb 2014-10-24 20:09:20 +0900 (379f17a) > @@ -0,0 +1,65 @@ > +# Copyright (C) 2014 Ruby-GNOME2 Project Team > +# > +# This library is free software; you can redistribute it and/or > +# modify it under the terms of the GNU Lesser General Public > +# License as published by the Free Software Foundation; either > +# version 2.1 of the License, or (at your option) any later version. > +# > +# This library is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +# Lesser General Public License for more details. > +# > +# You should have received a copy of the GNU Lesser General Public > +# License along with this library; if not, write to the Free Software > +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA > + > +class ClutterShaderEffect < Test::Unit::TestCase > + include ClutterTestUtils > + > + def setup > + @shader_effect = Clutter::ShaderEffect.new(Clutter::ShaderType::FRAGMENT_SHADER) > + @fragment_shader_source = <<-EOS > +#ifdef GL_ES > +precision mediump float; > +#endif > + > +void main( void ) { > + gl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 ); > +} > +EOS > + # TODO: use original Cogl::INVALID_HANDLE > + # original value: NULL > + # ref: https://developer.gnome.org/cogl/1.18/cogl-General-API.html#COGL-INVALID-HANDLE:CAPS > + # It should create cogl gi based binding? > + @cogl_invalid_handle = 0 > + end > + > + def test_set_uniform_value > + gvalue = 1.0 > + assert_nothing_raised do > + @shader_effect.set_uniform_value("components", gvalue) > + end > + end > + > + def test_set_shader_source > + result = @shader_effect.set_shader_source(@fragment_shader_source) > + assert_true(result) > + end > + > + def test_get_program > + @shader_effect.shader_source = @fragment_shader_source > + assert_not_equal(@cogl_invalid_handle, @shader_effect.program) > + end > + > + def test_get_shader > + @shader_effect.shader_source = @fragment_shader_source > + assert_not_equal(@cogl_invalid_handle, @shader_effect.shader) > + end > + > + class TestEnum < self > + def test_shader_type > + assert_const_defined(Clutter::ShaderType, :VERTEX_SHADER) > + end > + end > +end |
From: Kouhei S. <ko...@co...> - 2014-10-22 14:25:06
|
> + case method_name_or_sym.class > + when String > + method_sym = method_name_or_sym.to_sym > + else > + method_sym = method_name_or_sym > + end This code is buggy. "when String" clause isn't used even if method_name_or_sym is a String object. In <67b...@je...> "[ruby-gnome2-cvs] ruby-gnome2/ruby-gnome2@67b0866 [master] vte3-gi test: omit_if_not_respond can accept String and Symbol in second argument explicitly" on Wed, 22 Oct 2014 23:08:38 +0900, Hiroshi Hatake <nu...@co...> wrote: > Hiroshi Hatake 2014-10-22 23:08:38 +0900 (Wed, 22 Oct 2014) > > New Revision: 67b086616255715d12567a6a7d01e43f6a90ee84 > https://github.com/ruby-gnome2/ruby-gnome2/commit/67b086616255715d12567a6a7d01e43f6a90ee84 > > Message: > vte3-gi test: omit_if_not_respond can accept String and Symbol in second argument explicitly > > Modified files: > vte3-gi/test/vte3-test-utils.rb > > Modified: vte3-gi/test/vte3-test-utils.rb (+9 -3) > =================================================================== > --- vte3-gi/test/vte3-test-utils.rb 2014-10-22 22:57:10 +0900 (56f1191) > +++ vte3-gi/test/vte3-test-utils.rb 2014-10-22 23:08:38 +0900 (69ab248) > @@ -19,9 +19,15 @@ require "test/unit/notify" > > module VteTestUtils > private > - def omit_if_not_respond(instance, method) > - unless instance.respond_to?(method.to_sym) > - omit("#{instance.class}##{method} is not respond.") > + def omit_if_not_respond(instance, method_name_or_sym) > + case method_name_or_sym.class > + when String > + method_sym = method_name_or_sym.to_sym > + else > + method_sym = method_name_or_sym > + end > + unless instance.respond_to?(method_sym) > + omit("#{instance.class}##{method_sym} is not respond.") > end > end > end |
From: Kouhei S. <ko...@co...> - 2014-10-22 12:39:33
|
> @effect.brightness) > + > + brightness_red = 120 > + brightness_green = 200 > + brightness_blue = 250 > + @effect.set_brightness(brightness_red, brightness_green, > + brightness_blue) > + assert_equal([brightness_red, brightness_green, brightness_blue], > + @effect.brightness) > end Please don't add two or more checks in one test. Please create another test. In <044...@je...> "[ruby-gnome2-cvs] ruby-gnome2/ruby-gnome2@044f116 [master] clutter test: add test for rubyish converted methods" on Wed, 22 Oct 2014 19:51:16 +0900, Hiroshi Hatake <nu...@co...> wrote: > Hiroshi Hatake 2014-10-22 19:51:16 +0900 (Wed, 22 Oct 2014) > > New Revision: 044f1162a72d8aa9e10229aa53ef354548495315 > https://github.com/ruby-gnome2/ruby-gnome2/commit/044f1162a72d8aa9e10229aa53ef354548495315 > > Message: > clutter test: add test for rubyish converted methods > > Modified files: > clutter/test/test-clutter-brightness-contrast-effect.rb > > Modified: clutter/test/test-clutter-brightness-contrast-effect.rb (+15 -0) > =================================================================== > --- clutter/test/test-clutter-brightness-contrast-effect.rb 2014-10-22 19:50:01 +0900 (666c8ed) > +++ clutter/test/test-clutter-brightness-contrast-effect.rb 2014-10-22 19:51:16 +0900 (6dfeeca) > @@ -26,6 +26,14 @@ class ClutterBrightnessContrastEffectTest < Test::Unit::TestCase > @effect.brightness = brightness > assert_equal([brightness, brightness, brightness], > @effect.brightness) > + > + brightness_red = 120 > + brightness_green = 200 > + brightness_blue = 250 > + @effect.set_brightness(brightness_red, brightness_green, > + brightness_blue) > + assert_equal([brightness_red, brightness_green, brightness_blue], > + @effect.brightness) > end > > def test_contrast_accessors > @@ -33,5 +41,12 @@ class ClutterBrightnessContrastEffectTest < Test::Unit::TestCase > @effect.contrast = contrast > assert_equal([contrast, contrast, contrast], > @effect.contrast) > + > + contrast_red = 250 > + contrast_green = 120 > + contrast_blue = 100 > + @effect.set_contrast(contrast_red, contrast_green, contrast_blue) > + assert_equal([contrast_red, contrast_green, contrast_blue], > + @effect.contrast) > end > end |
From: Kouhei S. <ko...@co...> - 2014-10-22 12:38:38
|
> + alias_method :set_contrast_full_raw, :set_contrast_full > + def set_contrast(contrast_all_or_red, contrast_green=nil, contrast_blue=nil) It seems that we don't need the alias_method. > + unless contrast_green > + contrast = contrast_all_or_red > + else We don't use "unless ... else" for readability. Please use "if ... else". By the way, the code is buggy. The assignment just set local variable. :-) In <f2c...@je...> "[ruby-gnome2-cvs] ruby-gnome2/ruby-gnome2@f2c3b2f [master] clutter: add Clutter::BrightnessContrastEffect::*_full wrapper methods" on Wed, 22 Oct 2014 21:17:02 +0900, Hiroshi Hatake <nu...@co...> wrote: > Hiroshi Hatake 2014-10-22 21:17:02 +0900 (Wed, 22 Oct 2014) > > New Revision: f2c3b2fb405867023f6ff2858340e48d95f29afb > https://github.com/ruby-gnome2/ruby-gnome2/commit/f2c3b2fb405867023f6ff2858340e48d95f29afb > > Message: > clutter: add Clutter::BrightnessContrastEffect::*_full wrapper methods > > Added files: > clutter/lib/clutter/brightness-contrast-effect.rb > > Added: clutter/lib/clutter/brightness-contrast-effect.rb (+42 -0) 100644 > =================================================================== > --- /dev/null > +++ clutter/lib/clutter/brightness-contrast-effect.rb 2014-10-22 21:17:02 +0900 (bb0630b) > @@ -0,0 +1,42 @@ > +# Copyright (C) 2014 Ruby-GNOME2 Project Team > +# > +# This library is free software; you can redistribute it and/or > +# modify it under the terms of the GNU Lesser General Public > +# License as published by the Free Software Foundation; either > +# version 2.1 of the License, or (at your option) any later version. > +# > +# This library is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +# Lesser General Public License for more details. > +# > +# You should have received a copy of the GNU Lesser General Public > +# License along with this library; if not, write to the Free Software > +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA > + > +module Clutter > + class BrightnessContrastEffect > + alias_method :set_contrast_full_raw, :set_contrast_full > + def set_contrast(contrast_all_or_red, contrast_green=nil, contrast_blue=nil) > + unless contrast_green > + contrast = contrast_all_or_red > + else > + contrast_red = contrast_all_or_red > + set_contrast_full_raw(contrast_red, contrast_green, > + contrast_blue) > + end > + end > + > + alias_method :set_brightness_full_raw, :set_brightness_full > + def set_brightness(brightness_all_or_red, brightness_green=nil, > + brightness_blue=nil) > + unless brightness_green > + brightness = brightness_all_or_red > + else > + brightness_red = brightness_all_or_red > + set_brightness_full_raw(brightness_red, brightness_green, > + brightness_blue) > + end > + end > + end > +end |
From: Kouhei S. <ko...@co...> - 2014-10-22 12:17:44
|
Hi, We should fix it in upstream. GObject Introspection has renaming feature. For example, GLib renames g_timeout_add_full() to g_timeout_add() by "Rename to: g_timeout_add" annotation: https://git.gnome.org/browse/glib/tree/glib/gmain.c#n4632 Clutter should also do it. Could you report it to Clutter developers? In <9de...@je...> "[ruby-gnome2-cvs] ruby-gnome2/ruby-gnome2@9def9fa [master] clutter: add rubyish method convert rule" on Wed, 22 Oct 2014 19:50:01 +0900, Hiroshi Hatake <nu...@co...> wrote: > Hiroshi Hatake 2014-10-22 19:50:01 +0900 (Wed, 22 Oct 2014) > > New Revision: 9def9fa88ccbee7999e998989e65886425d31855 > https://github.com/ruby-gnome2/ruby-gnome2/commit/9def9fa88ccbee7999e998989e65886425d31855 > > Message: > clutter: add rubyish method convert rule > > Modified files: > clutter/lib/clutter.rb > > Modified: clutter/lib/clutter.rb (+12 -0) > =================================================================== > --- clutter/lib/clutter.rb 2014-10-22 01:57:25 +0900 (e97ac7c) > +++ clutter/lib/clutter.rb 2014-10-22 19:50:01 +0900 (a56c2f2) > @@ -154,5 +154,17 @@ module Clutter > @other_constant_infos << info > end > end > + > + def rubyish_method_name(info) > + name = super > + case name > + when "set_brightness_full" > + "set_brightness" > + when "set_contrast_full" > + "set_contrast" > + else > + name > + end > + end > end > end |
From: Masafumi Y. <my...@gm...> - 2014-10-13 14:42:23
|
Hi, The Ruby-GNOME2 project released Ruby-GNOME2 2.2.1: http://ruby-gnome2.sourceforge.jp/?News_20141012_1 == Summary * Supports Ruby 2.2.0-preview1 * Ruby/GDK3 is migrated to GI based bindings * Ruby/GooCanvas is removed === Ruby/GDK3 is migrated to GI based bindings It is a release that Ruby/GDK3 is migrated to Ruby/GObjectIntrospection based bindings. Some API changes in Ruby/GDK3 are expected but unexpected API changes may exist. If you find API change, please report it. If the API change provides non Rubyish API, it will be a bug. === Ruby/GooCanvas is removed Ruby/GooCanvas is removed because GooCanvas is not recently updated and we can't maintain it. Please use Ruby/Clutter for a canvas widget. Thanks, myokoym |
From: Detlef R. <det...@gm...> - 2014-08-31 17:56:41
|
Hi, Gtk::AccelGroup#connect in "gtk-gi" expects four arguments, but in "gtk" only expects three. The last argument in C is a GClosure, which was in "gtk" a block argument. It seems that the block is not accepted as the last argument. Cheers, detlef |
From: Detlef R. <det...@gm...> - 2014-08-31 15:49:22
|
Hi, I wanted to try out gkt3-gi from current git. If I start a program where I had changed the require call from 'gtk3' to 'gtk3-gi' it fails with the message: `const_missing': uninitialized constant Gdk::Window::ModifierType (NameError) The strange thing is, that if I require gdk3 in irb, Gdk has the following constants defined: irb(main):001:0> require 'gdk3' => true irb(main):002:0> Gdk.constants => [:Pixbuf, :PixbufError, :PixbufAnimation, :PixbufAnimationIter, :PixbufSimpleAnim, :Pixdata, :PixbufLoader, :PixbufFormat, :GrabStatus, :Atom, :Color, :Status, :Cursor, :Device, :DeviceManager, :Display, :DisplayManager, :DragContext, :Event, :EventAny, :EventExpose, :EventVisibility, :EventMotion, :EventButton, :EventTouch, :EventScroll, :EventKey, :EventCrossing, :EventFocus, :EventConfigure, :EventProperty, :EventSelection, :EventOwnerChange, :EventProximity, :EventDND, :EventWindowState, :EventSetting, :EventGrabBroken, :Geometry, :Keymap, :Keyval, :Pango, :Property, :Rectangle, :RGBA, :Screen, :Selection, :Threads, :TimeCoord, :Visual, :Window, :WindowAttr, :LOG_DOMAIN, :Pixmap] but if gdk3 is required from gtk3-gi Gdk has only the following constants defined: irb(main):001:0> require 'gtk3-gi' => true irb(main):002:0> Gdk.constants => [:Pixbuf, :PixbufError, :PixbufAnimation, :PixbufAnimationIter, :PixbufSimpleAnim, :Pixdata, :PixbufLoader, :PixbufFormat, :Loader, :LOG_DOMAIN, :Error] If I add require 'gdk3' in front of require 'gtk3-gi' it at least gets a little bit further and fails in Gtk. Is it necessary to require gdk3 directly? Cheers, detlef |
From: Michael B. <be...@ju...> - 2014-08-20 06:46:17
|
Hi, many thanks for your example. If I move the "th.join" into the last line, after Gtk.main, it works as expected: Prints a zero, displays the window, displays the next numbers. I will look into this. Cheers Michael Am Dienstag, den 19.08.2014, 16:26 +0200 schrieb Detlef Reichl: > #!/usr/bin/env ruby > > require 'gtk3' > > class Win < Gtk::Window > def initialize > super > button = Gtk::Button.new :label => 'click' > add button > button.signal_connect(:clicked) {p 'clicked'} > end > end > > th = Thread.new do > 0.upto(5) do |i| > p i > sleep 0.5 > end > end > th.join > > win = Win.new > win.show_all > Gtk.main |
From: Mike C. <mik...@gm...> - 2014-08-19 21:40:02
|
I know this doesn't help your problem directly at all, but I thought I would mention it anyway. Many years ago I had problems with threads and GTK. Eventually I gave up and used the on_idle call to run code when the UI wasn't being used. If you partition your problem and process little bits at a time, it will work smoothly in the background. It seems like a pain in the neck and you might ask yourself why should you write your own scheduler. But in reality, I have used this technique quite often professionally and find that I can control the reactiveness of the UI much, much better. Even when I have real threads, I often find this works better. Also no need for mutex. Anyway, given the event loop in GTK, this is essentially the reactor pattern. The timing is a bit bad because I'm just off on holiday soon, but I can try to provide some code examples in a little over a week if anyone is interested. On 19 August 2014 15:26, Detlef Reichl <det...@gm...> wrote: > Hi, > > because I also do not have a flickr account, I wrote this little test: > > > #!/usr/bin/env ruby > > require 'gtk3' > > class Win < Gtk::Window > def initialize > super > button = Gtk::Button.new :label => 'click' > add button > button.signal_connect(:clicked) {p 'clicked'} > end > end > > th = Thread.new do > 0.upto(5) do |i| > p i > sleep 0.5 > end > end > th.join > > win = Win.new > win.show_all > Gtk.main > > > If I start it, first the count down of the thread completely runs down > and then the window appears. If I remove the th.join call the window > will be shown directly, but the countdown often hangs at start, stops if > the pointer leaves the window. Also the program terminates, when the > thread ends. Afaik the window remain in this case, right? > > Cheers, detlef > > > > Am 19.08.2014 14:32, schrieb Kouhei Sutou: > > Hi, > > > > Could you show a workable code without flicker account? > > I don't have flicker account. So I couldn't try your > > code... :< > > > > Thanks, > > -- > > kou > > > > In <6d5...@em...> > > "Re: [ruby-gnome2-devel-en] Displaying web images" on Tue, 19 Aug 2014 > 09:36:55 +0200, > > Michael Below <be...@ju...> wrote: > > > >> Hi, > >> do you think this can be fixed? > >> Doing downloads in the background is pretty important for my project, I > don't want long gaps between the sets. > >> Cheers > >> Michael > >> > >> On 18. August 2014 18:38:59 MESZ, Detlef Reichl <det...@gm...> > wrote: > >>> Hi, > >>> > >>> I think, that it is a bug in current (ruby) gtk. Not even the example > >>> in > >>> the ruby-gnome source in > >>> > >>> ruby-gnome2/gtk3/sample/misc/hreads.rb > >>> > >>> runs as expected. > >>> > >>> Cheers, detlef > >>> > >>> > >>> Am 17.08.2014 21:56, schrieb Michael Below: > >>>> > >>>> Hi, > >>>> > >>>> I would like to download a series of images, and then the next one, > >>> not > >>>> individual images. That way I get a broader selection of images > >>>> (including older ones with the first download, newer ones later). > >>>> > >>>> I am including my current code below. I tried loading a second set of > >>>> images after starting the auto_show, but the whole download is done > >>>> before the first image is shown. > >>>> > >>>> Best > >>>> Michael > >>>> > >>>> > >>>> -snip- > >>>> > >>>> require 'gtk3' > >>>> require 'open-uri' > >>>> require 'tempfile' > >>>> require 'flickraw' > >>>> > >>>> class RubyApp < Gtk::Window > >>>> > >>>> def initialize > >>>> super > >>>> > >>>> signal_connect "destroy" do > >>>> Gtk.main_quit end > >>>> > >>>> set_default_size 300, 200 > >>>> maximize > >>>> set_window_position Gtk::Window::Position::CENTER > >>>> > >>>> @pixbufs = [] > >>>> @flickpixbufs = [] > >>>> iswindow = true > >>>> > >>>> > >>>> FlickRaw.api_key= > >>>> FlickRaw.shared_secret= > >>>> > >>>> flickthread = Thread.new { > >>>> flickresults = flickr.photos.search(:tags => "Tag", :per_page > >>> => > >>>> 50) > >>>> > >>>> getimages(flickresults,"FlickRaw.url_b(currentresult)",@flickpixbufs) > >>>> } > >>>> > >>>> # event handler > >>>> signal_connect("key-press-event") do |_widget, event| > >>>> case event.keyval > >>>> when Gdk::Keyval::GDK_KEY_Right > >>>> @pixbufs.push(@pixbufs.shift) > >>>> update_image(@pixbufs.first) > >>>> when Gdk::Keyval::GDK_KEY_Left > >>>> @pixbufs.unshift(@pixbufs.pop) > >>>> update_image(@pixbufs.first) > >>>> when Gdk::Keyval::GDK_KEY_F11 > >>>> if iswindow > >>>> fullscreen > >>>> iswindow = false > >>>> else > >>>> unfullscreen > >>>> iswindow = true > >>>> end > >>>> end > >>>> end > >>>> > >>>> flickthread.join > >>>> @pixbufs = @flickpixbufs > >>>> update_image(@pixbufs.first) > >>>> > >>>> auto_show(@pixbufs) > >>>> > >>>> end > >>>> > >>>> def getimages(resultarray, method, pixbufsarray) > >>>> resultarray.each{|currentresult| > >>>> image_path = Tempfile.open("display-web-image-in-gtk") do | > >>>> tempfile| > >>>> begin > >>>> urlimage = open(eval(method)) > >>>> rescue OpenURI::HTTPError => e > >>>> puts e > >>>> puts "cannot load image" > >>>> break > >>>> end > >>>> tempfile.write(urlimage.read) > >>>> tempfile.path > >>>> end > >>>> unless image_path.nil? > >>>> fillpixbufs(image_path,pixbufsarray) > >>>> end > >>>> } > >>>> end > >>>> > >>>> def fillpixbufs(image,dlpixbufs) > >>>> begin > >>>> currentpixbuf = Gdk::Pixbuf.new(image) > >>>> rescue IOError => e > >>>> puts e > >>>> puts "cannot load images" > >>>> exit > >>>> end > >>>> maxheight = 700 > >>>> myheight = currentpixbuf.height > >>>> if myheight > maxheight > >>>> mywidth = currentpixbuf.width > >>>> newwidth=(mywidth*(maxheight.to_f/myheight)).round > >>>> > >>>> > >>> > currentpixbuf=currentpixbuf.scale(newwidth,maxheight,Gdk::Pixbuf::INTERP_BILINEAR) > >>>> end > >>>> puts image > >>>> dlpixbufs << currentpixbuf > >>>> end > >>>> > >>>> def auto_show(pixbufs) # auto mode > >>>> GLib::Timeout.add(600) do > >>>> @pixbufs.push(pixbufs.shift) > >>>> update_image(pixbufs.first) > >>>> true # continue > >>>> end > >>>> end > >>>> > >>>> def update_image(currentpixbuf) > >>>> if (defined?(@gtkimage)).nil? > >>>> @gtkimage = Gtk::Image.new :pixbuf => currentpixbuf > >>>> add @gtkimage > >>>> else > >>>> @gtkimage.set_pixbuf(currentpixbuf) > >>>> end > >>>> show_all > >>>> end > >>>> end > >>>> > >>>> > >>>> Gtk.init > >>>> window = RubyApp.new > >>>> Gtk.main > >>>> > >>>> -snip- > >>>> > >>>> > >>>> Am Sonntag, den 17.08.2014, 14:21 +0200 schrieb Detlef Reichl: > >>>>> Hi, > >>>>> > >>>>> I don't know, whats your code look like, but I would do it in this > >>> way: > >>>>> > >>>>> > >>>>> Create a thread, that loads down the images. Every time, an image is > >>>>> completely loaded a flag is set by the loader. Then it waits, that > >>> the > >>>>> flag is unset. > >>>>> > >>>>> The display system has a Fifo, where it cycles over with a timeout. > >>> In > >>>>> this timeout the loader flag is tested. If it is set, the image is > >>>>> pushed into the Fifo and the flag is unset after this. > >>>>> > >>>>> Cheers, detlef > >>>>> > >>>>> > >>>>> > >>>>> Am 17.08.2014 00:13, schrieb Michael Below: > >>>>>> Hi, > >>>>>> > >>>>>> I am working on the web display issue again. > >>>>>> Now I would like to refresh the images. I.e.: > >>>>>> > >>>>>> - get a set of 50 images > >>>>>> - display the first set, meanwhile get another set of 50 images > >>>>>> - as soon as the second set is downloaded, and the first set has > >>> been > >>>>>> shown at least once, switch from displaying first set to displaying > >>>>>> second set > >>>>>> - repeat infinitely > >>>>>> > >>>>>> Thanks to your help, I have got the code to display the first set > >>> of > >>>>>> pictures in a loop like this: > >>>>>> > >>>>>> def auto_show(pixbufs) # auto mode > >>>>>> GLib::Timeout.add(600) do > >>>>>> @pixbufs.push(pixbufs.shift) > >>>>>> update_image(pixbufs.first) > >>>>>> true # continue > >>>>>> end > >>>>>> end > >>>>>> > >>>>>> I guess I could add a second Timeout that switches the picture sets > >>>>>> every 5 minutes or so. But is there a way to change the picture > >>> sets > >>>>>> after successfully loading the next one? > >>>>>> > >>>>>> I successfully moved the download process into a separate thread, > >>> but I > >>>>>> can't get the download to run again and again while displaying > >>> images > >>>>>> and updating the buffer. > >>>>>> > >>>>>> Cheers > >>>>>> Michael > >>>>>> > >>>>>> > >>>>>> Am Montag, den 26.05.2014, 08:46 +0200 schrieb Michael Below: > >>>>>>> Hi, > >>>>>>> > >>>>>>> Am Montag, den 26.05.2014, 12:30 +0900 schrieb Masafumi Yokoyama: > >>>>>>> > >>>>>>>> A GTK window is just shown when `Gtk.main` is called. > >>>>>>>> `show_all` sets flag to be displayed to all widgets, but doesn't > >>>>>>>> actually display until `Gtk.main` is called. > >>>>>>> > >>>>>>> Ah, I understand... I even tried to move Gtk.main into my #each > >>> loop, > >>>>>>> but this way it makes sense. > >>>>>>> > >>>>>>>> It seems that need to design such as the following: > >>>>>>> > >>>>>>> Thanks, works fine. > >>>>>>> > >>>>>>> Cheers > >>>>>>> > >>>>>>> Michael > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>> > ------------------------------------------------------------------------------ > >>>>>> _______________________________________________ > >>>>>> ruby-gnome2-devel-en mailing list > >>>>>> rub...@li... > >>>>>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > >>>>>> > >>>>> > >>>>> > >>>>> > >>> > ------------------------------------------------------------------------------ > >>>>> _______________________________________________ > >>>>> ruby-gnome2-devel-en mailing list > >>>>> rub...@li... > >>>>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > >>>> > >>>> > >>>> > >>>> > >>>> > >>> > ------------------------------------------------------------------------------ > >>>> _______________________________________________ > >>>> ruby-gnome2-devel-en mailing list > >>>> rub...@li... > >>>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > >>>> > >>> > >>> > >>> > ------------------------------------------------------------------------------ > >>> _______________________________________________ > >>> ruby-gnome2-devel-en mailing list > >>> rub...@li... > >>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > > ruby-gnome2-devel-en mailing list > > rub...@li... > > https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > ruby-gnome2-devel-en mailing list > rub...@li... > https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > |
From: Detlef R. <det...@gm...> - 2014-08-19 14:26:29
|
Hi, because I also do not have a flickr account, I wrote this little test: #!/usr/bin/env ruby require 'gtk3' class Win < Gtk::Window def initialize super button = Gtk::Button.new :label => 'click' add button button.signal_connect(:clicked) {p 'clicked'} end end th = Thread.new do 0.upto(5) do |i| p i sleep 0.5 end end th.join win = Win.new win.show_all Gtk.main If I start it, first the count down of the thread completely runs down and then the window appears. If I remove the th.join call the window will be shown directly, but the countdown often hangs at start, stops if the pointer leaves the window. Also the program terminates, when the thread ends. Afaik the window remain in this case, right? Cheers, detlef Am 19.08.2014 14:32, schrieb Kouhei Sutou: > Hi, > > Could you show a workable code without flicker account? > I don't have flicker account. So I couldn't try your > code... :< > > Thanks, > -- > kou > > In <6d5...@em...> > "Re: [ruby-gnome2-devel-en] Displaying web images" on Tue, 19 Aug 2014 09:36:55 +0200, > Michael Below <be...@ju...> wrote: > >> Hi, >> do you think this can be fixed? >> Doing downloads in the background is pretty important for my project, I don't want long gaps between the sets. >> Cheers >> Michael >> >> On 18. August 2014 18:38:59 MESZ, Detlef Reichl <det...@gm...> wrote: >>> Hi, >>> >>> I think, that it is a bug in current (ruby) gtk. Not even the example >>> in >>> the ruby-gnome source in >>> >>> ruby-gnome2/gtk3/sample/misc/hreads.rb >>> >>> runs as expected. >>> >>> Cheers, detlef >>> >>> >>> Am 17.08.2014 21:56, schrieb Michael Below: >>>> >>>> Hi, >>>> >>>> I would like to download a series of images, and then the next one, >>> not >>>> individual images. That way I get a broader selection of images >>>> (including older ones with the first download, newer ones later). >>>> >>>> I am including my current code below. I tried loading a second set of >>>> images after starting the auto_show, but the whole download is done >>>> before the first image is shown. >>>> >>>> Best >>>> Michael >>>> >>>> >>>> -snip- >>>> >>>> require 'gtk3' >>>> require 'open-uri' >>>> require 'tempfile' >>>> require 'flickraw' >>>> >>>> class RubyApp < Gtk::Window >>>> >>>> def initialize >>>> super >>>> >>>> signal_connect "destroy" do >>>> Gtk.main_quit end >>>> >>>> set_default_size 300, 200 >>>> maximize >>>> set_window_position Gtk::Window::Position::CENTER >>>> >>>> @pixbufs = [] >>>> @flickpixbufs = [] >>>> iswindow = true >>>> >>>> >>>> FlickRaw.api_key= >>>> FlickRaw.shared_secret= >>>> >>>> flickthread = Thread.new { >>>> flickresults = flickr.photos.search(:tags => "Tag", :per_page >>> => >>>> 50) >>>> >>>> getimages(flickresults,"FlickRaw.url_b(currentresult)",@flickpixbufs) >>>> } >>>> >>>> # event handler >>>> signal_connect("key-press-event") do |_widget, event| >>>> case event.keyval >>>> when Gdk::Keyval::GDK_KEY_Right >>>> @pixbufs.push(@pixbufs.shift) >>>> update_image(@pixbufs.first) >>>> when Gdk::Keyval::GDK_KEY_Left >>>> @pixbufs.unshift(@pixbufs.pop) >>>> update_image(@pixbufs.first) >>>> when Gdk::Keyval::GDK_KEY_F11 >>>> if iswindow >>>> fullscreen >>>> iswindow = false >>>> else >>>> unfullscreen >>>> iswindow = true >>>> end >>>> end >>>> end >>>> >>>> flickthread.join >>>> @pixbufs = @flickpixbufs >>>> update_image(@pixbufs.first) >>>> >>>> auto_show(@pixbufs) >>>> >>>> end >>>> >>>> def getimages(resultarray, method, pixbufsarray) >>>> resultarray.each{|currentresult| >>>> image_path = Tempfile.open("display-web-image-in-gtk") do | >>>> tempfile| >>>> begin >>>> urlimage = open(eval(method)) >>>> rescue OpenURI::HTTPError => e >>>> puts e >>>> puts "cannot load image" >>>> break >>>> end >>>> tempfile.write(urlimage.read) >>>> tempfile.path >>>> end >>>> unless image_path.nil? >>>> fillpixbufs(image_path,pixbufsarray) >>>> end >>>> } >>>> end >>>> >>>> def fillpixbufs(image,dlpixbufs) >>>> begin >>>> currentpixbuf = Gdk::Pixbuf.new(image) >>>> rescue IOError => e >>>> puts e >>>> puts "cannot load images" >>>> exit >>>> end >>>> maxheight = 700 >>>> myheight = currentpixbuf.height >>>> if myheight > maxheight >>>> mywidth = currentpixbuf.width >>>> newwidth=(mywidth*(maxheight.to_f/myheight)).round >>>> >>>> >>> currentpixbuf=currentpixbuf.scale(newwidth,maxheight,Gdk::Pixbuf::INTERP_BILINEAR) >>>> end >>>> puts image >>>> dlpixbufs << currentpixbuf >>>> end >>>> >>>> def auto_show(pixbufs) # auto mode >>>> GLib::Timeout.add(600) do >>>> @pixbufs.push(pixbufs.shift) >>>> update_image(pixbufs.first) >>>> true # continue >>>> end >>>> end >>>> >>>> def update_image(currentpixbuf) >>>> if (defined?(@gtkimage)).nil? >>>> @gtkimage = Gtk::Image.new :pixbuf => currentpixbuf >>>> add @gtkimage >>>> else >>>> @gtkimage.set_pixbuf(currentpixbuf) >>>> end >>>> show_all >>>> end >>>> end >>>> >>>> >>>> Gtk.init >>>> window = RubyApp.new >>>> Gtk.main >>>> >>>> -snip- >>>> >>>> >>>> Am Sonntag, den 17.08.2014, 14:21 +0200 schrieb Detlef Reichl: >>>>> Hi, >>>>> >>>>> I don't know, whats your code look like, but I would do it in this >>> way: >>>>> >>>>> >>>>> Create a thread, that loads down the images. Every time, an image is >>>>> completely loaded a flag is set by the loader. Then it waits, that >>> the >>>>> flag is unset. >>>>> >>>>> The display system has a Fifo, where it cycles over with a timeout. >>> In >>>>> this timeout the loader flag is tested. If it is set, the image is >>>>> pushed into the Fifo and the flag is unset after this. >>>>> >>>>> Cheers, detlef >>>>> >>>>> >>>>> >>>>> Am 17.08.2014 00:13, schrieb Michael Below: >>>>>> Hi, >>>>>> >>>>>> I am working on the web display issue again. >>>>>> Now I would like to refresh the images. I.e.: >>>>>> >>>>>> - get a set of 50 images >>>>>> - display the first set, meanwhile get another set of 50 images >>>>>> - as soon as the second set is downloaded, and the first set has >>> been >>>>>> shown at least once, switch from displaying first set to displaying >>>>>> second set >>>>>> - repeat infinitely >>>>>> >>>>>> Thanks to your help, I have got the code to display the first set >>> of >>>>>> pictures in a loop like this: >>>>>> >>>>>> def auto_show(pixbufs) # auto mode >>>>>> GLib::Timeout.add(600) do >>>>>> @pixbufs.push(pixbufs.shift) >>>>>> update_image(pixbufs.first) >>>>>> true # continue >>>>>> end >>>>>> end >>>>>> >>>>>> I guess I could add a second Timeout that switches the picture sets >>>>>> every 5 minutes or so. But is there a way to change the picture >>> sets >>>>>> after successfully loading the next one? >>>>>> >>>>>> I successfully moved the download process into a separate thread, >>> but I >>>>>> can't get the download to run again and again while displaying >>> images >>>>>> and updating the buffer. >>>>>> >>>>>> Cheers >>>>>> Michael >>>>>> >>>>>> >>>>>> Am Montag, den 26.05.2014, 08:46 +0200 schrieb Michael Below: >>>>>>> Hi, >>>>>>> >>>>>>> Am Montag, den 26.05.2014, 12:30 +0900 schrieb Masafumi Yokoyama: >>>>>>> >>>>>>>> A GTK window is just shown when `Gtk.main` is called. >>>>>>>> `show_all` sets flag to be displayed to all widgets, but doesn't >>>>>>>> actually display until `Gtk.main` is called. >>>>>>> >>>>>>> Ah, I understand... I even tried to move Gtk.main into my #each >>> loop, >>>>>>> but this way it makes sense. >>>>>>> >>>>>>>> It seems that need to design such as the following: >>>>>>> >>>>>>> Thanks, works fine. >>>>>>> >>>>>>> Cheers >>>>>>> >>>>>>> Michael >>>>>> >>>>>> >>>>>> >>>>>> >>> ------------------------------------------------------------------------------ >>>>>> _______________________________________________ >>>>>> ruby-gnome2-devel-en mailing list >>>>>> rub...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en >>>>>> >>>>> >>>>> >>>>> >>> ------------------------------------------------------------------------------ >>>>> _______________________________________________ >>>>> ruby-gnome2-devel-en mailing list >>>>> rub...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en >>>> >>>> >>>> >>>> >>>> >>> ------------------------------------------------------------------------------ >>>> _______________________________________________ >>>> ruby-gnome2-devel-en mailing list >>>> rub...@li... >>>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> ruby-gnome2-devel-en mailing list >>> rub...@li... >>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > > ------------------------------------------------------------------------------ > _______________________________________________ > ruby-gnome2-devel-en mailing list > rub...@li... > https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > |
From: Kouhei S. <ko...@co...> - 2014-08-19 12:32:36
|
Hi, Could you show a workable code without flicker account? I don't have flicker account. So I couldn't try your code... :< Thanks, -- kou In <6d5...@em...> "Re: [ruby-gnome2-devel-en] Displaying web images" on Tue, 19 Aug 2014 09:36:55 +0200, Michael Below <be...@ju...> wrote: > Hi, > do you think this can be fixed? > Doing downloads in the background is pretty important for my project, I don't want long gaps between the sets. > Cheers > Michael > > On 18. August 2014 18:38:59 MESZ, Detlef Reichl <det...@gm...> wrote: >>Hi, >> >>I think, that it is a bug in current (ruby) gtk. Not even the example >>in >>the ruby-gnome source in >> >>ruby-gnome2/gtk3/sample/misc/hreads.rb >> >>runs as expected. >> >>Cheers, detlef >> >> >>Am 17.08.2014 21:56, schrieb Michael Below: >>> >>> Hi, >>> >>> I would like to download a series of images, and then the next one, >>not >>> individual images. That way I get a broader selection of images >>> (including older ones with the first download, newer ones later). >>> >>> I am including my current code below. I tried loading a second set of >>> images after starting the auto_show, but the whole download is done >>> before the first image is shown. >>> >>> Best >>> Michael >>> >>> >>> -snip- >>> >>> require 'gtk3' >>> require 'open-uri' >>> require 'tempfile' >>> require 'flickraw' >>> >>> class RubyApp < Gtk::Window >>> >>> def initialize >>> super >>> >>> signal_connect "destroy" do >>> Gtk.main_quit end >>> >>> set_default_size 300, 200 >>> maximize >>> set_window_position Gtk::Window::Position::CENTER >>> >>> @pixbufs = [] >>> @flickpixbufs = [] >>> iswindow = true >>> >>> >>> FlickRaw.api_key= >>> FlickRaw.shared_secret= >>> >>> flickthread = Thread.new { >>> flickresults = flickr.photos.search(:tags => "Tag", :per_page >>=> >>> 50) >>> >>> getimages(flickresults,"FlickRaw.url_b(currentresult)",@flickpixbufs) >>> } >>> >>> # event handler >>> signal_connect("key-press-event") do |_widget, event| >>> case event.keyval >>> when Gdk::Keyval::GDK_KEY_Right >>> @pixbufs.push(@pixbufs.shift) >>> update_image(@pixbufs.first) >>> when Gdk::Keyval::GDK_KEY_Left >>> @pixbufs.unshift(@pixbufs.pop) >>> update_image(@pixbufs.first) >>> when Gdk::Keyval::GDK_KEY_F11 >>> if iswindow >>> fullscreen >>> iswindow = false >>> else >>> unfullscreen >>> iswindow = true >>> end >>> end >>> end >>> >>> flickthread.join >>> @pixbufs = @flickpixbufs >>> update_image(@pixbufs.first) >>> >>> auto_show(@pixbufs) >>> >>> end >>> >>> def getimages(resultarray, method, pixbufsarray) >>> resultarray.each{|currentresult| >>> image_path = Tempfile.open("display-web-image-in-gtk") do | >>> tempfile| >>> begin >>> urlimage = open(eval(method)) >>> rescue OpenURI::HTTPError => e >>> puts e >>> puts "cannot load image" >>> break >>> end >>> tempfile.write(urlimage.read) >>> tempfile.path >>> end >>> unless image_path.nil? >>> fillpixbufs(image_path,pixbufsarray) >>> end >>> } >>> end >>> >>> def fillpixbufs(image,dlpixbufs) >>> begin >>> currentpixbuf = Gdk::Pixbuf.new(image) >>> rescue IOError => e >>> puts e >>> puts "cannot load images" >>> exit >>> end >>> maxheight = 700 >>> myheight = currentpixbuf.height >>> if myheight > maxheight >>> mywidth = currentpixbuf.width >>> newwidth=(mywidth*(maxheight.to_f/myheight)).round >>> >>> >>currentpixbuf=currentpixbuf.scale(newwidth,maxheight,Gdk::Pixbuf::INTERP_BILINEAR) >>> end >>> puts image >>> dlpixbufs << currentpixbuf >>> end >>> >>> def auto_show(pixbufs) # auto mode >>> GLib::Timeout.add(600) do >>> @pixbufs.push(pixbufs.shift) >>> update_image(pixbufs.first) >>> true # continue >>> end >>> end >>> >>> def update_image(currentpixbuf) >>> if (defined?(@gtkimage)).nil? >>> @gtkimage = Gtk::Image.new :pixbuf => currentpixbuf >>> add @gtkimage >>> else >>> @gtkimage.set_pixbuf(currentpixbuf) >>> end >>> show_all >>> end >>> end >>> >>> >>> Gtk.init >>> window = RubyApp.new >>> Gtk.main >>> >>> -snip- >>> >>> >>> Am Sonntag, den 17.08.2014, 14:21 +0200 schrieb Detlef Reichl: >>>> Hi, >>>> >>>> I don't know, whats your code look like, but I would do it in this >>way: >>>> >>>> >>>> Create a thread, that loads down the images. Every time, an image is >>>> completely loaded a flag is set by the loader. Then it waits, that >>the >>>> flag is unset. >>>> >>>> The display system has a Fifo, where it cycles over with a timeout. >>In >>>> this timeout the loader flag is tested. If it is set, the image is >>>> pushed into the Fifo and the flag is unset after this. >>>> >>>> Cheers, detlef >>>> >>>> >>>> >>>> Am 17.08.2014 00:13, schrieb Michael Below: >>>>> Hi, >>>>> >>>>> I am working on the web display issue again. >>>>> Now I would like to refresh the images. I.e.: >>>>> >>>>> - get a set of 50 images >>>>> - display the first set, meanwhile get another set of 50 images >>>>> - as soon as the second set is downloaded, and the first set has >>been >>>>> shown at least once, switch from displaying first set to displaying >>>>> second set >>>>> - repeat infinitely >>>>> >>>>> Thanks to your help, I have got the code to display the first set >>of >>>>> pictures in a loop like this: >>>>> >>>>> def auto_show(pixbufs) # auto mode >>>>> GLib::Timeout.add(600) do >>>>> @pixbufs.push(pixbufs.shift) >>>>> update_image(pixbufs.first) >>>>> true # continue >>>>> end >>>>> end >>>>> >>>>> I guess I could add a second Timeout that switches the picture sets >>>>> every 5 minutes or so. But is there a way to change the picture >>sets >>>>> after successfully loading the next one? >>>>> >>>>> I successfully moved the download process into a separate thread, >>but I >>>>> can't get the download to run again and again while displaying >>images >>>>> and updating the buffer. >>>>> >>>>> Cheers >>>>> Michael >>>>> >>>>> >>>>> Am Montag, den 26.05.2014, 08:46 +0200 schrieb Michael Below: >>>>>> Hi, >>>>>> >>>>>> Am Montag, den 26.05.2014, 12:30 +0900 schrieb Masafumi Yokoyama: >>>>>> >>>>>>> A GTK window is just shown when `Gtk.main` is called. >>>>>>> `show_all` sets flag to be displayed to all widgets, but doesn't >>>>>>> actually display until `Gtk.main` is called. >>>>>> >>>>>> Ah, I understand... I even tried to move Gtk.main into my #each >>loop, >>>>>> but this way it makes sense. >>>>>> >>>>>>> It seems that need to design such as the following: >>>>>> >>>>>> Thanks, works fine. >>>>>> >>>>>> Cheers >>>>>> >>>>>> Michael >>>>> >>>>> >>>>> >>>>> >>------------------------------------------------------------------------------ >>>>> _______________________________________________ >>>>> ruby-gnome2-devel-en mailing list >>>>> rub...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en >>>>> >>>> >>>> >>>> >>------------------------------------------------------------------------------ >>>> _______________________________________________ >>>> ruby-gnome2-devel-en mailing list >>>> rub...@li... >>>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en >>> >>> >>> >>> >>> >>------------------------------------------------------------------------------ >>> _______________________________________________ >>> ruby-gnome2-devel-en mailing list >>> rub...@li... >>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en >>> >> >> >>------------------------------------------------------------------------------ >>_______________________________________________ >>ruby-gnome2-devel-en mailing list >>rub...@li... >>https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en |
From: Michael B. <be...@ju...> - 2014-08-19 07:37:27
|
Hi, do you think this can be fixed? Doing downloads in the background is pretty important for my project, I don't want long gaps between the sets. Cheers Michael On 18. August 2014 18:38:59 MESZ, Detlef Reichl <det...@gm...> wrote: >Hi, > >I think, that it is a bug in current (ruby) gtk. Not even the example >in >the ruby-gnome source in > >ruby-gnome2/gtk3/sample/misc/hreads.rb > >runs as expected. > >Cheers, detlef > > >Am 17.08.2014 21:56, schrieb Michael Below: >> >> Hi, >> >> I would like to download a series of images, and then the next one, >not >> individual images. That way I get a broader selection of images >> (including older ones with the first download, newer ones later). >> >> I am including my current code below. I tried loading a second set of >> images after starting the auto_show, but the whole download is done >> before the first image is shown. >> >> Best >> Michael >> >> >> -snip- >> >> require 'gtk3' >> require 'open-uri' >> require 'tempfile' >> require 'flickraw' >> >> class RubyApp < Gtk::Window >> >> def initialize >> super >> >> signal_connect "destroy" do >> Gtk.main_quit end >> >> set_default_size 300, 200 >> maximize >> set_window_position Gtk::Window::Position::CENTER >> >> @pixbufs = [] >> @flickpixbufs = [] >> iswindow = true >> >> >> FlickRaw.api_key= >> FlickRaw.shared_secret= >> >> flickthread = Thread.new { >> flickresults = flickr.photos.search(:tags => "Tag", :per_page >=> >> 50) >> >> getimages(flickresults,"FlickRaw.url_b(currentresult)",@flickpixbufs) >> } >> >> # event handler >> signal_connect("key-press-event") do |_widget, event| >> case event.keyval >> when Gdk::Keyval::GDK_KEY_Right >> @pixbufs.push(@pixbufs.shift) >> update_image(@pixbufs.first) >> when Gdk::Keyval::GDK_KEY_Left >> @pixbufs.unshift(@pixbufs.pop) >> update_image(@pixbufs.first) >> when Gdk::Keyval::GDK_KEY_F11 >> if iswindow >> fullscreen >> iswindow = false >> else >> unfullscreen >> iswindow = true >> end >> end >> end >> >> flickthread.join >> @pixbufs = @flickpixbufs >> update_image(@pixbufs.first) >> >> auto_show(@pixbufs) >> >> end >> >> def getimages(resultarray, method, pixbufsarray) >> resultarray.each{|currentresult| >> image_path = Tempfile.open("display-web-image-in-gtk") do | >> tempfile| >> begin >> urlimage = open(eval(method)) >> rescue OpenURI::HTTPError => e >> puts e >> puts "cannot load image" >> break >> end >> tempfile.write(urlimage.read) >> tempfile.path >> end >> unless image_path.nil? >> fillpixbufs(image_path,pixbufsarray) >> end >> } >> end >> >> def fillpixbufs(image,dlpixbufs) >> begin >> currentpixbuf = Gdk::Pixbuf.new(image) >> rescue IOError => e >> puts e >> puts "cannot load images" >> exit >> end >> maxheight = 700 >> myheight = currentpixbuf.height >> if myheight > maxheight >> mywidth = currentpixbuf.width >> newwidth=(mywidth*(maxheight.to_f/myheight)).round >> >> >currentpixbuf=currentpixbuf.scale(newwidth,maxheight,Gdk::Pixbuf::INTERP_BILINEAR) >> end >> puts image >> dlpixbufs << currentpixbuf >> end >> >> def auto_show(pixbufs) # auto mode >> GLib::Timeout.add(600) do >> @pixbufs.push(pixbufs.shift) >> update_image(pixbufs.first) >> true # continue >> end >> end >> >> def update_image(currentpixbuf) >> if (defined?(@gtkimage)).nil? >> @gtkimage = Gtk::Image.new :pixbuf => currentpixbuf >> add @gtkimage >> else >> @gtkimage.set_pixbuf(currentpixbuf) >> end >> show_all >> end >> end >> >> >> Gtk.init >> window = RubyApp.new >> Gtk.main >> >> -snip- >> >> >> Am Sonntag, den 17.08.2014, 14:21 +0200 schrieb Detlef Reichl: >>> Hi, >>> >>> I don't know, whats your code look like, but I would do it in this >way: >>> >>> >>> Create a thread, that loads down the images. Every time, an image is >>> completely loaded a flag is set by the loader. Then it waits, that >the >>> flag is unset. >>> >>> The display system has a Fifo, where it cycles over with a timeout. >In >>> this timeout the loader flag is tested. If it is set, the image is >>> pushed into the Fifo and the flag is unset after this. >>> >>> Cheers, detlef >>> >>> >>> >>> Am 17.08.2014 00:13, schrieb Michael Below: >>>> Hi, >>>> >>>> I am working on the web display issue again. >>>> Now I would like to refresh the images. I.e.: >>>> >>>> - get a set of 50 images >>>> - display the first set, meanwhile get another set of 50 images >>>> - as soon as the second set is downloaded, and the first set has >been >>>> shown at least once, switch from displaying first set to displaying >>>> second set >>>> - repeat infinitely >>>> >>>> Thanks to your help, I have got the code to display the first set >of >>>> pictures in a loop like this: >>>> >>>> def auto_show(pixbufs) # auto mode >>>> GLib::Timeout.add(600) do >>>> @pixbufs.push(pixbufs.shift) >>>> update_image(pixbufs.first) >>>> true # continue >>>> end >>>> end >>>> >>>> I guess I could add a second Timeout that switches the picture sets >>>> every 5 minutes or so. But is there a way to change the picture >sets >>>> after successfully loading the next one? >>>> >>>> I successfully moved the download process into a separate thread, >but I >>>> can't get the download to run again and again while displaying >images >>>> and updating the buffer. >>>> >>>> Cheers >>>> Michael >>>> >>>> >>>> Am Montag, den 26.05.2014, 08:46 +0200 schrieb Michael Below: >>>>> Hi, >>>>> >>>>> Am Montag, den 26.05.2014, 12:30 +0900 schrieb Masafumi Yokoyama: >>>>> >>>>>> A GTK window is just shown when `Gtk.main` is called. >>>>>> `show_all` sets flag to be displayed to all widgets, but doesn't >>>>>> actually display until `Gtk.main` is called. >>>>> >>>>> Ah, I understand... I even tried to move Gtk.main into my #each >loop, >>>>> but this way it makes sense. >>>>> >>>>>> It seems that need to design such as the following: >>>>> >>>>> Thanks, works fine. >>>>> >>>>> Cheers >>>>> >>>>> Michael >>>> >>>> >>>> >>>> >------------------------------------------------------------------------------ >>>> _______________________________________________ >>>> ruby-gnome2-devel-en mailing list >>>> rub...@li... >>>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en >>>> >>> >>> >>> >------------------------------------------------------------------------------ >>> _______________________________________________ >>> ruby-gnome2-devel-en mailing list >>> rub...@li... >>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en >> >> >> >> >> >------------------------------------------------------------------------------ >> _______________________________________________ >> ruby-gnome2-devel-en mailing list >> rub...@li... >> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en >> > > >------------------------------------------------------------------------------ >_______________________________________________ >ruby-gnome2-devel-en mailing list >rub...@li... >https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en |
From: Detlef R. <det...@gm...> - 2014-08-18 16:39:08
|
Hi, I think, that it is a bug in current (ruby) gtk. Not even the example in the ruby-gnome source in ruby-gnome2/gtk3/sample/misc/hreads.rb runs as expected. Cheers, detlef Am 17.08.2014 21:56, schrieb Michael Below: > > Hi, > > I would like to download a series of images, and then the next one, not > individual images. That way I get a broader selection of images > (including older ones with the first download, newer ones later). > > I am including my current code below. I tried loading a second set of > images after starting the auto_show, but the whole download is done > before the first image is shown. > > Best > Michael > > > -snip- > > require 'gtk3' > require 'open-uri' > require 'tempfile' > require 'flickraw' > > class RubyApp < Gtk::Window > > def initialize > super > > signal_connect "destroy" do > Gtk.main_quit end > > set_default_size 300, 200 > maximize > set_window_position Gtk::Window::Position::CENTER > > @pixbufs = [] > @flickpixbufs = [] > iswindow = true > > > FlickRaw.api_key= > FlickRaw.shared_secret= > > flickthread = Thread.new { > flickresults = flickr.photos.search(:tags => "Tag", :per_page => > 50) > > getimages(flickresults,"FlickRaw.url_b(currentresult)",@flickpixbufs) > } > > # event handler > signal_connect("key-press-event") do |_widget, event| > case event.keyval > when Gdk::Keyval::GDK_KEY_Right > @pixbufs.push(@pixbufs.shift) > update_image(@pixbufs.first) > when Gdk::Keyval::GDK_KEY_Left > @pixbufs.unshift(@pixbufs.pop) > update_image(@pixbufs.first) > when Gdk::Keyval::GDK_KEY_F11 > if iswindow > fullscreen > iswindow = false > else > unfullscreen > iswindow = true > end > end > end > > flickthread.join > @pixbufs = @flickpixbufs > update_image(@pixbufs.first) > > auto_show(@pixbufs) > > end > > def getimages(resultarray, method, pixbufsarray) > resultarray.each{|currentresult| > image_path = Tempfile.open("display-web-image-in-gtk") do | > tempfile| > begin > urlimage = open(eval(method)) > rescue OpenURI::HTTPError => e > puts e > puts "cannot load image" > break > end > tempfile.write(urlimage.read) > tempfile.path > end > unless image_path.nil? > fillpixbufs(image_path,pixbufsarray) > end > } > end > > def fillpixbufs(image,dlpixbufs) > begin > currentpixbuf = Gdk::Pixbuf.new(image) > rescue IOError => e > puts e > puts "cannot load images" > exit > end > maxheight = 700 > myheight = currentpixbuf.height > if myheight > maxheight > mywidth = currentpixbuf.width > newwidth=(mywidth*(maxheight.to_f/myheight)).round > > currentpixbuf=currentpixbuf.scale(newwidth,maxheight,Gdk::Pixbuf::INTERP_BILINEAR) > end > puts image > dlpixbufs << currentpixbuf > end > > def auto_show(pixbufs) # auto mode > GLib::Timeout.add(600) do > @pixbufs.push(pixbufs.shift) > update_image(pixbufs.first) > true # continue > end > end > > def update_image(currentpixbuf) > if (defined?(@gtkimage)).nil? > @gtkimage = Gtk::Image.new :pixbuf => currentpixbuf > add @gtkimage > else > @gtkimage.set_pixbuf(currentpixbuf) > end > show_all > end > end > > > Gtk.init > window = RubyApp.new > Gtk.main > > -snip- > > > Am Sonntag, den 17.08.2014, 14:21 +0200 schrieb Detlef Reichl: >> Hi, >> >> I don't know, whats your code look like, but I would do it in this way: >> >> >> Create a thread, that loads down the images. Every time, an image is >> completely loaded a flag is set by the loader. Then it waits, that the >> flag is unset. >> >> The display system has a Fifo, where it cycles over with a timeout. In >> this timeout the loader flag is tested. If it is set, the image is >> pushed into the Fifo and the flag is unset after this. >> >> Cheers, detlef >> >> >> >> Am 17.08.2014 00:13, schrieb Michael Below: >>> Hi, >>> >>> I am working on the web display issue again. >>> Now I would like to refresh the images. I.e.: >>> >>> - get a set of 50 images >>> - display the first set, meanwhile get another set of 50 images >>> - as soon as the second set is downloaded, and the first set has been >>> shown at least once, switch from displaying first set to displaying >>> second set >>> - repeat infinitely >>> >>> Thanks to your help, I have got the code to display the first set of >>> pictures in a loop like this: >>> >>> def auto_show(pixbufs) # auto mode >>> GLib::Timeout.add(600) do >>> @pixbufs.push(pixbufs.shift) >>> update_image(pixbufs.first) >>> true # continue >>> end >>> end >>> >>> I guess I could add a second Timeout that switches the picture sets >>> every 5 minutes or so. But is there a way to change the picture sets >>> after successfully loading the next one? >>> >>> I successfully moved the download process into a separate thread, but I >>> can't get the download to run again and again while displaying images >>> and updating the buffer. >>> >>> Cheers >>> Michael >>> >>> >>> Am Montag, den 26.05.2014, 08:46 +0200 schrieb Michael Below: >>>> Hi, >>>> >>>> Am Montag, den 26.05.2014, 12:30 +0900 schrieb Masafumi Yokoyama: >>>> >>>>> A GTK window is just shown when `Gtk.main` is called. >>>>> `show_all` sets flag to be displayed to all widgets, but doesn't >>>>> actually display until `Gtk.main` is called. >>>> >>>> Ah, I understand... I even tried to move Gtk.main into my #each loop, >>>> but this way it makes sense. >>>> >>>>> It seems that need to design such as the following: >>>> >>>> Thanks, works fine. >>>> >>>> Cheers >>>> >>>> Michael >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> ruby-gnome2-devel-en mailing list >>> rub...@li... >>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en >>> >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> ruby-gnome2-devel-en mailing list >> rub...@li... >> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > ruby-gnome2-devel-en mailing list > rub...@li... > https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > |
From: Michael B. <be...@ju...> - 2014-08-17 19:57:42
|
Hi, I would like to download a series of images, and then the next one, not individual images. That way I get a broader selection of images (including older ones with the first download, newer ones later). I am including my current code below. I tried loading a second set of images after starting the auto_show, but the whole download is done before the first image is shown. Best Michael -snip- require 'gtk3' require 'open-uri' require 'tempfile' require 'flickraw' class RubyApp < Gtk::Window def initialize super signal_connect "destroy" do Gtk.main_quit end set_default_size 300, 200 maximize set_window_position Gtk::Window::Position::CENTER @pixbufs = [] @flickpixbufs = [] iswindow = true FlickRaw.api_key= FlickRaw.shared_secret= flickthread = Thread.new { flickresults = flickr.photos.search(:tags => "Tag", :per_page => 50) getimages(flickresults,"FlickRaw.url_b(currentresult)",@flickpixbufs) } # event handler signal_connect("key-press-event") do |_widget, event| case event.keyval when Gdk::Keyval::GDK_KEY_Right @pixbufs.push(@pixbufs.shift) update_image(@pixbufs.first) when Gdk::Keyval::GDK_KEY_Left @pixbufs.unshift(@pixbufs.pop) update_image(@pixbufs.first) when Gdk::Keyval::GDK_KEY_F11 if iswindow fullscreen iswindow = false else unfullscreen iswindow = true end end end flickthread.join @pixbufs = @flickpixbufs update_image(@pixbufs.first) auto_show(@pixbufs) end def getimages(resultarray, method, pixbufsarray) resultarray.each{|currentresult| image_path = Tempfile.open("display-web-image-in-gtk") do | tempfile| begin urlimage = open(eval(method)) rescue OpenURI::HTTPError => e puts e puts "cannot load image" break end tempfile.write(urlimage.read) tempfile.path end unless image_path.nil? fillpixbufs(image_path,pixbufsarray) end } end def fillpixbufs(image,dlpixbufs) begin currentpixbuf = Gdk::Pixbuf.new(image) rescue IOError => e puts e puts "cannot load images" exit end maxheight = 700 myheight = currentpixbuf.height if myheight > maxheight mywidth = currentpixbuf.width newwidth=(mywidth*(maxheight.to_f/myheight)).round currentpixbuf=currentpixbuf.scale(newwidth,maxheight,Gdk::Pixbuf::INTERP_BILINEAR) end puts image dlpixbufs << currentpixbuf end def auto_show(pixbufs) # auto mode GLib::Timeout.add(600) do @pixbufs.push(pixbufs.shift) update_image(pixbufs.first) true # continue end end def update_image(currentpixbuf) if (defined?(@gtkimage)).nil? @gtkimage = Gtk::Image.new :pixbuf => currentpixbuf add @gtkimage else @gtkimage.set_pixbuf(currentpixbuf) end show_all end end Gtk.init window = RubyApp.new Gtk.main -snip- Am Sonntag, den 17.08.2014, 14:21 +0200 schrieb Detlef Reichl: > Hi, > > I don't know, whats your code look like, but I would do it in this way: > > > Create a thread, that loads down the images. Every time, an image is > completely loaded a flag is set by the loader. Then it waits, that the > flag is unset. > > The display system has a Fifo, where it cycles over with a timeout. In > this timeout the loader flag is tested. If it is set, the image is > pushed into the Fifo and the flag is unset after this. > > Cheers, detlef > > > > Am 17.08.2014 00:13, schrieb Michael Below: > > Hi, > > > > I am working on the web display issue again. > > Now I would like to refresh the images. I.e.: > > > > - get a set of 50 images > > - display the first set, meanwhile get another set of 50 images > > - as soon as the second set is downloaded, and the first set has been > > shown at least once, switch from displaying first set to displaying > > second set > > - repeat infinitely > > > > Thanks to your help, I have got the code to display the first set of > > pictures in a loop like this: > > > > def auto_show(pixbufs) # auto mode > > GLib::Timeout.add(600) do > > @pixbufs.push(pixbufs.shift) > > update_image(pixbufs.first) > > true # continue > > end > > end > > > > I guess I could add a second Timeout that switches the picture sets > > every 5 minutes or so. But is there a way to change the picture sets > > after successfully loading the next one? > > > > I successfully moved the download process into a separate thread, but I > > can't get the download to run again and again while displaying images > > and updating the buffer. > > > > Cheers > > Michael > > > > > > Am Montag, den 26.05.2014, 08:46 +0200 schrieb Michael Below: > >> Hi, > >> > >> Am Montag, den 26.05.2014, 12:30 +0900 schrieb Masafumi Yokoyama: > >> > >>> A GTK window is just shown when `Gtk.main` is called. > >>> `show_all` sets flag to be displayed to all widgets, but doesn't > >>> actually display until `Gtk.main` is called. > >> > >> Ah, I understand... I even tried to move Gtk.main into my #each loop, > >> but this way it makes sense. > >> > >>> It seems that need to design such as the following: > >> > >> Thanks, works fine. > >> > >> Cheers > >> > >> Michael > > > > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > > ruby-gnome2-devel-en mailing list > > rub...@li... > > https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > ruby-gnome2-devel-en mailing list > rub...@li... > https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en |
From: Detlef R. <det...@gm...> - 2014-08-17 12:34:16
|
Hi, I don't know, whats your code look like, but I would do it in this way: Create a thread, that loads down the images. Every time, an image is completely loaded a flag is set by the loader. Then it waits, that the flag is unset. The display system has a Fifo, where it cycles over with a timeout. In this timeout the loader flag is tested. If it is set, the image is pushed into the Fifo and the flag is unset after this. Cheers, detlef Am 17.08.2014 00:13, schrieb Michael Below: > Hi, > > I am working on the web display issue again. > Now I would like to refresh the images. I.e.: > > - get a set of 50 images > - display the first set, meanwhile get another set of 50 images > - as soon as the second set is downloaded, and the first set has been > shown at least once, switch from displaying first set to displaying > second set > - repeat infinitely > > Thanks to your help, I have got the code to display the first set of > pictures in a loop like this: > > def auto_show(pixbufs) # auto mode > GLib::Timeout.add(600) do > @pixbufs.push(pixbufs.shift) > update_image(pixbufs.first) > true # continue > end > end > > I guess I could add a second Timeout that switches the picture sets > every 5 minutes or so. But is there a way to change the picture sets > after successfully loading the next one? > > I successfully moved the download process into a separate thread, but I > can't get the download to run again and again while displaying images > and updating the buffer. > > Cheers > Michael > > > Am Montag, den 26.05.2014, 08:46 +0200 schrieb Michael Below: >> Hi, >> >> Am Montag, den 26.05.2014, 12:30 +0900 schrieb Masafumi Yokoyama: >> >>> A GTK window is just shown when `Gtk.main` is called. >>> `show_all` sets flag to be displayed to all widgets, but doesn't >>> actually display until `Gtk.main` is called. >> >> Ah, I understand... I even tried to move Gtk.main into my #each loop, >> but this way it makes sense. >> >>> It seems that need to design such as the following: >> >> Thanks, works fine. >> >> Cheers >> >> Michael > > > > ------------------------------------------------------------------------------ > _______________________________________________ > ruby-gnome2-devel-en mailing list > rub...@li... > https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > |
From: Michael B. <be...@ju...> - 2014-08-16 22:14:01
|
Hi, I am working on the web display issue again. Now I would like to refresh the images. I.e.: - get a set of 50 images - display the first set, meanwhile get another set of 50 images - as soon as the second set is downloaded, and the first set has been shown at least once, switch from displaying first set to displaying second set - repeat infinitely Thanks to your help, I have got the code to display the first set of pictures in a loop like this: def auto_show(pixbufs) # auto mode GLib::Timeout.add(600) do @pixbufs.push(pixbufs.shift) update_image(pixbufs.first) true # continue end end I guess I could add a second Timeout that switches the picture sets every 5 minutes or so. But is there a way to change the picture sets after successfully loading the next one? I successfully moved the download process into a separate thread, but I can't get the download to run again and again while displaying images and updating the buffer. Cheers Michael Am Montag, den 26.05.2014, 08:46 +0200 schrieb Michael Below: > Hi, > > Am Montag, den 26.05.2014, 12:30 +0900 schrieb Masafumi Yokoyama: > > > A GTK window is just shown when `Gtk.main` is called. > > `show_all` sets flag to be displayed to all widgets, but doesn't > > actually display until `Gtk.main` is called. > > Ah, I understand... I even tried to move Gtk.main into my #each loop, > but this way it makes sense. > > > It seems that need to design such as the following: > > Thanks, works fine. > > Cheers > > Michael |
From: Detlef R. <det...@gm...> - 2014-07-22 17:40:32
|
Hi, Am 22.07.2014 18:39, schrieb Masafumi Yokoyama: > Hi, > > 2014-07-22 2:29 GMT+09:00 Detlef Reichl <det...@gm...>: >> "classic" gtk3 (non gir) crashes on closing the program, if you have >> accessed the clipboard. >> >> Here is a small example. Start it, click the button, close the window => >> crash. > > I got same crash in Linux. (not crash in Windows, but `clip` is nil.) > > >> #!/usr/bin/env ruby >> >> require 'gtk3' >> >> win = Gtk::Window.new >> win.signal_connect(:delete_event) {Gtk.main_quit} >> button = Gtk::Button.new :label => 'foobla' >> win.add button >> >> button.signal_connect(:clicked) do >> clip = button.get_clipboard Gdk::Atom.new(69).class.to_s > > The following code is works. Is this no good? > > clip = button.get_clipboard Gdk::Selection::CLIPBOARD > works like a charm :-) Thank you, detlef |
From: Masafumi Y. <my...@gm...> - 2014-07-22 16:39:24
|
Hi, 2014-07-22 2:29 GMT+09:00 Detlef Reichl <det...@gm...>: > "classic" gtk3 (non gir) crashes on closing the program, if you have > accessed the clipboard. > > Here is a small example. Start it, click the button, close the window => > crash. I got same crash in Linux. (not crash in Windows, but `clip` is nil.) > #!/usr/bin/env ruby > > require 'gtk3' > > win = Gtk::Window.new > win.signal_connect(:delete_event) {Gtk.main_quit} > button = Gtk::Button.new :label => 'foobla' > win.add button > > button.signal_connect(:clicked) do > clip = button.get_clipboard Gdk::Atom.new(69).class.to_s The following code is works. Is this no good? clip = button.get_clipboard Gdk::Selection::CLIPBOARD Thanks, myokoym |
From: Detlef R. <det...@gm...> - 2014-07-21 17:44:25
|
Hi, "classic" gtk3 (non gir) crashes on closing the program, if you have accessed the clipboard. Here is a small example. Start it, click the button, close the window => crash. Cheers, detlef #!/usr/bin/env ruby require 'gtk3' win = Gtk::Window.new win.signal_connect(:delete_event) {Gtk.main_quit} button = Gtk::Button.new :label => 'foobla' win.add button button.signal_connect(:clicked) do clip = button.get_clipboard Gdk::Atom.new(69).class.to_s end win.show_all Gtk.main |