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 726143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:25:07+00:00 2026-05-14T06:25:07+00:00

Ok guys, I’m really new at python (and programming itself) so sorry for my

  • 0

Ok guys, I’m really new at python (and programming itself) so sorry for my ignorance, but I really needed to ask this.
So im doing a wxPython project where I added several tabs for a notebook (each tab of the notebook = a class) and there is one tab where I added a checkbox (in a tab, lets call it for example Tab1), and what I want is that when someone checks it, a button that exists in other tab (class called for example tab2) gets hidden where previously it was being shown.

Well I see that it isn’t hard to accomplish this, but my problem is the classes (tab1 and tab2, in this example). I’ve been trying to figure it out by searching but I guess im not searching hard enough because I just can’t get it right. If they were in the same class I wouldn’t have a problem, but as they are in different classes, im having a huge struggle with this.

Hope someone can help me, and sorry for my ignorance once again.

EDIT: Sorry guys wasn’t being shown/hidden, but rather being enabled/disabled.

class Tab2(wx.Panel):
    def __init__(self, parent):
    .....
        self.jaddbutton = wx.Button(self,-1, label ="Button", size = (160,24))
        self.jaddbutton.Bind(wx.EVT_BUTTON, self.jaddbuttonclick, self.jaddbutton)
    def jaddbuttonclick(self, event):
        ....
class Tab1(wx.Panel):
    def __init__(self, parent):
        self.jdcheck = wx.CheckBox(self, -1, 'Disable')
        self.jdcheck.Bind(wx.EVT_CHECKBOX, self.checkoptions, self.jdcheck)
    def checkoptions(self,event):
        checkboxval = self.jdcheck.GetValue()
        if checkboxval == False:
            self.jaddbutton.Disable() # This is what I want to do but it is on the other class

        else:
            self.jaddbutton.Enable() # Same as above

class TextFrame(wx.Frame):
   def __init__(self):
       p = wx.Panel(self)
       self.nb = wx.Notebook(p, size = (750, 332))
       #Tabs
       tab1 = Tab1(self.nb)
       tab2 = Tab2(self.nb)
       self.nb.AddPage(tab1, "ssomething")
       self.nb.AddPage(tab2, "somethingr")
  • 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-05-14T06:25:07+00:00Added an answer on May 14, 2026 at 6:25 am

    In the tabs’ __init__, save the parent reference (the notebook):

    class Tab1(wx.Panel):
        def __init__(self, parent):
            self.parent = parent
            ...etc, etc...
    

    Then, self.parent.GetPage(x) lets you access the x-th page (i.e., tab) of the notebook from any other page (tab). So instead of self.jaddbutton.Disable() etc, you’d be using, e.g.:

    othertab = self.parent.GetPage(1)
    othertab.jaddbutton.Disable()
    

    and so forth.

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

Sidebar

Ask A Question

Stats

  • Questions 401k
  • Answers 401k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Does AutoDateFormatter do what you want? Even if it doesn't,… May 15, 2026 at 4:34 am
  • Editorial Team
    Editorial Team added an answer You can use array_map with anonymous functions: // PHP 5.2… May 15, 2026 at 4:34 am
  • Editorial Team
    Editorial Team added an answer Like hsource said, try validating both css files. http://jigsaw.w3.org/css-validator/ Also… May 15, 2026 at 4:34 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.