[ wxwindows-Bugs-1592614 ] wxHtmlWindow misinterpretted as
wxScrolledWindow with XRC
SourceForge.net
noreply at sourceforge.net
Wed Nov 8 04:50:33 PST 2006
Bugs item #1592614, was opened at 2006-11-08 13:50
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1592614&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxPython specific
Group: Must fix
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Tomas Dvorak (tomas_dvorak)
Assigned to: Robin Dunn (robind)
Summary: wxHtmlWindow misinterpretted as wxScrolledWindow with XRC
Initial Comment:
The wxHtmlWindow is incorrectly passed as
wxScrolledWindow when loaded from .XRC file.
Minimal application revealing this bug is presented
(and also attached as a .zip file). Press the Change
Texts button , stdout shows the following error:
C:\projects\gofomo\utils\XRCed-0.1.7-5\bugtest>"c:\python24\python"
bugtest.py
Traceback (most recent call last):
File "bugtest.py", line 15, in on_button
xrc.XRCCTRL(self.dlg, 'ID_Html').SetPage("New Text")
AttributeError: 'ScrolledWindow' object has no
attribute 'SetPage'
----->8---- bugtest.xrc ----------------->8----
<?xml version="1.0" encoding="cp1250"?>
<resource>
<object class="wxDialog" name="ID_Dialog">
<title></title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxTextCtrl" name="ID_Text">
<value>Hello, world.</value>
</object>
<option>1</option>
<flag>wxEXPAND|wxGROW</flag>
</object>
<object class="sizeritem">
<object class="wxHtmlWindow" name="ID_Html">
<htmlcode>Hello,
<b>world</b>.</htmlcode>
</object>
<option>1</option>
<flag>wxEXPAND|wxGROW</flag>
</object>
<object class="sizeritem">
<object class="wxButton" name="ID_But">
<label>Change texts</label>
</object>
</object>
</object>
<size>300,300</size>
</object>
</resource>
----->8---- bugtest.py ----------------->8----
import wx
from wx import xrc
class TestApp(wx.App):
def OnInit(self):
xrc.XmlResource.Get().InitAllHandlers()
self.resources = xrc.XmlResource('bugtest.xrc', 0)
self.dlg = self.resources.LoadDialog(None, 'ID_Dialog')
self.dlg.Show()
self.dlg.Bind(wx.EVT_BUTTON, self.on_button, id =
xrc.XRCID('ID_But'))
return True
def on_button(self, evt = None):
xrc.XRCCTRL(self.dlg, 'ID_Text').SetValue("New Text")
xrc.XRCCTRL(self.dlg, 'ID_Html').SetPage("New Text")
print "but pressed"
if __name__ == "__main__":
app = TestApp(0)
app.MainLoop()
----------------->8--------------------
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1592614&group_id=9863
More information about the wx-dev
mailing list