SetStatusText of MDIParentFrame from MDIChildFrame

2011-11-21 Thread Illy

Dear my friends

I am stucked on a problem: I can't call a function of MDIParentFrame 
from MDIChildFrame: myturnonmenu and mystatusbar.SetStatusText()


Anybody would be so nice for telling me my mistakes? Please do me a favor.

Thank you very much in advance.

I created 3 files contain this sourcecode:
ceo@mefi:~/sementara/tes$ ls
jendelapos.py  jendelapos.pyc  myMDIChildFrameforLogin.py  
myMDIChildFrameforLogin.pyc  myMDIFrame.py

ceo@mefi:~/sementara/tes$
===
ceo@mefi:~/sementara/tes$ cat myMDIFrame.py
#!/usr/bin/env python
import wx
import os

import jendelapos
import myMDIChildFrameforLogin

class myMDIParentFrame (wx.MDIParentFrame):
def __init__(self):
global mystatusbar, menuakuntan

wx.MDIParentFrame.__init__(self, None, -1, "This is 
myMDIParentFrame", size=(1020,800))

mystatusbar = self.CreateStatusBar()
mystatusbar.SetStatusText("This is the StatusBar I want to put 
my message for the users in it")

menuakuntan = wx.Menu()
menuakuntan.Append(1000,  "Accounting - POS (&Point of Sale)")

menuaplikasi = wx.Menu()
menuaplikasi.Append(2,  "&Login")
menuaplikasi.Append(20001,  "E&xit")

menubar = wx.MenuBar()
menubar.Append(menuakuntan,  "&Accounting")
menubar.Append(menuaplikasi,  "A&pplication")
myturnoffmenu(self)

self.SetMenuBar(menubar)

self.Bind (wx.EVT_MENU,  self.jendelapos,  id=1000)

self.Bind (wx.EVT_MENU,  self.myMDIChildFrameforLogin,  id=2)
self.Bind (wx.EVT_MENU,  self.OnExit,  id=20001)

def OnExit(self,  evt):
self.Close(True)

jendelapos =  jendelapos.Show

myMDIChildFrameforLogin = myMDIChildFrameforLogin.Show

def myturnoffmenu(self):
menuakuntan.Enable(1000, False)

def myturnonmenu(self):
menuakuntan.Enable(1000, True)

if __name__ == '__main__':
app = wx.PySimpleApp()
myMDIFrame = myMDIParentFrame()
myMDIFrame.Show()
app.MainLoop()
ceo@mefi:~/sementara/tes$
=
ceo@mefi:~/sementara/tes$ cat ./myMDIChildFrameforLogin.py
import wx

def Show(self, evt):
global pengguna, katakunci, jendela
jendela = wx.MDIChildFrame(self, -1, "Login Form",  style= 
wx.DEFAULT_FRAME_STYLE | wx.HSCROLL | wx.VSCROLL)


mystatusbar.SetStatusText("Login succeeded")
myturnonmenu()

jendela.Show(True)
ceo@mefi:~/sementara/tes$
=
ceo@mefi:~/sementara/tes$ cat jendelapos.py
import wx

def Show (self, evt):
win = wx.MDIChildFrame(self, -1,  "Accounting - POS")
win.Show(True)
ceo@mefi:~/sementara/tes$
=

--
http://mail.python.org/mailman/listinfo/python-list


myComboBox.SetValue() does not work in windows.

2011-11-26 Thread Illy

Dear friends

Anybody know how can I change the text of a ComboBox? Because
"
myComboBox.SetValue("my text")
"
does not work on Windows.

Anybody would be so nice for telling me complete reference/documentation 
about wxPython on windows? Because the wxPython between on Linux and on 
Windows are sometimes different.


Thank you very much in advance.

--
Let us cut your costs for your business: http://www.otekno.biz
Skype: otekno.biz
Yahoo-ID: [email protected]
OpenTEKID: [email protected]
Mobile: 087 888 04 26 77
Office: +62-21-4587 90 75, 4587 68 08
Fax: +62-21-4587 64 65
BlackBerry Messanger: 274DF07F

--
http://mail.python.org/mailman/listinfo/python-list