collapse/expand TreeView

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

collapse/expand TreeView

Fabio Marzocca
I am planning an application in which I need to display data in a List
window. Some element should be expandable/collapsable and every
element in the list should represent a string and a graphical colored
bar...

Any suggestion before starting on the wrong way? I am afraid that
SimpleList is not the best choice.
_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: collapse/expand TreeView

ofey aikon
On 6/18/05, The Saltydog <[hidden email]> wrote:
> I am planning an application in which I need to display data in a List
> window. Some element should be expandable/collapsable and every
> element in the list should represent a string and a graphical colored
> bar...

Won't Gtk2::Ex::Simple::Tree or Gtk2::TreeView do the job ?
_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: collapse/expand TreeView

Fabio Marzocca
On 6/19/05, ofey aikon <[hidden email]> wrote:
>
> Won't Gtk2::Ex::Simple::Tree or Gtk2::TreeView do the job ?

Yes, I have started with TreeView.
I was studying the cellrenderer_progress example in cvs:
http://cvs.sourceforge.net/viewcvs.py/gtk2-perl/gtk2-perl-xs/Gtk2/examples/cellrenderer_progress.pl?rev=1.1&view=log

but the code is buggy. I am getting a long list of:

GLib-GObject-WARNING **: invalid cast from `GtkTreeView' to `GtkRange'
at ../test line 87.

Do you confirm this warning also on your systems?
_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: collapse/expand TreeView

muppet-6

On Jun 19, 2005, at 2:57 PM, The Saltydog wrote:

> I was studying the cellrenderer_progress example in cvs:
> http://cvs.sourceforge.net/viewcvs.py/gtk2-perl/gtk2-perl-xs/Gtk2/ 
> examples/cellrenderer_progress.pl?rev=1.1&view=log
>
> but the code is buggy. I am getting a long list of:
>
> GLib-GObject-WARNING **: invalid cast from `GtkTreeView' to `GtkRange'
> at ../test line 87.
>
> Do you confirm this warning also on your systems?

The example works for me without any warnings.  What versions of gtk+  
and Gtk2 do you have?  I tested with

$ perl -MGtk2 -e 'print "$Gtk2::VERSION\n"'
1.080
$ pkg-config --modversion gtk+-2.0
2.4.14

and my CVS HEAD sandbox, which has

$ perl -MGtk2 -e 'print "$Gtk2::VERSION\n"; print join(".", Gtk2-
 >get_version_info)."\n";'
1.091
2.7.0


--
Without treatment, a common cold will last about seven days.
With treatment, it will last about a week.
   -- conventional wisdom

_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: collapse/expand TreeView

Fabio Marzocca
On 6/19/05, muppet <[hidden email]> wrote:
> The example works for me without any warnings.  What versions of gtk+
> and Gtk2 do you have?  


~ $ perl -MGtk2 -e 'print "$Gtk2::VERSION\n"'
1.061

~ $ perl -MGtk2 -e 'print "$Gtk2::VERSION\n"; print join(".",
Gtk2->get_version_info)."\n";'
1.061
2.6.4
_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: collapse/expand TreeView

muppet-6

The Saltydog said:
> On 6/19/05, muppet <[hidden email]> wrote:
>> The example works for me without any warnings.  What versions of gtk+
>> and Gtk2 do you have?
>
...
> ~ $ perl -MGtk2 -e 'print "$Gtk2::VERSION\n"; print join(".",
> Gtk2->get_version_info)."\n";'
> 1.061
> 2.6.4

Should be alright.


What's interesting is that your error message (from the earlier post) mentions
a GtkRange, a type which doesn't appear anywhere in the example you cited.
Are you sure the bug isn't in your adaptation of the example code?


--
muppet <scott at asofyet dot org>

_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: collapse/expand TreeView

Fabio Marzocca
On 6/20/05, muppet <[hidden email]> wrote:
> What's interesting is that your error message (from the earlier post) mentions
> a GtkRange, a type which doesn't appear anywhere in the example you cited.
> Are you sure the bug isn't in your adaptation of the example code?

I have just tested again.
Downloaded the source code from the cvs site, saved it as
cellrender_progress.pl, made it executable and run.
I have an infinite output like this:

GLib-GObject-WARNING **: invalid cast from `GtkTreeView' to `GtkRange'
at ./cellrender_progress.pl line 87.

I didn't make any adaptation. Line 87 of the code is:

 $style->paint_box ($window,
                     'normal', 'in',
                     undef, $widget, "trough",
                     $cell_area->x + $x_offset + $xpad,
                     $cell_area->y + $y_offset + $ypad,
                     $width - 1, $height - 1);

 
Fabio
_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: collapse/expand TreeView

muppet-6

The Saltydog said:

