Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 20th, 2004, 04:42 AM
flixxer flixxer is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 44 flixxer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 10
Dialog application ...

I tried to make dialog based application using wxPython but it doesnt work, I managed to get the Dialog Box but I can put text box, button etc... here's the code... anythingh wrong?
Code:
from wxPython.wx import *

class testdialog(wxDialog):
    def _init_(self,parent,ID,title,pos,size):
        wxDialog._init__(self,parent,ID,title,pos,size)
        self.tHello = wxTextCtrl(panel, -1, '', (3,3), (185,22))
	self.bHello = wxTextCtrl(panel, -1, '', (3,30), (185,22))
	self.tHello.SetInsertionPoint(1)
        button = wxButton(panel, 10, 'Count', (3, 60))
        button_clear = wxButton(panel,11,'Clear',(112,60))

        
class okrun(wxApp):
    def OnInit(self):
        dlg = testdialog(NULL,-1,'My Dialog',(200,200),(300,120))
        dlg.ShowModal()       
        dlg.Destroy()
        return true

app = okrun()
app.MainLoop()
    


Reply With Quote
  #2  
Old February 20th, 2004, 05:31 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,537 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 17 m 47 sec
Reputation Power: 68
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
I havn't done much with wxPython so there could be other problems besides this on but as i see it _init_ and _init__ should both be __init__. Try changing that and give it a go .

Mark.
__________________
programming language development: www.netytan.com Hula


Reply With Quote
  #3  
Old February 20th, 2004, 11:23 AM
Grim Archon's Avatar
Grim Archon Grim Archon is offline
Mini me.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783 Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)  Folding Points: 1488 Folding Title: Novice Folder
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 12
Send a message via MSN to Grim Archon
In addition your references to panel should be self:
Code:
from wxPython.wx import *

class testdialog(wxDialog):
    def __init__(self,parent,ID,title,pos,size):
        from wxPython.lib.layoutf import Layoutf
        id = wxNewId()
        wxDialog.__init__(self,parent,id,title,pos,size)
        panel = self
        self.tHello = wxTextCtrl(panel, id,'', (3,3), (185,22))
	self.bHello = wxTextCtrl(panel, id, '', (3,30), (185,22))
	self.tHello.SetInsertionPoint(1)
        button = wxButton(panel, id, 'Count', (3, 60))
        button_clear = wxButton(panel,id,'Clear',(112,60))
        
class okrun(wxApp):
    def OnInit(self):
        return True

app = okrun(0)
dlg = testdialog(NULL,-1,'My Dialog',(200,200),(300,120))
dlg.ShowModal()       
dlg.Destroy()

Now you need to add the event logic

Grim
__________________
*** Experimental Python Markup CGI V2 ***

Reply With Quote
  #4  
Old February 21st, 2004, 12:36 PM
flixxer flixxer is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 44 flixxer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 10
Thanx Grim it works

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Dialog application ...

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap