correction to previois similar e-mail - there was an error about what I added at #A
"Henry Merryweather" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Message-ID | <000d01c5b917$17a7dab0$0200a8c0@eveshampc> |
I am using the following to create a dialog box (following code in
Mastering Perl Tk - page 565).
$db = $main::mw_Main->DialogBox(
-title => $dl_title,
-buttons => ['OK']);
$db->add('LabEntry',
-textvariable
=> \$dm_entry,
-width
=> $dl_width,
-label
=> $dl_label,
-labelPack
=> [-side => 'left'])
#A
->pack;
#B
#C
$answer = $db->Show();
This works fine except that you have to use the mouse or something
similar to get the cursor in the window in which you type the required
data.
It would be better if the focus was already there.
I have tried:
1. adding $db->focus; at #B
2. $db->focus: at #B with -takefocus => 1 at #A
3. $db->bind('<Enter>' => [$db, 'Tk::focus']); at #C - this was
follwoing a succesful answer to a focus problme I had wioth a canvas.
However, none of these gave the desired result.
How can I get the focus in the widget when it is opened?
Best regards
Henry Merryweather