#!/usr/bin/perl package ClassFoo; use strict; use Gtk2; use Glib::Object::Subclass 'Gtk2::Bin', properties => [ Glib::ParamSpec->boxed('title', 'title', 'The button\'s title', 'Glib::Scalar', [qw/writable readable/]), ]; sub INIT_INSTANCE { my $self = shift; $self->{prop_title} = undef; } sub SET_PROPERTY { my ($self, $pspec, $val) = @_; my $propname = $pspec->get_name; if ($propname eq 'title') { $self->{prop_title} = $val; } else { die "unknown property ``$propname''"; } } sub GET_PROPERTY { my ($self, $pspec) = @_; my $propname = $pspec->get_name; if ($propname eq 'title') { return $self->{prop_title}; } else { die "unknown property ``$propname''"; } } package main; use strict; use Hash::Case::Preserve; my $hashref = {}; tie %$hashref, 'Hash::Case::Preserve'; $hashref->{Title} = 'foo'; my $w; sub subprint($) { my $a = shift; print "subprint \"$a\"\n"; } subprint($hashref->{Title}); $w = new ClassFoo; $w->set_property('title', $hashref->{Title}); print "get_property \"".$w->get_property('title')."\"\n"; $w->set_property('title', scalar($hashref->{Title})); print "get_property scalar \"".$w->get_property('title')."\"\n"; my $hashref_untied = {}; $hashref_untied->{Title} = 'foo'; $w->set_property('title', $hashref_untied->{Title}); print "get_property untied \"".$w->get_property('title')."\"\n"; exit;