Hi all,
Using TK created a MainWindow which is constructed in part from what it pulls from a database (MLDBM database). From the menus of the program the user can then input some additional program values that are stored into the DB. These new values are then used on the next runnig of the window and included in the MainWindow.
So far ... upon restarting the program the MainWindow reflects the new CheckButton additions from the database, but I want it to dynamically create these widgets while the program is still running. So that when a user adds the item from the menu the MainWindow is updated on the fly. There obviously is a way to do this.
For now ... I create the buttons in a subroutine (as below) and recall the subroutine when the user saves to the database.
I assume I have to create a frame object and refresh that after a user adds an item to the database. How do I do this? Something is not quite right in my thinking here.
Dean
my $shiftselect;
my $shiftsframe = $topframe->Frame->pack;
&displayshifts;
sub displayshifts {
## Display all shift types and create Radiobuttons for each
+
my ($ra, $rb);
while (($ra, $rb) = each (%db_sh)) {
$_ = $topframe->Radiobutton(-text => $db_sh{$ra}->{'ShiftName
+'},
-variable => \$shiftselect,
-value => $ra
) -> pack;
}
}
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.