Re: Subclassing question

2009-11-19 Thread Martin Schlemmer
 Torsten Schoenfeld wrote:
 muppet wrote:
 If that actually works, then i think we get a functionality win (some 
 of the marshaler behave more usefully) that would be worth some bug reports,
 so i think it's worth pushing it out in an unstable release to see what
 happens.

 Specific things to test would include custom treemodels and complex perl
 widget or cellrenderer implementations. 


 I think the change fixes this specific bug, and I found no problems yet, so
 I committed it to the master branch of the git repository. Martin, please
 verify that this actually fixes your problem. And everyone else, please test
 for regressions.

 http://git.gnome.org/cgit/perl-Glib/commit/?id=6527c0 


Firstly, sorry for the belated reply - I did not subscribe back then to the 
mailing list, and
missed the replies.  Guess beating your head against a wall is a great way to 
learn the
mistake of this.

Anyhow, this works fine here on win32 - also all test cases but the 64bit ones 
pass.  I will
test a bit more with some of my other projects and let you know if anything 
comes up.


Regards,

Martin


Vrywaringsklousule / Disclaimer:  
http://www.nwu.ac.za/it/gov-man/disclaimer.html 

___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Re: Gtk2::Builder::Simple

2009-11-19 Thread Martin Schlemmer
 Torsten Schoenfeld wrote:
 On 01.04.2009 09:52, Martin Schlemmer wrote:
 I have been using Gtk2::GladeXML::Simple for some time, and while
 Gtk2::Builder is somewhat less work to use than Gtk2::GladeXML, I got
 used to Gtk2::GladeXML::Simple and its widget access via
 $self-{widget}.  Since Glade3-3.6.0 was released and seems to be a
 lot more stable than the 3.5.x series, and supports GtkBuilder, I
 decided to start switching to Gtk2::Builder, but did not see anything
 like Gtk2::GladeXML::Simple.  Thus I modified Gtk2::GladeXML::Simple
 to be similar but with Gtk2::Builder support.

 I haven't looked at the actual code (mostly because I never really used 
 Gtk2::Builder), but I have one request and one question:

 Request: Please consider using Gtk2::Ex::Builder::Simple for the namespace. 
 This avoids a potential conflict if gtk+ ever decides to provide 
 GtkBuilderSimple.

 Question: Why is this not on CPAN yet?


That would be because I missed your reply, and thus did not think to do it.  
Will
do the needed changes and send a post when done and there.


Regards,

Martin


Vrywaringsklousule / Disclaimer:  
http://www.nwu.ac.za/it/gov-man/disclaimer.html 

___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Gtk2::TreeModel - foreach

2009-11-19 Thread Zettai Muri
Hi All,

Would someone be able to point me towards a good tutorial/simple example on how 
to use the following method?

$model-foreach ($func, $user_data=undef)
* $func (subroutine) 
* $user_data (scalar) 
Call $func on each row in $model. $func gets the tree path and iter
of the current row; if $func returns true, the tree ceases to be walked,
and $treemodel-foreach returns. 
I have been googling it and turning up heaps of references to the doco and 
something in the archives titled: 

Gtk2::TreeModel::foreach callback not getting any arguments?
but was hoping to get something simpler.

Many thanks for any suggestions.

ZM.


  
__
Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7.
Enter now: http://au.docs.yahoo.com/homepageset/___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Re: Gtk2::TreeModel - foreach

2009-11-19 Thread Martin Schlemmer
 On 2009/11/19 at 01:44 PM, Zettai Muri zettaim...@ymail.com wrote:

Hi,
 
 Would someone be able to point me towards a good tutorial/simple example on 
 how to use the following method?
 
 $model-foreach ($func, $user_data=undef)
   * $func (subroutine) 
   * $user_data (scalar) 
 Call $func on each row in $model. $func gets the tree path and iter
 of the current row; if $func returns true, the tree ceases to be walked,
 and $treemodel-foreach returns. 
 I have been googling it and turning up heaps of references to the doco and 
 something in the archives titled: 
 
 Gtk2::TreeModel::foreach callback not getting any arguments?
 but was hoping to get something simpler.
 

