Hi all, muppet pointed me to some code from bjarne steinsbo which gave me a better idea. Instead of all the Simple::* classes (Event, Toggle, etc.) there's a better way (tm). See attached implementation of Gtk2::TieScalar and Gtk2::TieArrayRef. The docs are complete this time. There's a tietest2.pl that pops up that familiar GUI, and a testtie.pl that just uses a test package to run through some things. This implementation differs from Bjarne's in that they are separate classes. Bjarne's code runs through some hoops in what's allowed or not, I dispensed with all that. To me, a runtime error for unknown sub is just as good as complaining before the fact, and simpler too. As well, the Tie* classes support arbitrary anonymous subs for get/set operations, so these are actually quite general purpose classes. Come to think of it, I'm not even sure that they really belong in Gtk2, but that's for later. This still doesn't get rid of the Simple::Bind::* versions, as they are more complicated. And it doesn't get rid of the necessity of those classes either. I'm working that out next. Also, doesn't really get rid of the necessity (er.. utility) of a simple OptionMenu and friends. Those should still be implemented, but can probably be done independent of the Tie stuff now. As always, comments appreciated. Regards, Carl
Attachment:
Gtk2-TieScalar.tar.gz
Description: application/compressed-tar