Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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 May 25th, 2004, 11:51 PM
xlordt's Avatar
xlordt xlordt is offline
Only the strong survives!!.
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Feb 2003
Location: A World of wonders.
Posts: 5,547 xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Month 1 h 43 m 50 sec
Reputation Power: 378
Send a message via ICQ to xlordt Send a message via AIM to xlordt Send a message via MSN to xlordt Send a message via Yahoo to xlordt Send a message via Google Talk to xlordt Send a message via Skype to xlordt
Facebook MySpace
while loops problem

arg i been at this for a while now.... tring to figure out why is it that when i add a loop in my program the program wont load? or even when i add a for loop i get nothing back ( while loop is in OnInit ( ) )

Code:
class HtmlWindows ( wxHtmlWindow ):

    def __init__ ( self, Parant, ID, frame ):
        wxHtmlWindow.__init__ ( self, Parant, ID )

        self.SetBackgroundColour ( 'Black' )  
    
    def Data ( self, Data ):
    
        self.AppendToPage ( Data )
    

class MyPanel ( wxPanel ):

    def __init__ ( self, Parant, ID, frame ):
        wxPanel.__init__ ( self, Parant, ID )

        self.frame  = frame

        self.html   = HtmlWindows ( self, -1, self.frame )
                    
        
        sizer   = wxBoxSizer ( wxVERTICAL )
        sizer.Add ( self.html, 1, wxGROW )

        subsizer     = wxBoxSizer ( wxHORIZONTAL )
        staticText   = wxStaticText ( self, -1, "Testing" )
        textCtrl     = wxTextCtrl ( self, -1, " " )
        
        subsizer.Add ( staticText, 0, wxGROW | wxALL, 1 )
        subsizer.Add ( textCtrl,   1, wxGROW | wxALL, 1 )
        
        sizer.Add ( subsizer, 0, wxGROW )
        
        self.SetSizer ( sizer )
        self.SetAutoLayout ( True )

        

class MyFrame ( wxFrame ):

    def __init__ ( self, Parant, ID, Title ):
        wxFrame.__init__ ( self, Parant, ID, Title,
                               style=wxCAPTION|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxTHICK_FRAME,
                               size = ( 650, 400 ))

        self.Panel  = MyPanel ( self, -1, self )

        self.CentreOnScreen ( wxBOTH )
        
        #wxInitAllImageHandlers() 
        #img = wxImage ( 'folder.gif' )
        #img.LoadFile ( 'folder.gif', wxBITMAP_TYPE_GIF )
        
        self.CreateStatusBar ( 2 )
        self.SetStatusWidths ( [ -1, 150 ] )
        self.SetStatusText ( ctime( time( ) ), 1 )

        Menu     = wxMenu ( )
        Menu.Append ( ID_EXIT, '&Exit', 'Exit The Program' )

        MenuBar  = wxMenuBar ( )
        MenuBar.Append ( Menu, '&File' )
        
        self.SetMenuBar ( MenuBar )

        EVT_MENU ( self, ID_EXIT, self.ExitProgram )

    def ExitProgram ( self, event ):
        self.Close ( True )
        

     

class MyApp ( wxApp ):

    def OnInit ( self ):

        Frame = MyFrame ( NULL, -1, '*:: xlordt ::*' )

        while 1:
            Frame.Panel.html.Data ( 'hmm' )
        Frame.Show ( True )
        self.SetTopWindow ( Frame )

        return True


Win = MyApp ( 0 )
Win.MainLoop ( )

Last edited by xlordt : May 25th, 2004 at 11:53 PM.

Reply With Quote
  #2  
Old May 26th, 2004, 05:03 AM
softking softking is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 6 softking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
while 1:
Frame.Panel.html.Data ( 'hmm' )

if this is a while True loop, how do you expect it to break;
and if it is not going to break; how do you expect the program to get out of the OnInit method. i think there should be some terminating condition for the while loop

bye
Vikram

Reply With Quote
  #3  
Old May 26th, 2004, 03:32 PM
xlordt's Avatar
xlordt xlordt is offline
Only the strong survives!!.
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Feb 2003
Location: A World of wonders.
Posts: 5,547 xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109876 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Month 1 h 43 m 50 sec
Reputation Power: 378
Send a message via ICQ to xlordt Send a message via AIM to xlordt Send a message via MSN to xlordt Send a message via Yahoo to xlordt Send a message via Google Talk to xlordt Send a message via Skype to xlordt
Facebook MySpace
Quote:
Originally Posted by softking
while 1:
Frame.Panel.html.Data ( 'hmm' )

if this is a while True loop, how do you expect it to break;
and if it is not going to break; how do you expect the program to get out of the OnInit method. i think there should be some terminating condition for the while loop

bye
Vikram


No it has nothing to do with the loop beaking.. the problem was that wxPython does not work this way..i realized that i hade 2 choices either use wxYield ( ) or make it threaded.. so far i get the program to loop now.. but it loops to fast..as i am testing it to connect to an irc server.. so ya now i have another prog

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > while loops problem


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT