Re: Subclassing Gtk2::CellRenderer



On Thursday, October 2, 2003, at 07:43 AM, Bjarne Steinsbø wrote:

Still, wouldn't it be nice to be able to do anything you can do in C in perl as well? Not necessarily making it simple to do in perl, but at least possible?

yes, it would be nice to have all the C functionality in perl, but it comes at a price, and for some things the price is just too high.


Some additional magic during code generation, maybe? Exposing in special-purpose perl classes what you're doing your best to hide in the normal case?

i spent a very long time several months ago trying to figure this one out, and a good while last night looking over it again to see if it'd missed anything. (i had a very long section here about how i'd go about implementing generic overridable methods, to illustrate why we don't do it, but in the end it was just to long and muddled. if you really want to know, ask later and i'll explain.) that whole idea got left by the wayside when i finally discovered that g_signal_override_class_closure was the sanctioned way to do this, even though it has limitations.

i think, though, it would be possible to add some special stuff to the bindings for just this one class (GtkCellRendererClass) to see what we can do to add support for overriding those functions.

but be warned, this is "new function" stuff, so please don't expect it to be part of the stable release. (it'll take some bribery otherwise. ;-)


An optionmenu shouldn't really be that hard to render in the normal case, it's just a string and a pixmap. It's the editing phase that's complicated. But I see your point.

from what i can tell, you just need something like gtk_paint_drop_shadow around the edges of the box and maybe some sort of indicator that you can click on this thing to pop up a menu. the string will be easy, using pango rendering. the fun comes in when you have to calculate box dimensions and such. i'm interested in seeing the difference in performance between perl and C.


i have to run... contact me offlist if you want to try something like this.


P.S. I think I stumbled across a typo in the xs documentation for Glib. Please see attached diff.

eek!  thanks!

--
muppet <scott at asofyet dot org>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]