[Gtk2-perl-bugs] [Bug 567688] New: signal_chain_from_overridden in size_request class closure

View: New views
5 Messages — Rating Filter:   Alert me  

[Gtk2-perl-bugs] [Bug 567688] New: signal_chain_from_overridden in size_request class closure

by Bugzilla from bugzilla-daemon@bugzilla.gnome.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=567688

  gnome-perl | Gtk2 | Ver: unspecified
           Summary: signal_chain_from_overridden in size_request class
                    closure
           Product: gnome-perl
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: Gtk2
        AssignedTo: gtk2-perl-bugs@...
        ReportedBy: user42@...
         QAContact: gtk2-perl-bugs@...
     GNOME version: Unspecified
   GNOME milestone: Unspecified


As noted in the Gtk2::Widget signals pod, chaining up to a superclass
size_request doesn't fill in any data.

The program below prints (among other things)

    after chain: 0x0

where I hoped the signal_chain_from_overridden would go to the Gtk2::Label
size_request handler and get a desired size from it.  (You can see the desired
size by changing $foo to a plain Gtk2::Label per the commented out line in
main).

Chasing it down, I believe somewhere deep in signal_chain_from_overridden the
Gtk2::Requisition supplied in the perl call is copied, so the pointer going to
the g_signal_chain_from_overridden (in a GValue) is not the original and so the
width/height stored in it by GtkLabel are never seen.

It made me wonder if most of the time a boxed object should be copied or not
copied when passed to a C func.  But certainly in this case it shouldn't, since
it's a kind of output location.



package Foo;
use strict;
use warnings;

use Gtk2;
use Glib::Object::Subclass
  'Gtk2::Label',
  signals => { size_request => \&_do_size_request };

sub _do_size_request {
  my ($self, $req) = @_;
  print "this is Foo::_do_size_request\n";
  print "text is '",$self->get_text,"'\n";
  print "before chain: ",$req->width,"x",$req->height,"\n";
  Glib::Object::signal_chain_from_overridden ($self, $req);
  print "after chain: ",$req->width,"x",$req->height,"\n";
}

package main;
use strict;
use warnings;
use Gtk2 '-init';

my $window = Gtk2::Window->new('toplevel');
my $foo = Foo->new();
#
# my $foo = Gtk2::Label->new();
#
$foo->set_text ('hello world');
$window->add ($foo);
$window->show_all;

my $req = $foo->size_request();
print "main: foo size ",$req->width,"x",$req->height,"\n";

Gtk2->main();


--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=567688.

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Gtk2-perl-bugs mailing list
Gtk2-perl-bugs@...
https://lists.sourceforge.net/lists/listinfo/gtk2-perl-bugs

[Gtk2-perl-bugs] [Bug 567688] signal_chain_from_overridden in size_request class closure

by Bugzilla from bugzilla-daemon@bugzilla.gnome.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=567688

  gnome-perl | Gtk2 | Ver: unspecified




------- Comment #1 from Kevin Ryde  2009-06-02 23:17 UTC -------
As noted on the mailing list, the latest change to Glib to have boxed objects
not copied fixes this problem.  The change below removes the note in the docs
and adds a test case exercising the now-successful chaining, when ready to have
a dependency on that new enough Glib.


--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=567688.

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Gtk2-perl-bugs mailing list
Gtk2-perl-bugs@...
https://lists.sourceforge.net/lists/listinfo/gtk2-perl-bugs

[Gtk2-perl-bugs] [Bug 567688] signal_chain_from_overridden in size_request class closure

by Bugzilla from bugzilla-daemon@bugzilla.gnome.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=567688

  gnome-perl | Gtk2 | Ver: unspecified




------- Comment #2 from Kevin Ryde  2009-06-02 23:19 UTC -------
Created an attachment (id=135853)
 --> (http://bugzilla.gnome.org/attachment.cgi?id=135853&action=view)
doc update and test case


--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=567688.

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Gtk2-perl-bugs mailing list
Gtk2-perl-bugs@...
https://lists.sourceforge.net/lists/listinfo/gtk2-perl-bugs

[Gtk2-perl-bugs] [Bug 567688] signal_chain_from_overridden in size_request class closure

by Bugzilla from bugzilla-daemon@bugzilla.gnome.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=567688

  gnome-perl | Gtk2 | Ver: unspecified

Torsten Schoenfeld changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kaffeetisch@...
 Attachment #135853|none                        |committed
               Flag|                            |
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED




------- Comment #3 from Torsten Schoenfeld  2009-06-04 19:26 UTC -------
Ah, sweet.  I love it when bugs fix themselves.

I created a stable branch for Gtk2 so that this can go into master:
<http://git.gnome.org/cgit/perl-Gtk2/commit/?id=07d6735c82898346d412c72f0ce22a56a78ab8f7>
<http://git.gnome.org/cgit/perl-Gtk2/commit/?id=9c0a15933209c4a2a33028c08f884063c68ea6ea>

Thanks for the test case!


--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=567688.

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Gtk2-perl-bugs mailing list
Gtk2-perl-bugs@...
https://lists.sourceforge.net/lists/listinfo/gtk2-perl-bugs

[Gtk2-perl-bugs] [Bug 567688] signal_chain_from_overridden in size_request class closure

by Bugzilla from bugzilla-daemon@bugzilla.gnome.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=567688

  gnome-perl | Gtk2 | Ver: unspecified




------- Comment #4 from Kevin Ryde  2009-06-04 23:18 UTC -------
Created an attachment (id=135993)
 --> (http://bugzilla.gnome.org/attachment.cgi?id=135993&action=view)
depend on Glib 1.221

Don't forget to bump the Glib dependency when ready, since of course the tests
fail with 1.220.


--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=567688.

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Gtk2-perl-bugs mailing list
Gtk2-perl-bugs@...
https://lists.sourceforge.net/lists/listinfo/gtk2-perl-bugs