On 5/13/2013 10:47 AM, Kim Skatun wrote:
> Do you create all entries at init even if in most cases you dont need them? And then forget them and
> create the ones you need as default?
>
You could just create all of the widgets once at the beginning; and
using grid, display or hide them as needed. If you prefer, instead of
hiding and displaying, you can destroy and recreate them as well. I
guess it depends on how much effort you have already put into it.
> The problem is that i get an error saying it already exist if i first show it then hide(forget) it
> and then show it again.
>
If you are almost there, there may be no need to switch strategies. You
can simply put a check to see if the widget already exists like this:
if {[winfo exists $xyz]} {
# just display or hide it here
} else {
# here, create it from scratch and display it
}
DrS