Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: A Tk::DialogBox Tk::Entry question. (workarounds are bad)

by Anonymous Monk
on Oct 13, 2014 at 08:31 UTC ( [id://1103593]=note: print w/replies, xml ) Need Help??


in reply to Re: A Tk::DialogBox Tk::Entry question. (workarounds are bad)
in thread A Tk::DialogBox Tk::Entry question.

Try  $dialog->Show('global');

Replies are listed 'Best First'.
Re^3: A Tk::DialogBox Tk::Entry question. (workarounds are bad)
by Anonymous Monk on Oct 14, 2014 at 15:04 UTC
    Thank you very much for responding to my question. After seeing your reply I quickly checked at the docs for 'global'.

    As per perldoc for Tk::Entry it's about the grab thing (i.e. grabbbing the input -- mouse and keyboard). Also from the book 'Mastering Perl/Tk by Oreily Press Chapter 13 - a global grab means no applications in the entire system can get input except the one window that has done the global grab. But Windox XP does allow me to select through mouse as well type into other applications in the system. I do not know if that's how global grab is implemented in this OS.

    Anyway, back to the original question, your fix works correctly when the workaround code is removed. Therefore out of curiosity and for learning purposes my question is
    1. In the first place, how's is the fix for this problem related to grab thing?
    2. When the workaround code is in place this fix does not work. Therefore, is the grab and virtual event somehow opposed to each other ?
    3. Also as an aside, I created a binding for the paste (i.e. Control-v) as there is no default binding for it,
      $entry->bind('<Control-Key-v>'=>sub{ $_[0]->delete ('sel.first', 'sel.last'); $_[0]->insert ('insert', .....); });
      but how can I get the string to be pasted passed into the callback(hence left out as five dots above) ?
      But when I comment out the line calling insert method, the paste works as expected. That said, as per the perldoc for Tk::Entry there is no default binding for Control-v. So how does this work then. I'm confused.
    I'm really curious. So please let me know.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1103593]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-25 06:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found