Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

perl Tk

by Anonymous Monk
on Jan 20, 2005 at 09:25 UTC ( [id://423633]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks

I am new to perl tk.

1. Is there any way to restrict the user to enter in BrowseEntry. i.e i want to give the option of only selecting from the existing values

2. I come across terms like Button-1, Button-2. Upto Button-5 is valid. What does these represent. Any resources on this would also be helpful.

thanx in advance

Replies are listed 'Best First'.
Re: perl Tk
by castaway (Parson) on Jan 20, 2005 at 11:18 UTC
    1. You could add a -browsecmd callback to your BrowseEntry constructor, add use it to check that the entered value exists in the list, else delete it or otherwise give some error message. (Since the docs dont say, just experiement with this callback to see what it passes you, by running a print "@_\n"; at the top of it).

    You would probably be better off using a ListBox though.

    2. The elements that can be bound to are listed in the Tk::bind documentation.

    C.

Re: perl Tk
by Crian (Curate) on Jan 20, 2005 at 11:49 UTC

    Button-1, Button-2, ... are mouse buttons.

    Take a look at perldoc Tk::bind for more informations, just as castaway said.

Re: perl Tk
by jdtoronto (Prior) on Jan 20, 2005 at 19:38 UTC
    1.. In your BrowseEntry constructor specify -state => readonly.

    That widget can have three modes, normal - select form the popup list or enter directly, readonly - must choose a value fomr the list or disabled - does nothing.

    2.. See Tk::bind documentation.

    jdtoronto

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-04-25 21:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found