From c1faae9272d85d1dc5ff945bd9038de7327898ca Mon Sep 17 00:00:00 2001 From: neingeist Date: Thu, 11 Nov 2004 03:14:56 +0000 Subject: [PATCH] foo --- smstool.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/smstool.py b/smstool.py index 1251980..3d52570 100644 --- a/smstool.py +++ b/smstool.py @@ -1,4 +1,7 @@ from wxPython.wx import * +from os import system + +SMSLEN = 160 class SmsToolFrame(wxFrame): def __init__(self, parent, id, title): @@ -12,7 +15,8 @@ class SmsToolFrame(wxFrame): wxDLG_PNT(panel, wxPoint(4, 4)), wxDefaultSize) wxStaticText(panel, -1, "Nummer:", wxDLG_PNT(panel, wxPoint(4, 20)), wxDefaultSize) - self.textCtrl = wxTextCtrl(panel, -1, "", + + self.textCtrl = wxTextCtrl(panel, 20, "", wxDLG_PNT(panel, wxPoint(30, 4)), wxDLG_SZE(panel, wxSize(160, -1))) @@ -25,11 +29,27 @@ class SmsToolFrame(wxFrame): wxDLG_SZE(panel, wxSize(30, -1))) EVT_BUTTON(self, 10, self.OnFooClick) + self.zaehler = wxStaticText(panel, -1, str(SMSLEN), + wxDLG_PNT(panel, wxPoint(110, 20)), wxDefaultSize) + + EVT_TEXT(self, 20, self.OnChange) + def OnCloseWindow(self, event): self.Destroy() def OnFooClick(self, event): - self.Destroy() + text = self.textCtrl.GetValue() + nr = self.nrCtrl.GetValue() + + foo = system("echo '" + text + "' | cat") + + self.foodialog = wxMessageDialog(self.panel, + text + str(foo) + nr, + "foo", wxOK, wxPoint(100, 100)) + self.foodialog.Show(true) + + def OnChange(self, event): + self.zaehler.SetLabel(str(SMSLEN-len(self.textCtrl.GetValue()))) class SmsTool(wxApp): def OnInit(self): @@ -40,4 +60,3 @@ class SmsTool(wxApp): smstool=SmsTool(0) smstool.MainLoop() -