Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Comment on

( #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

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

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others studying the Monastery: (1)
    As of 2018-08-18 14:11 GMT
    Find Nodes?
      Voting Booth?
      Asked to put a square peg in a round hole, I would:

      Results (185 votes). Check out past polls.