in reply to Perl Tk - Add text box on each button event

Which part are you having trouble with?

You seem to know how to construct a GUI at startup, adding elements to it at runtime is not different than at startup. You can keep GUI elements in arrays, just like any other objects.

  • Comment on Re: Perl Tk - Add text box on each button event

Replies are listed 'Best First'.
Re^2: Perl Tk - Add text box on each button event
by priyaviswam (Sexton) on Aug 05, 2011 at 09:57 UTC

    But how many time Im going to press button and how many element can i keep it in array is unknown right? Please correct me if Im wrong here.

      You can keep as many elements in an array as you have memory for storage. So just add one every time the user presses the button. (And maybe remove one if the user presses a different button).
Re^2: Perl Tk - Add text box on each button event
by priyaviswam (Sexton) on Aug 05, 2011 at 10:16 UTC

    I actually did not get the GUI element. This is my line of code $AddMoreTarget=$AddtargetBtnConfig->Button(-text=>"Add Host",-font=>"bold",-background =>"blue", -foreground => "white",-width=>20, -command=>\&AddHost, $AddtargetConfig1)->pack(); Where the "AddHost" will add the text box.Can you please point out the element which I can put into the array?