Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

grantm (164)

grantm
  (email not shown publicly)
http://www.mclean.net.nz/

Just a simple [cpan.org] guy, hacking Perl for fun and profit since way back in the last millenium. You may find me hanging around in the monestary [perlmonks.org].

What am I working on right now? Probably the Sprog project [sourceforge.net].

GnuPG key Fingerprint:
6CA8 2022 5006 70E9 2D66
AE3F 1AF1 A20A 4CC0 0851

Journal of grantm (164)

Thursday July 22, 2004
09:15 PM

Playing with Gtk

[ #20009 ]

I'm currently playing around with a pet project that uses Gtk2. After I add a bit of handler code or a new widget, I run the program and find myself resizing the windows back and forth, clicking and dragging and generally messing about far longer than is necessary. Well I did say I was playing :-)

My current challenge involves a Gtk2::TreeView. I think I've got my head around the MVC theory and the GTK mechanics and I even have it working for the simple case where every row contains text. However I really want some of the rows to contain a separator bar that at looks like a Gtk2::HSeparator. Anyone know how to achieve that?

Sadly Pango markup does not support the <hr> tag or it would be pretty simple. I'm wondering if I'll have to write my own cell-renderer and if that's even possible from Perl. Anyway I'm having fun.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • for the record, I was able to implement custom cell rendering. One column value in my model was used to flag whether the cell was rendered as text or as a separator; another column contained the text (if any).

    I got the basic elements of the solution from this script [sourceforge.net] in the gtk-perl examples directory. In my RENDER method I used $widget->get_style->paint_shadow to draw the separator box although I might try paint_box with a "bar" style.