Not exactly sure what you want, but attached is an example for a 
Gtk2::ListStore's foreach.


Regards,

Martin


Vrywaringsklousule / Disclaimer:  
http://www.nwu.ac.za/it/gov-man/disclaimer.html 



model_foreach_test.pl
Description: Binary data
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Perl bindings and the newest gtk+

2009-11-19 Thread Sergei Steshenko
Hello,

are Perl bindings supposed to work with the newest gtk+, e.g. gtk+-2.18.* ?

I haven't tried yet, just want to know about gtk+ changes which could break
the bindings, etc.

Thanks,
  Sergei.


  
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Re: Gtk2::TreeModel - foreach

2009-11-19 Thread Zettai Muri


 Not exactly sure what you want, but attached is an example for a 
 Gtk2::ListStore's foreach.
 
Thanks Martin, that was perfect.  Nice and easy even I can understand.
 
 Regards,
 
 Martin
 
 
 Vrywaringsklousule / Disclaimer:  
 http://www.nwu.ac.za/it/gov-man/disclaimer.html 



  
__
Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7.
Enter now: http://au.docs.yahoo.com/homepageset/

___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


font problem (bold vs normal)

2009-11-19 Thread Sergei Steshenko
Hello,

I have an application which used to render fine under long ago self-built
gtk+-2.12.12 and Gtk2-1.202.

The very important point is that the application does not specify fonts
anywhere in any shape or form, i.e. only default fonts are used. Even more,
I do not know off the top of my head how to specify fonts - never had a need.

I have upgraded from SUSE-10.3 to SUSE-11.1 - this also means upgraded
'qtcurve' desktop theme I am using - the theme is the one coming with
SUSE-11.1 - not self built.

I have rebuilt gtk+ - now it is gtk+-2.14.7. Perl bindings are now the latest 
ones, e.g. Gtk2-1.221.

Now my application (again, _without_ any specific font setting) has the 
following flaw: some part are rendered in normal font, e.g. text on
buttons, text on frames, and some parts are rendered in bold font - e.g.
labels inside frames. The expected behavior is to have everything rendered
by normal (non-bold) font.

Why is it so ?

Interestingly enough, I also have self-built claws-mail-3.7.3, it is built
against the same self-built gtk+-2.14.7, and claws-mail-3.7.3 does _not_
exhibit the described above font problem.

I am using perl-5.10.0 which came as part of SUSE-11.1.

Any ideas how to debug and fix this ? For example, are fonts specified in 
'qtcurve' desktop theme I'm using ?

Can I query the fonts ? If yes, how ?

Any other ideas ?

Thanks,
  Sergei.


  
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Re: Perl bindings and the newest gtk+

2009-11-19 Thread Chris Debenham
They are working fine for me with gtk 2.18.3

2009/11/20 Sergei Steshenko sergst...@yahoo.com:
 Hello,

 are Perl bindings supposed to work with the newest gtk+, e.g. gtk+-2.18.* ?

 I haven't tried yet, just want to know about gtk+ changes which could break
 the bindings, etc.

 Thanks,
  Sergei.



 ___
 gtk-perl-list mailing list
 gtk-perl-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-perl-list




-- 

Jonathan Swift  - May you live every day of your life. -
http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Automated GUI testing?

2009-11-19 Thread Stephen Gross
Hi folks. We're considering adopting gtk2 for a new project. I'm interested
in learning what--if any--tools are available for automated testing of a
gtk2-driven perl executable on Unix? Looking around in the mailing list
archives, I see that the issue has come up occasionally, though it's not
clear if there's a well-known solution.

Thanks in advance,
--Steve (mrstevegr...@gmail.com)
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Re: Gtk2::TreeModel - foreach

2009-11-19 Thread Zettai Muri


  Not exactly sure what you want, but attached is an example for a 
  Gtk2::ListStore's foreach.

Where does the $user_data (scalar) part of the method come into play?
Is it possible to get an extended example that shows how this is used?

$model-foreach(
sub {
my($model,$path,$iter) = @_;
my($item)  = $model-get($iter, 0);

print $item\n;

# return TRUE to end
return FALSE;
}, $user_data --- ???
);

Is this data within the ListStore or some other data passed to the method?  How 
does the method act on this data?

Again thanks for the help.


  
__
Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7.
Enter now: http://au.docs.yahoo.com/homepageset/

___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


RE: Gtk2::TreeModel - foreach

2009-11-19 Thread Jeff Hallock


-Original Message-
From: gtk-perl-list-boun...@gnome.org [mailto:gtk-perl-list-boun...@gnome.org] 
On Behalf Of Zettai Muri
Sent: Thursday, November 19, 2009 3:56 PM
To: Martin Schlemmer; gtk-perl-list@gnome.org
Subject: Re: Gtk2::TreeModel - foreach



  Not exactly sure what you want, but attached is an example for a
  Gtk2::ListStore's foreach.

Where does the $user_data (scalar) part of the method come into play?
Is it possible to get an extended example that shows how this is used?

$model-foreach(
sub {
my($model,$path,$iter) = @_;
my($item)  = $model-get($iter, 0);

print $item\n;

# return TRUE to end
return FALSE;
}, $user_data --- ???
);

Is this data within the ListStore or some other data passed to the method?  
How does the method act on this data?

Again thanks for the help.


If you supply $user_data - then you it will be passed in as the last argument 
to the ForEach function.



$model-foreach(
sub {
my($model,$path,$iter,$user_data -) = @_;
my($item)  = $model-get($iter, 0);

print $item\n;

# return TRUE to end
return FALSE;
}, $user_data --- ???
);


Here is an example that searches for a name in model:

sub search {
my($model,$path,$iter,$search_string) = @_;
  my($item) = $model-get($iter, 0);

if ($item =~ /$search_string/) {
  print FOUND\n;
  return TRUE;
  }
  else {
  return FALSE;
  }
}

$model-foreach(\search, 'Bob');
$model-foreach(\search, 'Billy');




___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Re: Perl bindings and the newest gtk+

2009-11-19 Thread Sergei Steshenko


--- On Thu, 11/19/09, Chris Debenham ch...@adebenham.com wrote:

 From: Chris Debenham ch...@adebenham.com
 Subject: Re: Perl bindings and the newest gtk+
 To: Sergei Steshenko sergst...@yahoo.com
 Cc: gtk-perl-list@gnome.org
 Date: Thursday, November 19, 2009, 12:21 PM
 They are working fine for me with gtk
 2.18.3
 
 2009/11/20 Sergei Steshenko sergst...@yahoo.com:
  Hello,
 
  are Perl bindings supposed to work with the newest
 gtk+, e.g. gtk+-2.18.* ?
 
  I haven't tried yet, just want to know about gtk+
 changes which could break
  the bindings, etc.
 
  Thanks,
   Sergei.
 
 
 
  ___
  gtk-perl-list mailing list
  gtk-perl-list@gnome.org
  http://mail.gnome.org/mailman/listinfo/gtk-perl-list
 
 
 
 
 -- 
 
 Jonathan Swift  - May you live every day of your
 life. -
 http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html
 

Thanks for the update.

My situation is like this:

1) there is system gtk+, and it's 2.14.*;

2) there is self-built gtk+ and all its dependencies - of course, in
separate from system directories.

I can build any version of anything in these separate directories, but
desktop theme remains common for system applications (e.g. 'firefox' which
I don't build) and for my applications based on my gtk+.

So, will the desktop theme compatible with gtk+-2.14.7 stay compatible with, 
say, gtk+-2.18.3 ?

When I upgraded to SUSE-11.1 with its gtk+-2.14.*, my then gtk+2.12.12
became incompatible with 'qtcurve' desktop theme which came with the
distro, that's why I upgraded my gtk+ to gtk+-2.14.7.

If I upgrade my gtk+ to gtk+-2.18.3, the situation with versions will
become the opposite - my gtk+ will be newer than the system one.

Well, the question, strictly saying, applies to gtk list, not to
gtk-perl-list :).


Thanks,
  Sergei.



  
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Re: Perl bindings and the newest gtk+

2009-11-19 Thread Chris Debenham
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



2009/11/20 Sergei Steshenko :

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Use GnuPG with Firefox : http://getfiregpg.org (Version: 0.7.10)

