Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I find lots of information about creating composite widgets in Tk; I don't find so much about how to create 'composite items' on a Canvas, or Zinc specifically, which is what I do (?) in my code. Can you point me to some code that implements objects that represent complex item collections on a canvas? (or documentation of such a pattern)

I already pointed you to the TripleRotatingWheel in the Zinc demo, and the Bubbles on Zinc at Re^3: Tk/Zinc mouse drag performance issues? I use the ztkbubble example as a basis for making almost any type of composite item on Zinc.

I think basically the idea is to bless an object with Zinc as the parent, then make a group in it. Then have methods for the object and internal timers to make it alive. :-)

Other than that, this is beginning to sound like work. :-)

I'm not really an OO oriented type of programmer, but to me there are 2 possible paths....

1. Create your Zinc canvas, and pass it as an option to your new class, like ztkbubble, so you can have a parent widget for your objects.

2. Subclass Zinc, and make your own Zinc class. You can then add your own methods etc to it.

Your script works well here, fast and peppy, but with that grabglobal, I can't start a top to see cpu usage. :-)


I'm not really a human, but I play one on earth Remember How Lucky You Are

In reply to Re: GUIs in Tk.:Zinc; a perl module experiment by zentara
in thread GUIs in Tk.:Zinc; a perl module experiment by rocklee

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-25 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found