Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Entry widget with explicit submit button

by choroba (Bishop)
on Feb 15, 2013 at 16:54 UTC ( #1018908=note: print w/replies, xml ) Need Help??

in reply to Entry widget with explicit submit button

What GUI are you using? If it is Tk, read Validation in Tk::Entry.
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re: Entry widget with explicit submit button

Replies are listed 'Best First'.
Re^2: Entry widget with explicit submit button
by amiksingh (Initiate) on Feb 15, 2013 at 17:37 UTC
    Yes, I am using TK. I read Validation in Entry, but that gives you option of "focus" on entry box and "key". But what I need is a separate button for a user to validate it.

    (For example, a user may play around with the text in Entry box, but he may not choose to conform to changes and might close the window. So, I want a submit button alongwith it. Only when it is pressed, I'll take the input.)
      Such a functionality does not exist. You have to create a normal Tk::Button and implement the logic yourself in its -command.
      لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
        okay, but I can't think of a logic because -textvariable of entry widget is changed on the go (as and when user types/changes something). So, how do I revert back to original data on a call from -command of button? (I guess that should have been my exact question, Sorry!)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2018-12-16 12:36 GMT
Find Nodes?
    Voting Booth?
    How many stories does it take before you've heard them all?

    Results (70 votes). Check out past polls.

    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!