Hello Monks,

I'm using perl's Gtk2 class for the first time and I'm having a bit of difficulty figuring out how the heck those
options work for attaching an object to a table.

I found a couple different sites that "try" to explain what each option is, but it really doesn't make much sense to me
and every site I found say the EXACT same thing, almost word-for-word, so it really isn't helpful...

I know the format of attaching a "widget/object" to the table is like so:
### ATTACHING TO A "TABLE": $table->attach( $child, $table->attach_defaults( $child, $left_attach, $left_attach, $right_attach, $right_attach, $top_attach, --OR-- $top_attach, $bottom_attach, $bottom_attach); $xoptions, $yoptions, $xpadding, $ypadding );
So in the explanations I found they say the left/right_attach are for where to place the object in the table so if my table
looks like this:
+-----+-----+ | | | +-----+-----+ | | | +-----+-----+
I was under the assumption, and according to the explanations I found, the first 2 options after the $child object are for where I
want to place the object within the table. So if I wanted my $button in the top left quadrant I would do:
$button->attach_defaults($button, 0, 0, ?, ?);
But that will just throw an error saying something like; "assertion 'left_attach < right_attach' failed at ...."


Would it be possible if someone could explain to me what exactly each one of those options actually do?
I'm really confused about the left/right/top/bottom_attach options will actually do..??

Any suggestions/explanations would be greatly appreciated!


Thanks in Advance,
Matt



In reply to Perl Gtk2 Table's Attach method by mmartin

Title:
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, details, 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, summary, 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.