foo
This commit is contained in:
parent
8936fce2f3
commit
c1faae9272
1 changed files with 22 additions and 3 deletions
25
smstool.py
25
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()
|
||||
|
||||
|
|
Reference in a new issue