> GLib-GObject-WARNING **: invalid cast from `GtkTreeView' to `GtkRange'
> at ./cellrender_progress.pl line 87.
>
> I didn't make any adaptation. Line 87 of the code is:
>
>  $style->paint_box ($window,
>                      'normal', 'in',
>                      undef, $widget, "trough",
>                      $cell_area->x + $x_offset + $xpad,
>                      $cell_area->y + $y_offset + $ypad,
>                      $width - 1, $height - 1);

What theme are you using?  Some themes are notorious for making assumptions
about what type of widget is calling what rendering function...

I was using BlueCurve with 2.4 and the gtk+ built-in default with 2.7 and saw
none of those messages.

--
muppet <scott at asofyet dot org>

_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: collapse/expand TreeView

Fabio Marzocca
On 6/20/05, muppet <[hidden email]> wrote:
> What theme are you using?  Some themes are notorious for making assumptions
> about what type of widget is calling what rendering function...

Ubuntu Human theme. But it should not depend upon the theme...
What is that GtkRange the application is claiming for?
_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: collapse/expand TreeView

Torsten Schoenfeld
In reply to this post by muppet-6
On Mon, 2005-06-20 at 10:26 -0400, muppet wrote:

> What's interesting is that your error message (from the earlier post) mentions
> a GtkRange, a type which doesn't appear anywhere in the example you cited.
> Are you sure the bug isn't in your adaptation of the example code?

The $widget is a tree view and seems to get cast to a paned somewhere.
The message comes from the theme, so it depends on which one you use.  I
don't know what the correct behavior is, but passing undef instead of
$widget in the first paint_box call seems to work.

--
Bye,
-Torsten

_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: collapse/expand TreeView

Fabio Marzocca
On 6/20/05, Torsten Schoenfeld <[hidden email]> wrote:
> On Mon, 2005-06-20 at 10:26 -0400, muppet wrote:
> don't know what the correct behavior is, but passing undef instead of
> $widget in the first paint_box call seems to work.


yes it does work (also the original version worked, apart the
message). Now the warning has changed:

No widget to draw?!
No widget to draw?!
No widget to draw?!
No widget to draw?!
No widget to draw?!
No widget to draw?!
_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: collapse/expand TreeView

muppet-6
In reply to this post by Fabio Marzocca

The Saltydog said:
> On 6/20/05, muppet <[hidden email]> wrote:
>> What theme are you using?  Some themes are notorious for making assumptions
>> about what type of widget is calling what rendering function...
>
> Ubuntu Human theme. But it should not depend upon the theme...
> What is that GtkRange the application is claiming for?

I agree that it should not depend on the theme, but it appears that it does.

Neither the code in GTK+ nor the code in the example deal with a GtkRange, yet
somebody in the pipe, starting from a style method, is complaining about a bad
cast.

If you change your theme, does the warning go away or change?


--
muppet <scott at asofyet dot org>

_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: collapse/expand TreeView

muppet-6
In reply to this post by Fabio Marzocca

The Saltydog said:

> On 6/20/05, Torsten Schoenfeld <[hidden email]> wrote:
>> On Mon, 2005-06-20 at 10:26 -0400, muppet wrote:
>> don't know what the correct behavior is, but passing undef instead of
>> $widget in the first paint_box call seems to work.
>
>
> yes it does work (also the original version worked, apart the
> message). Now the warning has changed:
>
> No widget to draw?!
> No widget to draw?!
> No widget to draw?!
> No widget to draw?!
> No widget to draw?!
> No widget to draw?!

It's a bug in your theme, then.  That text string appears nowhere in the gtk+
source, nor in the gtk2-perl source.

The widget parameter to paint_box() is used by the theme implementation to get
hints, either from style properties or from the type of the object itself.
The "what sort of box" hint is the string "trough", and my guess is that your
theme's implementation of paint_box() thinks that a "trough" will only be
drawn for a GtkRange.



--
muppet <scott at asofyet dot org>

_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: collapse/expand TreeView

Fabio Marzocca
On 6/20/05, muppet <[hidden email]> wrote:
>
> The widget parameter to paint_box() is used by the theme implementation to get
> hints, either from style properties or from the type of the object itself.
> The "what sort of box" hint is the string "trough", and my guess is that your
> theme's implementation of paint_box() thinks that a "trough" will only be
> drawn for a GtkRange.

Thank you very much, muppet. I have posted a warning message in
Ubuntu-devel mailing list. I will let you know about answers.
_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: collapse/expand TreeView

Fabio Marzocca
On 6/20/05, The Saltydog <[hidden email]> wrote:
> On 6/20/05, muppet <[hidden email]> wrote:
> >
> > The widget parameter to paint_box() is used by the theme implementation to get
> > hints, either from style properties or from the type of the object itself.
> > The "what sort of box" hint is the string "trough", and my guess is that your
> > theme's implementation of paint_box() thinks that a "trough" will only be
> > drawn for a GtkRange.


It has been confirmed as a Bug of Clearlooks Theme..
_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list