iEYEARECAAYFAksF1csACgkQenvI4bc00fUaxQCffV1HixOw58iS/3kZ4qJaPUp6
pmgAnjxXKM3vVDAUhpCB5o0lUnWBrgqu
=qD5E
-END PGP SIGNATURE-


 --- On Thu, 11/19/09, Chris Debenham ch...@adebenham.com wrote:

 From: Chris Debenham ch...@adebenham.com
 Subject: Re: Perl bindings and the newest gtk+
 To: Sergei Steshenko sergst...@yahoo.com
 Cc: gtk-perl-list@gnome.org
 Date: Thursday, November 19, 2009, 12:21 PM
 They are working fine for me with gtk
 2.18.3

 2009/11/20 Sergei Steshenko sergst...@yahoo.com:
  Hello,
 
  are Perl bindings supposed to work with the newest
 gtk+, e.g. gtk+-2.18.* ?
 
  I haven't tried yet, just want to know about gtk+
 changes which could break
  the bindings, etc.
 
  Thanks,
   Sergei.
 
 
 
  ___
  gtk-perl-list mailing list
  gtk-perl-list@gnome.org
  http://mail.gnome.org/mailman/listinfo/gtk-perl-list
 



 --

 Jonathan Swift  - May you live every day of your
 life. -
 http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html


 Thanks for the update.

 My situation is like this:

 1) there is system gtk+, and it's 2.14.*;

 2) there is self-built gtk+ and all its dependencies - of course, in
 separate from system directories.

 I can build any version of anything in these separate directories, but
 desktop theme remains common for system applications (e.g. 'firefox' which
 I don't build) and for my applications based on my gtk+.

 So, will the desktop theme compatible with gtk+-2.14.7 stay compatible with, 
 say, gtk+-2.18.3 ?

 When I upgraded to SUSE-11.1 with its gtk+-2.14.*, my then gtk+2.12.12
 became incompatible with 'qtcurve' desktop theme which came with the
 distro, that's why I upgraded my gtk+ to gtk+-2.14.7.

 If I upgrade my gtk+ to gtk+-2.18.3, the situation with versions will
 become the opposite - my gtk+ will be newer than the system one.

 Well, the question, strictly saying, applies to gtk list, not to
 gtk-perl-list :).


 Thanks,
  Sergei.


At its' basic level gtk is backward compatible - so stuff made for
2.14 will work fine in 2.18 (as long as it doesn't use any depreciated
functions from 2.14 which were removed by 2.18, but that is unlikely
in general)
Themes don't generally have any problems - but 'qtcurve' is not just a
theme, it is a theme-engine as well and it is the theme-engine part
which failed as it required some features that were only added in
2.14.  It should continue to work in 2.16 and 2.18 though.







-- 

Jonathan Swift  - May you live every day of your life. -
http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Re: Gtk2::TreeModel - foreach

2009-11-19 Thread muppet


On Nov 19, 2009, at 4:15 PM, Jeff Hallock wrote:


-Original Message-
From: gtk-perl-list-boun...@gnome.org [mailto:gtk-perl-list- 
boun...@gnome.org] On Behalf Of Zettai Muri

Sent: Thursday, November 19, 2009 3:56 PM
To: Martin Schlemmer; gtk-perl-list@gnome.org
Subject: Re: Gtk2::TreeModel - foreach

Where does the $user_data (scalar) part of the method come into play?
Is it possible to get an extended example that shows how this is  
used?




Is this data within the ListStore or some other data passed to the  
method?  How does the method act on this data?


Again thanks for the help.



If you supply $user_data - then you it will be passed in as the last  
argument to the ForEach function.


If you're thinking, but i can just use a closure for that, then  
you're already thinking perlishly.


The C api has user data pointers all over the place, because C doesn't  
have closures.  In perl, you get the option of using a closure or  
passing different parameters to a single function.  You'd choose to  
use the single function plus user data instead of a closure in a  
situation in which the closure would introduce a reference cycle.   
Pretty much any other time, you'd use a closure.



--
I can't believe i'm having to arbitrate who gets to have what dress on  
whose monkey.

  -- Me, exasperated at the ridiculousness of parenthood.

___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list