How to make a button active and inactive

Hello All,
I wanted to know in a wxpython program how can i make button inactive for some part of program execution and then i can make it active later.

button.Disable()
button.Enable()

Also, in that button handler how can i call a new frame class which is in another module. For eg. i have main.py where i am haivng a button handler and i have temporary.py where i ahve a class called menu. How can i call this in main.py…

#make sure the module temporary.py is in the same directory as main.py

#have to import the module first
import temporary

def button_handler(self,event):
#use dot notation to access the class in the module

menu = temporary.Menu()
#now you have a reference to your menu class from the other module
···

On Feb 12, 2008 9:31 PM, Varsha Purohit varsha.purohit@gmail.com wrote:

Hi,
Thanks for the suggestion. I had another question when i invoke menu in the main.py will the frame launch itself or do i need to call the showmodal method for the frame separately in the main program’s button handler.

thanks,

···

On Feb 12, 2008 8:58 PM, C M cmpython@gmail.com wrote:

On Feb 12, 2008 9:31 PM, Varsha Purohit varsha.purohit@gmail.com wrote:

Hello All,
I wanted to know in a wxpython program how can i make button inactive for some part of program execution and then i can make it active later.

button.Disable()
button.Enable()

Also, in that button handler how can i call a new frame class which is in another module. For eg. i have main.py where i am haivng a button handler and i have temporary.py where i ahve a class called menu. How can i call this in main.py…

#make sure the module temporary.py is in the same directory as main.py

#have to import the module first
import temporary

def button_handler(self,event):
#use dot notation to access the class in the module

menu = temporary.Menu()
#now you have a reference to your menu class from the other module


Varsha Purohit,
Graduate Student