![]() |
|
"be consistent" | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
What this means is that you can create a part of a GUI with ZooZ, and dump that as a .PM file. The .PM file will contain a Tk mega widget that you can include as:++ to that, several times over. Now, what would be really cool would be to pass an object into the megawidget, and use that for callbacks/variables in the same way as I described in the OP. The Tk::mega constructor doesn't like more than 2 params, but that can be overloaded in the .pm file like this:
Done this way the callbacks would be acting on $worker, which is in package scope, so don't need to be exported into main:: This would entail changes to dumpPerlPM to declare objects as undef, then construct the my ($class,$mv,..,..,..) = @_ line in new with a list of the objects. From playing with this last night, I don't think the changes I sent you last week write out object attributes to .pm files correctly anyway - I'll take another look at that. That would allow me to create standard megawidgets associated with my classes, and maybe even in the class, create methods like this:
(With the autouse just in case I'm using my class on a system with no tk installed). Then, to put (for example) a list of servers with checkboxes in my window, I'd just need to do this:
I guess this kind of stuff in general Tk programming terms is probably covered in one of the Tk programming books. Perhaps a trip to the bookshop is called for...
--------------------------------------------------------------
"If there is such a phenomenon as absolute evil, it consists in treating another human being as a thing." Can you spare 2 minutes to help with my research? If so, please click here In reply to Re^2: Writing and maintaining Tk GUIs with ZooZ
by g0n
|
|