Forcing the position of scroll bars on a wxTextCtrl

Clans Of Intrigue clansofintrigue at gmail.com
Wed Nov 2 14:15:33 EST 2005


Thanks, that did the trick perfectly :)

also got rid of the self._log member so the class is now just:

class LogControl:
    """ Simple helper to redirect stdout to a panel in the GUI """
    def __init__( self, textCtrl ):
        self._ctrl = textCtrl
        self.write( "Application Started..." )

    def write( self, Message ):
        # Add message to log and force scroll bars to end of window
        self._ctrl.SetValue( self._ctrl.GetValue() + Message )
        self._ctrl.ShowPosition(self._ctrl.GetLastPosition())

Lovely :)




More information about the Python-list mailing list