Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7865175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:00:30+00:00 2026-06-03T00:00:30+00:00

I am writing a Tkinter program. The main class is MainFrame() class MainFrame(Frame): def

  • 0

I am writing a Tkinter program. The main class is MainFrame()

class MainFrame(Frame):

    def __init__(self, master=None):

        Frame.__init__(self, master)
        self.grid()

        # sets up the tab bar
        self.tabbar = TabBar(self, 'File Tabe Bar')
        self.tabs = []
        self.add_tab(self.tabbar, 'Hello Tab') # add a new tab to self.tabs
        self.tabbar.pack()  # make it visible

    def add_tab(self, parent, name='Default'):
        tab = Tab(parent, name)
        self.tabs.append(tab)

Will each of the tab variable created by invoking add_tab persist throughout the life time of the main frame (until it is destroyed)? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:00:32+00:00Added an answer on June 3, 2026 at 12:00 am

    Each variable is bind to an object Tab. Each Tab has a parent. The variable local to the function will be gone once the function exists – that is, the binding is lost, but you have the reference to the object Tab (each of them) in the list self.tabs which persist throughout the life time of the object MyFrame.

    Each object Tab will live until the parent class (and / or the parents of the parent class) are destroyed (or by invoking a destroy method on Tab)

    Just my wild guess ::(

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a tkinter program that is kind of a program that is
I'm writing a slideshow program with Tkinter, but I don't know how to change
This a screenshot from a Tkinter Listbox in a program I'm writing: Why does
I'm writing a Python program with a GUI built with the Tkinter module. I'm
I am writing a Tkinter program that requires a loop. I can't run the
I'm writing a client-server program in Python with Tkinter. I need the server to
I am writing a relatively simple program using Tkinter that is a converter for
Writing a python program, and I came up with this error while using the
I writing a JSP program that needs to react on an existing program. It
I have written a program in Tkinter (Python 2.7), a scrabblehelper in Norwegian which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.