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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:30:47+00:00 2026-05-24T22:30:47+00:00

I have multiple panels in my app, that reside in a wx.Notebook . For

  • 0

I have multiple panels in my app, that reside in a wx.Notebook. For sake of illustration, let’s assume I have a panel called LaunchPanel in a file called launchTab, and a panel called ScanPanel in a file called scanTab.

I have a button on ScanPanel that can lockup the GUI for a while, so I am currently disabling every widget on the panel itself when the long-running-task kicks off. This all works fine. But I want to disable other things in the other panels now that may conflict if the user goes trigger happy with the left mouse button. I found that you can disable a panel with panel.Disable(), but I don’t know how to, for instance, call Disable for the panel in LaunchPanel from within ScanPanel.

I’ve tried import launchTab from within launchTab to get access to ScanPanel:

import launchTab
...
launchTab.LaunchPanel.Disable()

but get this error:
TypeError: unbound method Disable() must be called with LaunchPanel instance as first argument (got nothing instead)

I think the answer is a pubsub, but I don’t know how to set one up to muck with the panel, I’ve only ever used them to update a widget…? There’s an immense amount of sourcecode at the moment, so I don’t want to paste all of it, but I can provide more clarification if it is needed.

Help? Thoughts?

EDIT PER BELOW ANSWER:

So — I’m not quite sure I understand… there’s the following components to the app. myAppGUI.py:

class myNotebook(wx.Notebook):
    """
    The core layout for the app -- notebook pages are slotted here
    """

    #----------------------------------------------------------------------
    def __init__(self, parent):
        wx.Notebook.__init__(self, parent, id=wx.ID_ANY, style=wx.BK_DEFAULT)

        self.AddPage(launchTab.LaunchPanel(self), "Launch")
        self.AddPage(scanTab.ScanPanel(self), "Scan")
        self.AddPage(extractTab.ExtractPanel(self), "Extract")
        self.AddPage(virtualsTab.VirtualsPanel(self), "Virtuals")

This is the main file that launches all my other notebook tabs. Then, I have, launchTab:

class LaunchPanel(wx.Panel):
"""
Launch Tab for finding and launching databases
"""
#----------------------------------------------------------------------


def __init__(self, parent):
    """"""
    wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY)

    super(LaunchPanel, self)
    self.initialize()

def initialize(self):

    global sizer

    panel = self
    sizer = wx.GridBagSizer(11, 3)
    <snip>

And then I have, scanTab:

class ScanPanel(wx.Panel):
    """
    Scan Tab for running Sonospy Database Scans, Updates and Repairs
    """
    #----------------------------------------------------------------------
    def __init__(self, parent):
        """"""
        wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY)

        panel = self
        sizer = wx.GridBagSizer(6, 5)
        self.launchPanelRef = None

I’ve tried the answer below, but I think since my init is using parent=parent (which I took off sample code somewhere else to get it working originally), I get the following error:

File "gui/scanTab.py", line 223, in __init__
    launchPanel = launchTab.LaunchPanel()
TypeError: __init__() takes exactly 2 arguments (1 given)

When you say to put:

def main():
  scanPanel = ScanPanel()
  launchPanel = LaunchPanel()
  scanPanel.setInstanceLaunchPanel(launchPanel)

Does that go within scanTab? And is launchPanelRef the name of the panel I want to control in this case?

Sorry — I’m easily confused. 🙂

-Chow

  • 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-24T22:30:49+00:00Added an answer on May 24, 2026 at 10:30 pm

    The error you are getting is because you are calling a method of a class without an instance of an object of that class.

    You need to pass the instance of your LaunchPanel class (your LaunchPanel object), into your ScanPanel class.

    class ScanPanel:
      def __init__:
        self.launchPanelRef = None
        <snip>
    
      def setInstanceLaunchPanel(launchPanelRef):
        self.launchPanelRef = launchPanelRef
    
    
    def main():
      scanPanel = ScanPanel()
      launchPanel = LaunchPanel()
      scanPanel.setInstanceLaunchPanel(launchPanel)
    

    Now within ScanPanel you have a reference to your launchPanel object that you can call disable on.

    Does that make any sense?

    EDITS

    I am guessing you want to be able to disable the “launchPanel” from the “scanPanel”, right?
    You need to add the setInstanceLaunchPanel to the scan panel. All it does it allow you to store a reference to the launch panel. This means that within the scan panel you’ll be able to control the launch panel instance.

    class myNotebook(wx.Notebook):
        """
        The core layout for the app -- notebook pages are slotted here
        """
    
        #----------------------------------------------------------------------
        def __init__(self, parent):
            wx.Notebook.__init__(self, parent, id=wx.ID_ANY, style=wx.BK_DEFAULT)
    
            launchPanel = launchTab.LauchPanel(self) #init launchPanel
            scanPanel = scanTab.ScanPanel(self) #init scanPanel
            scanPanel.setInstanceLaunchPanel(launchPanel) #store reference to launchPanel in scanPanel
            self.AddPage(launchPanel, "Launch") #add launchPanel to notebook
            self.AddPage(scanPanel, "Scan") #add scanPanel to notebook
            self.AddPage(extractTab.ExtractPanel(self), "Extract") #init extractPanel and add to notebook
            self.AddPage(virtualsTab.VirtualsPanel(self), "Virtuals")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple (8) WAR files and 1 EAR file that I want to
In a page I have multiple update panels that have timers associated with them
I have an application that has multiple panels; I would like to have the
I have a form that will multiple Panel controls stacked on top of each
I have a panel with multiple panels inside of it. I have overridden OnPaint
I have multiple panels and on each panel I have 2 RadioButtons. I need
I have an ASPX page with multiple Content panels. In one panel is a
so i'm trying to set up an application where i have multiple panels inside
I have multiple databases that I connect to using SQL*Plus in Windows (not the
I have multiple panels on a JFrame window. I am going to populate each

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.