Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

clearing widgets embedded inside Text box and radiobutton question
hi
i just started using Tk
i have made a left frame with some radiobuttons that is supposed to
show different   widgets on a right frame whenever the user clicks on
it. For example, if user clicks on Radiobutton 1, the right frame will
display a button. I have created a Text box in the frame and embedded
the button inside this Text box.
I find that whenever i click many times on Radiobutton 1 , the button
is drawn. I only want to draw the button once whenever the user clicks
radiobutton 1, how do i do that?

another question is if the user click on Radiobutton 2, i want to
clear the button in the Text box. So far , i used destroy to destroy
the whole Text box and recreate again. I am sure there is more elegant
way of removing widgets inside a Text box. How can i remove the button
from the Text box ?
thanks

Report this thread to moderator Post Follow-up to this message
Old Post
justme
09-28-04 09:11 PM


Re: clearing widgets embedded inside Text box and radiobutton question
justme wrote:
> hi
> i just started using Tk
> i have made a left frame with some radiobuttons that is supposed to
> show different   widgets on a right frame whenever the user clicks on
> it. For example, if user clicks on Radiobutton 1, the right frame will
> display a button. I have created a Text box in the frame and embedded
> the button inside this Text box.

Why a Text widget? Why not keep it as a frame and create the button
inside that frame? It will make life easier.

> I find that whenever i click many times on Radiobutton 1 , the button
> is drawn. I only want to draw the button once whenever the user clicks
> radiobutton 1, how do i do that?

By keeping a record of whether you created the button or not. If you
did, then simply return from the Radiobutton1 callback before you create
the button again.

> another question is if the user click on Radiobutton 2, i want to
> clear the button in the Text box. So far , i used destroy to destroy
> the whole Text box and recreate again. I am sure there is more elegant
> way of removing widgets inside a Text box. How can i remove the button
> from the Text box ?

$button->destroy;

But I have a feeling your approaching your problem from the wrong angle.
If you tell us more about your application, perhaps someone can suggest
a better approach.

--Ala


Report this thread to moderator Post Follow-up to this message
Old Post
Ala Qumsieh
09-29-04 09:59 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PerlTk archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:35 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.