From: grant s. <mat...@gm...> - 2012-06-11 18:11:05
|
I'm now just getting into porting another application to the "latest and greatest" ruby-gnome2 release. I'm getting one undefined method. In rbgtkwidget.c I see on Sep 9, 2011 there was a commit that removed "methods implementing properties in gtk2" So one of these methods, "window" I was using to get at the window and call set_cursor() on it. So basically, I have a Gtk::Dialog, that used to have a method "window()" and now it doesn't. How do I get at that object now? I'm sure I'm just overlooking something, just still new to this. Thanks |
From: grant s. <mat...@gm...> - 2012-06-11 19:58:25
|
I'm now just getting into porting another application to the "latest and > greatest" ruby-gnome2 release. I'm getting one undefined method. > > In rbgtkwidget.c I see on Sep 9, 2011 there was a commit that removed > "methods implementing properties in gtk2" > > So one of these methods, "window" I was using to get at the window and > call set_cursor() on it. > > So basically, I have a Gtk::Dialog, that used to have a method "window()" > and now it doesn't. How do I get at that object now? I'm sure I'm just > overlooking something, just still new to this. > > I just noticed that two of the sample programs in gtk2 have this same problem. I'd be happy to update them once I figure out how to make this work, the two sample programs are .../gtk2/sample/misc/cursor.rb .../gtk2/sample/misc/xbm_cursor.rb |
From: Kouhei S. <ko...@co...> - 2012-06-12 12:30:37
|
Hi, In <CAC6rHio=47D...@ma...> "[ruby-gnome2-devel-en] gtk2/rbgtkwidget.c change" on Mon, 11 Jun 2012 12:10:59 -0600, grant schoep <mat...@gm...> wrote: > So basically, I have a Gtk::Dialog, that used to have a method "window()" and > now it doesn't. How do I get at that object now? I'm sure I'm just overlooking > something, just still new to this. Could you show a script that reproduces your problem? Thanks, -- kou |
From: Grant S. <rub...@an...> - 2012-06-14 15:58:39
|
Sorry if this comes as a double post, not sure if my posts were getting through. Trying directly from ruby-forum website Yes, luckily there are two examles in the current ruby-gnome2 distro! Both in the gtk2 package. <ruby-gnome2 source>/gtk2/sample/misc/cursor.rb <ruby-gnome2 source>/gtk2/sample/misc/xbm_cursor.rb The code from cursor.rb is at the end of this post. The error message is: cursor.rb:25:in `block in <main>': undefined method `window' for #<Gtk::Window:0xa791f44 ptr=0xa7ad800> Line 25 is the window.window.set_cursor(Gdk::Cursor.new(cursor)) line Reviewing the git repo, the window method was removed from rbgtkwidget.c on a commit on Sep 9, 2011 --Heres the example from cursor.rb--- --the window.window.set_cursor reports the undefined method 'window'---- require 'gtk2' window = Gtk::Window.new("Gdk::Cursor sample") window.realize button = Gtk::Button.new("Click!") button.use_underline = false cursors = Gdk::Cursor::Type.values - [Gdk::Cursor::CURSOR_IS_PIXMAP] cnt = 0 button.signal_connect('clicked') do cursor = cursors[cnt] p cursor.inspect button.set_label(cursor.inspect) window.window.set_cursor(Gdk::Cursor.new(cursor)) cnt += 1 cnt = 0 if cnt == cursors.size end window.add(button) window.set_default_size(400,100).show_all Gtk.main -- Posted via http://www.ruby-forum.com/. |
From: Grant S. <gs...@di...> - 2012-06-12 15:19:45
|
Yes, luckily there is two in the current ruby-gnome2 distro! Both in the gtk2 package <ruby-gnome2 source>/gtk2/sample/misc/cursor.rb <ruby-gnome2 source>/gtk2/sample/misc/xbm_cursor.rb Here is what is in cursor.rb. The error message is. cursor.rb:25:in `block in <main>': undefined method `window' for #<Gtk::Window:0xa791f44 ptr=0xa7ad800> Line 25 is the window.window.set_cursor(Gdk::Cursor.new(cursor)) line Reviewing the git repo, the window method was removed from rbgtkwidget.c on a commit on Sep 9, 2011. ----------------------------------------------------- require 'gtk2' window = Gtk::Window.new("Gdk::Cursor sample") window.realize button = Gtk::Button.new("Click!") button.use_underline = false cursors = Gdk::Cursor::Type.values - [Gdk::Cursor::CURSOR_IS_PIXMAP] cnt = 0 button.signal_connect('clicked') do cursor = cursors[cnt] p cursor.inspect button.set_label(cursor.inspect) window.window.set_cursor(Gdk::Cursor.new(cursor)) cnt += 1 cnt = 0 if cnt == cursors.size end window.add(button) window.set_default_size(400,100).show_all Gtk.main ------------------------------------------------------------------------ -------- -----Original Message----- From: Kouhei Sutou [mailto:ko...@co...] Sent: Tuesday, June 12, 2012 6:30 AM To: rub...@li... Subject: Re: [ruby-gnome2-devel-en] gtk2/rbgtkwidget.c change Hi, In <CAC6rHio=47D...@ma...> "[ruby-gnome2-devel-en] gtk2/rbgtkwidget.c change" on Mon, 11 Jun 2012 12:10:59 -0600, grant schoep <mat...@gm...> wrote: > So basically, I have a Gtk::Dialog, that used to have a method > "window()" and now it doesn't. How do I get at that object now? I'm > sure I'm just overlooking something, just still new to this. Could you show a script that reproduces your problem? Thanks, -- kou ------------------------------------------------------------------------ ------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ ruby-gnome2-devel-en mailing list rub...@li... https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en This electronic communication and any attachments may contain confidential and proprietary information of DigitalGlobe, Inc. If you are not the intended recipient, or an agent or employee responsible for delivering this communication to the intended recipient, or if you have received this communication in error, please do not print, copy, retransmit, disseminate or otherwise use the information. Please indicate to the sender that you have received this communication in error, and delete the copy you received. DigitalGlobe reserves the right to monitor any electronic communication sent or received by its employees, agents or representatives. |
From: grant s. <mat...@gm...> - 2012-06-14 15:41:44
|
> > So basically, I have a Gtk::Dialog, that used to have a method > "window()" and > > now it doesn't. How do I get at that object now? I'm sure I'm just > overlooking > > something, just still new to this. > > Could you show a script that reproduces your problem? > > > Yes, luckily there are two in the current ruby-gnome2 distro! Both in the gtk2 package <ruby-gnome2 source>/gtk2/sample/misc/cursor.rb <ruby-gnome2 source>/gtk2/sample/misc/xbm_cursor.rb Here is what is in cursor.rb(see end of email for cut and paste of it). The error message is. cursor.rb:25:in `block in <main>': undefined method `window' for #<Gtk::Window:0xa791f44 ptr=0xa7ad800> Line 25 is the window.window.set_cursor(Gdk::Cursor.new(cursor)) line Reviewing the git repo, the window method was removed from rbgtkwidget.c on a commit on Sep 9, 2011. --begin cursor.rb-- require 'gtk2' window = Gtk::Window.new("Gdk::Cursor sample") window.realize button = Gtk::Button.new("Click!") button.use_underline = false cursors = Gdk::Cursor::Type.values - [Gdk::Cursor::CURSOR_IS_PIXMAP] cnt = 0 button.signal_connect('clicked') do cursor = cursors[cnt] p cursor.inspect button.set_label(cursor.inspect) window.window.set_cursor(Gdk::Cursor.new(cursor)) cnt += 1 cnt = 0 if cnt == cursors.size end window.add(button) window.set_default_size(400,100).show_all Gtk.main |
From: Marc H. <rub...@an...> - 2012-06-17 18:42:43
|
Your last mail seems to have arrived three times in total. :-) -- Posted via http://www.ruby-forum.com/. |
From: Grant S. <rub...@an...> - 2012-06-18 05:08:31
|
Marc Heiler wrote in post #1064915: > Your last mail seems to have arrived three times in total. :-) Yeah, sorry about that. I had posted one waited over a day, didn't see anything. Posted it again, still didn't see anything, though I only waited 3-4 hours. Finally I posted would directly via ruby-forum, and was instantly there. Then a short time later all my other posts showed up. Sorry for the over-postage. I haven't gotten back to the problem to see a way to get at what that old window() method gave. Just been busy with bunches of other problems elsewhere -- Posted via http://www.ruby-forum.com/. |
From: Kouhei S. <ko...@co...> - 2012-06-19 12:42:48
|
Hi, In <CAC6rHiqUzk9JQbHg1ww4sDRADT-f0PdCA=0wE...@ma...> "Re: [ruby-gnome2-devel-en] gtk2/rbgtkwidget.c change" on Thu, 14 Jun 2012 09:41:37 -0600, grant schoep <mat...@gm...> wrote: > > > So basically, I have a Gtk::Dialog, that used to have a method "window()" > and > > now it doesn't. How do I get at that object now? I'm sure I'm just > overlooking > > something, just still new to this. > > Could you show a script that reproduces your problem? > > Yes, luckily there are two in the current ruby-gnome2 distro! Both in the > gtk2 package > > <ruby-gnome2 source>/gtk2/sample/misc/cursor.rb > > <ruby-gnome2 source>/gtk2/sample/misc/xbm_cursor.rb Thanks! But I can't reproduce your problem with it... :< Could you show your Ruby, Ruby/GTK2 and GTK+ versions? Here are mine of them: % ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] % ruby -r gtk2 -e 'p Gtk::BINDING_VERSION' [1, 1, 3] % ruby -r gtk2 -e 'p Gtk::VERSION' [2, 24, 10] Thanks, -- kou |
From: Grant S. <rub...@an...> - 2012-06-19 19:08:21
|
> Thanks! > But I can't reproduce your problem with it... :< > > Could you show your Ruby, Ruby/GTK2 and GTK+ versions? > Here are mine of them: > > % ruby -v > ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] > % ruby -r gtk2 -e 'p Gtk::BINDING_VERSION' > [1, 1, 3] > % ruby -r gtk2 -e 'p Gtk::VERSION' > [2, 24, 10] > Here's mine % ruby --version ruby 1.9.2p320 (2012-04-20 revision 35421) [i686-linux] % ruby -r gtk2 -e 'p Gtk::BINDING_VERSION' [1, 1, 3] % ruby -r gtk2 -e 'p Gtk::VERSION' [2, 10, 4] So I am stuck on 2.10.4 of gtk, for sometime, so that could be the issue. I see the method "window()" was removed in ruby-gnome2 from the rbgtkwidget.c file. Is this one that was reimplemented somewhere else that doesn't get picked up for 2.10.4? I'm stuck with 2.10.4( RHEL 5.x) for sometime. -- Posted via http://www.ruby-forum.com/. |
From: Grant S. <rub...@an...> - 2012-06-20 01:56:51
|
Ok I was able to get this to work, by modifying some of the source. Not sure if this is the best way. But I modified rbgtkwidget.c and rbgdkwindow.c Modified rbgtkwidget.c like this #if GTK_CHECK_VERSION(2,10,0) RG_DEF_METHOD(action, 0); RG_DEF_METHOD_P(composited, 0); RG_DEF_METHOD(window, 0); <--- added this line #endif .. #if GTK_CHECK_VERSION(2,10,0) static VALUE rg_action(VALUE self) { return GOBJ2RVAL(gtk_widget_get_action(_SELF(self))); } static VALUE rg_composited_p(VALUE self) { return CBOOL2RVAL(gtk_widget_is_composited(_SELF(self))); } static VALUE <-- Added this function def rg_window(VALUE self) { return GOBJ2RVAL(_SELF(self)->window); } #endif And did the same for set_cursor in rbgtkwindow.c. I added #if GTK_CHECK_VERSION(2,10,0) static VALUE rg_set_cursor(VALUE self, VALUE cursor) { gdk_window_set_cursor(_SELF(self), (GdkCursor*)(NIL_P(cursor) ? NULL : RVAL2BOXED(cursor, GDK_TYPE_CURSOR))); return self; } #endif AND #if GTK_CHECK_VERSION(2,10,0) RG_DEF_METHOD(set_cursor, 1); #endif This seems to work fine for me on GTK 2,10,0. So I'd be happy to commit these changes. I've worked on code for years, but never really worked on a nice open source project. If I were too, whats the policy for making changes? Note, I always will follow the coding style of the code I am mucking with. Thanks -- Posted via http://www.ruby-forum.com/. |
From: Grant S. <rub...@an...> - 2012-06-20 05:25:05
|
So I decided to learn something new. Had to read up on "git for cvs users" I'm fairly old school, been just using cvs and vi for years... Anyways, I forked the ruby-gnome2 repo and made https://github.com/matobinder/ruby-gnome2 I committed my two changes(rbgdkwindow.c and rbgdkwindow.c). I'm still not sure if that was the correct way to go. I'd appreciate any comments, I'd like to try to help out more, especially as I need to keep supporting ruby-gnome2 on 2.10.0 of GTK. -- Posted via http://www.ruby-forum.com/. |
From: Kouhei S. <ko...@co...> - 2012-06-20 12:01:32
|
Hi, In <1e3...@ru...> "Re: [ruby-gnome2-devel-en] gtk2/rbgtkwidget.c change" on Wed, 20 Jun 2012 07:24:53 +0200, Grant Schoep <rub...@an...> wrote: > So I decided to learn something new. Had to read up on "git for cvs > users" I'm fairly old school, been just using cvs and vi for years... > > Anyways, I forked the ruby-gnome2 repo and made > > https://github.com/matobinder/ruby-gnome2 > > I committed my two changes(rbgdkwindow.c and rbgdkwindow.c). I'm still > not sure if that was the correct way to go. I'd appreciate any comments, > I'd like to try to help out more, especially as I need to keep > supporting ruby-gnome2 on 2.10.0 of GTK. Great!!! Could you send them by "pull request"? https://help.github.com/articles/using-pull-requests Then I'll merge them. I have a comment about your change for it: https://github.com/matobinder/ruby-gnome2/commit/1b05bd625d98ff5ca047e785750987b7463d988f#L0R605 + (GdkCursor*)(NIL_P(cursor) ? NULL : RVAL2BOXED(cursor, GDK_TYPE_CURSOR))); You can remove NIL check because RVAL2BOXED() checks it. So you can write it as (GdkCursor *)RVAL2BOXED(cursor, GDK_TYPE_CURSOR) (I'll merge your changes without this fix. :-) Thanks, -- kou |