I'm looking for a standalone separator widget for Perl/Tk, something to draw a line between other widgets. Imagine something like HTML's "hr" tag that can be horizontal or vertical ... or for those familiar with the old Motif, something like XmSeparator.
Does anyone know of an existing widget for this? If not, what could easily be made to do this?
I can do an empty Frame with a raised relief and a non-zero borderwidth like:
my $frame = $parent->Frame();
my $info = $frame->Label(-text => "General Info")->pack();
# separator ... sort of
$frame->Frame(-background => "black", -borderwidth => 1, -relief => 'r
+aised', -height => 2)
->pack(-fill => 'x', -padx => 5, -pady => 5);
my $comments = $frame->Label(-text => "next widget")->pack();
which gets me really close, but it seems cumbersome. I assume I can do something similar for verticals with some option changes, but I haven't tried it yet. Is there a better alternative anyone can suggest?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.