The code given is cut down as far as I can to demonstrate the problem. I have a Tk window, where I want a listbox with a label at the top. I also want to set the icon myself. The following code is intended to do this:
use strict;
use warnings;
use diagnostics;
use Tk;
my $cboAgent;
my $mw = MainWindow->new;
$mw->geometry('200x400');
$mw->toplevel->resizable(0,0);
$mw->Label(-text => 'Agent' )
->place(-x => 0,
-y => 0
);
($cboAgent) = $mw->Scrolled('Listbox',
-height => 20,
-width => 10,
-scrollbars => 'e')
->place(-x => 0,
-y => 25
);
$mw->toplevel->iconbitmap('C:\Template\v3_5\TARDISdv\Tardis.ico');
MainLoop;
This produces everything bar the listbox. However, if I comment out either the label or the icon commands (or both), I get the listbox. I have tried changing the order of the commands, but it doesn't seem to make a difference. However, I haven't tried every possible combination. Please would someone point out my stupidity? My system configuration
is in my scratchpad. Update: WAS in my scratchpad. I didn't think it was relevant, and so it proved. But it's in my private scratchpad if anyone REALLY needs it. /update
TIA & regards,
John Davies
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.