tests/wxHMI/HMI@wxglade_hmi/hmi.wxg
author |
Andrey Skvortsov <andrej.skvortzov@gmail.com> |
|
Tue, 26 Jun 2018 17:34:15 +0300 |
changeset 2229 |
3c94bac4526e |
parent 1691 |
9a42f12a973e
|
permissions |
-rw-r--r-- |
Fix 'DoGetTextExtent - invalid DC' error
most likely this error happens only on certain wx backends.
GTK3+ on GNU/Linux is apparently one of them.
The problem is described in wxWidgets issue tracker.
http://trac.wxwidgets.org/ticket/12486
[-------------------------------------------------------------------------------------------------------------------]
platform:
Linux-4.16.0-2-rt-amd64-x86_64-with-debian-buster-sid
python-version:
2.7.15
traceback:
File "/home/developer/WorkData/PLC/beremiz/beremiz/ProjectController.py", line 1605, in DispatchDebugValuesProc
self.CallWeakcallables("__tick__", "NewDataAvailable", debug_ticks)
File "/home/developer/WorkData/PLC/beremiz/beremiz/ProjectController.py", line 1585, in CallWeakcallables
function(*cargs)
File "/home/developer/WorkData/PLC/beremiz/beremiz/editors/Viewer.py", line 1217, in NewDataAvailable
refresh_rect.Union(element.GetRedrawRect())
File "/home/developer/WorkData/PLC/beremiz/beremiz/graphics/GraphicCommons.py", line 1609, in GetRedrawRect
self.ValueSize = self.Parent.GetMiniTextExtent(self.ComputedValue)
File "/home/developer/WorkData/PLC/beremiz/beremiz/editors/Viewer.py", line 932, in GetMiniTextExtent
return self.MiniTextDC.GetTextExtent(text)
File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk3/wx/_gdi.py", line 4127, in GetTextExtent
return _gdi_.DC_GetTextExtent(*args, **kwargs)
<class 'wx._core.PyAssertionError'>: C++ assertion "m_graphicContext" failed at ../src/common/dcgraph.cpp(1160) in DoGetTextExtent(): wxGCDC(cg)::DoGetTextExtent - invalid DC
wx-platform:
__WXGTK__
wx-version:
3.0.2.0
[-------------------------------------------------------------------------------------------------------------------]
traceback:
File "/home/developer/WorkData/PLC/beremiz/beremiz/controls/LogViewer.py", line 740, in OnMessageToolTipTimer
self.MessageToolTip.SetFont(self.Font)
File "/home/developer/WorkData/PLC/beremiz/beremiz/controls/CustomToolTip.py", line 75, in SetFont
self.RefreshTip()
File "/home/developer/WorkData/PLC/beremiz/beremiz/controls/CustomToolTip.py", line 158, in RefreshTip
self.SetClientSize(self.GetToolTipSize())
File "/home/developer/WorkData/PLC/beremiz/beremiz/controls/CustomToolTip.py", line 145, in GetToolTipSize
w, h = dc.GetTextExtent(line)
File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk3/wx/_gdi.py", line 4127, in GetTextExtent
return _gdi_.DC_GetTextExtent(*args, **kwargs)
<class 'wx._core.PyAssertionError'>: C++ assertion "m_graphicContext" failed at ../src/common/dcgraph.cpp(1160) in DoGetTextExtent(): wxGCDC(cg)::DoGetTextExtent - invalid DC
[-------------------------------------------------------------------------------------------------------------------]
<?xml version="1.0"?>
<!-- generated by wxGlade 0.7.2 on Tue Jun 6 12:26:48 2017 -->
<application class="" encoding="UTF-8" for_version="2.8" header_extension=".h" indent_amount="4" indent_symbol="space" is_template="0" language="python" name="" option="0" overwrite="0" path="..py.py" source_extension=".cpp" top_window="wxglade_hmi" use_gettext="1" use_new_namespace="1">
<object class="Class_wxglade_hmi" name="wxglade_hmi" base="EditFrame">
<style>wxDEFAULT_FRAME_STYLE|wxMAXIMIZE</style>
<title>frame_1</title>
<object class="wxFlexGridSizer" name="grid_sizer_1" base="EditFlexGridSizer">
<hgap>0</hgap>
<growable_rows>0</growable_rows>
<rows>1</rows>
<growable_cols>0</growable_cols>
<cols>4</cols>
<vgap>0</vgap>
<object class="sizeritem">
<flag>wxALIGN_CENTER</flag>
<border>0</border>
<option>1</option>
<object class="ThreeDee" name="window_1" base="CustomWidget">
<extracode># WHERE IS THAT ?\nprint "hello"\n</extracode>
<arguments>
<argument>$parent</argument>
<argument>$id</argument>
</arguments>
<size>400,400</size>
</object>
</object>
<object class="sizeritem">
<flag>wxEXPAND</flag>
<border>0</border>
<option>1</option>
<object class="wxFlexGridSizer" name="sizer_1" base="EditFlexGridSizer">
<hgap>0</hgap>
<growable_rows>0</growable_rows>
<rows>2</rows>
<cols>1</cols>
<vgap>0</vgap>
<object class="sizeritem">
<flag>wxEXPAND</flag>
<border>0</border>
<option>1</option>
<object class="wxBoxSizer" name="sizer_2" base="EditBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizerslot" />
<object class="sizerslot" />
<object class="sizerslot" />
<object class="sizerslot" />
</object>
</object>
<object class="sizeritem">
<flag>wxEXPAND</flag>
<border>0</border>
<option>1</option>
<object class="wxGridSizer" name="sizer_3" base="EditGridSizer">
<hgap>0</hgap>
<rows>6</rows>
<cols>2</cols>
<vgap>0</vgap>
<object class="sizerslot" />
<object class="sizerslot" />
<object class="sizerslot" />
<object class="sizerslot" />
<object class="sizerslot" />
<object class="sizerslot" />
<object class="sizerslot" />
<object class="sizerslot" />
<object class="sizerslot" />
<object class="sizerslot" />
</object>
</object>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="wxToggleButton" name="DrawTestBt" base="EditToggleButton">
<label>Please Draw!</label>
<events>
<handler event="EVT_TOGGLEBUTTON">SetPLCTestBtnGlobalVar</handler>
</events>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="wxToggleButton" name="DrawTestBt2" base="EditToggleButton">
<label>Please Draw copy!</label>
<events>
<handler event="EVT_TOGGLEBUTTON">SetPLCTestBtn2GlobalVar</handler>
</events>
</object>
</object>
</object>
</object>
</application>