Hi,
I've found someting strange with wxPython 2.5.2.8 under GNU/Linux:
I'm using a frame for my primary window, I've created a TextCtrl (in a boxSizer), and I disable the textCtrl by default. No problem here.
But when a I disable the main frame, and re enable it, the textCtrl theme is reseted, but is kept uneditable (cool).
This is the sample code I've created that illustrate the thing (note that the "bug" does not appear on win32):
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
import wx
class TextCtrlBug(wx.Frame):
def __init__(self,parent,title):
wx.Frame.__init__(self,parent,-1, title, size=(-1,-1),style=wx.DEFAULT_FRAME_STYLE)
self.GetBestSize()
panel = wx.Panel(self)
sizer = wx.BoxSizer(wx.VERTICAL)
textCtrl = wx.TextCtrl( panel, -1, "Disabled, but Theme like Enabled",size=(250,-1))
textCtrl.Disable()
sizer.Add(textCtrl,0,wx.ALL,10)
btn = wx.Button(panel,-1,"Disable Frame, then Enable Frame")
btn.Bind(wx.EVT_BUTTON,self.DisableFrame)
sizer.Add(btn,0,wx.ALL,10)
panel.SetSizer(sizer)
self.Show(True)
def DisableFrame(self,e):
self.Disable()
self.Enable()
e.Skip()
if __name__ == '__main__':
app = wx.PySimpleApp()
TextCtrlBug(None,"Test Frame")
app.MainLoop()
Thanks,
···
--
Laurent Coustet
perso: http://ed.zehome.com/ http://www.debian-fr.org/