'myApp' object has no attribute 'closebtn' - import wx, os, shutil, fnmatch, sys, textwrap, re
-
import wx.lib.intctrl
-
-
class myApp(wx.Frame):
-
def __init__(self,parent,id):
-
wx.Frame.__init__(self,parent,id,'Export Form', size=(500,500))
-
panel =wx.Panel(self)
-
-
#Creating Static texts
-
text1 =wx.StaticText(panel, -1,"Select Data Source",(150,10),(150,-1),wx.ALIGN_CENTER)
-
text1.SetForegroundColour('Blue')
-
#text1.SetBackgroundColour('Blue')
-
-
-
text2 =wx.StaticText(panel, -1,"Use Chain Seeds",(40,60),(150,-1),wx.ALIGN_LEFT)
-
text3 =wx.StaticText(panel, -1,"Use Custom Seeds",(40,90),(200,-1),wx.ALIGN_LEFT)
-
text4 =wx.StaticText(panel, -1,"Export template",(140,130),(200,-1),wx.ALIGN_LEFT)
-
text5 =wx.StaticText(panel, -1,"Apply Selection",(210,310),(200,-1),wx.ALIGN_LEFT)
-
text6 =wx.StaticText(panel, -1,"Return to main menu",(210,360),(200,-1),wx.ALIGN_LEFT)
-
# Setting the fonts
-
font1 =wx.Font(15, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
-
font2 =wx.Font(10, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
-
-
#Applying Fonts
-
text1.SetFont(font1)
-
text2.SetFont(font2)
-
text3.SetFont(font2)
-
text4.SetFont(font2)
-
text5.SetFont(font2)
-
text6.SetFont(font2)
-
-
#Creating Buttons
-
button1 =wx.Button(panel,label="Export",pos=(75,120),size=(50,30))
-
button2 =wx.Button(panel,label="Select Custom Data File",pos=(90,200),size=(150,30))
-
button3 =wx.Button(panel,label="",pos=(150,300),size=(50,30))
-
button4 =wx.Button(panel,label="",pos=(150,350),size=(50,30))
-
-
-
#Creating Radio Buttons
-
rb1 =wx.RadioButton(panel, -1,'',(25,60),style=wx.RB_GROUP)
-
rb2 =wx.RadioButton(panel, -1,'',(25,90))
-
-
self.Bind(wx.EVT_BUTTON, self.closebtn, button1)
-
-
def closebtn(self,event):
-
self.Close(True)
-
-
if __name__ == '__main__':
-
app=wx.PySimpleApp()
-
frame=myApp(parent=None,id=-1)
-
frame.Show()
-
app.MainLoop()
1 2030 bvdet 2,851
Expert Mod 2GB
Your indentation is incorrect. Move method "closebtn" out to the same indentation as "__init__".
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Thomas Nücker |
last post by:
Hi!
I have the following problem within a program, that is using the
python dll. With this program i want to use Tkinter, but after setting
all paths i get the following error:
Traceback...
|
by: livin |
last post by:
my log...
INFO urllib.urlopen('http://192.168.1.11/hact/kitchen.asp',
urllib.urlencode({'Action': 'hs.ExecX10ByName+Kitchen+Lights%2C+On
%2C+100&x=4&y=6'}))
INFO
INFO File...
|
by: johnny |
last post by:
I am getting the following errors:
File "H:\xampp\xampp\xampp\python\lib\httplib.py", line 679, in
_send_output
self.send(msg)
File "H:\xampp\xampp\xampp\python\lib\httplib.py", line 646, in...
|
by: erikcw |
last post by:
Hi,
I'm trying to build a SQL string
sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""",
(cid, ag, self.data)
It raises this error: AttributeError: 'tuple' object has no...
|
by: Eric Mahurin |
last post by:
Is there a standard way to get a descriptor object for an arbitrary
object attribute - independent of whether it uses the descriptor/
property protocol or not. I want some kind of...
|
by: Matt McCredie |
last post by:
I built and installed python 2.5 from source and when I do this:
You need `_ssl.pyd' for HTTPSHandler to work. I guess, try to figure
out why that wasn't built, then build it. I suppose I...
|
by: Nikhil |
last post by:
I have recently written a small module. When I import the module, I
always get the error
only when I do
--
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
|
by: =?iso-8859-1?q?KLEIN_St=E9phane?= |
last post by:
Hi,
I'm on Ubuntu 8.04.1
I've installed lxml with easy_install lxml command.
Now, when I load etree I've this error :
$ python
Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
|
by: =?iso-8859-1?q?KLEIN_St=E9phane?= |
last post by:
Le Mon, 25 Aug 2008 13:50:50 +0000, KLEIN Stéphane a écrit :
I've this bug only with lxml2, lxml 1.3.3 work very well.
Regards,
Stephane
|
by: ylj798 |
last post by:
my code
-------------------------------------------------------------------------------------------
# -*- coding: utf8 -*-
#!/usr/bin/python
import urllib
import urllib2
import re
import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |