Fix problem with decreasing size of StatusToolBar when tools are removed from toolbar.
StatusToolBar - toolbar with tool to build, clear, connect, ...
This problem appears only in python-wxgtk3.0. In python-wxgtk2.8 there
was not such problem.
If call StatusToolBar.SetMinSize(wx.DefaultSize), all is working, but
following warning message appears:
(Beremiz.py:15155): Gtk-WARNING **: 18:42:24.115: Negative content
width -6 (allocation 1, extents 4x3) while allocating gadget (node
toolbar, owner GtkToolbar)
To avoid that StatusToolBar.GetToolBitmapSize() is used instead of wx.DefaultSize
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of Beremiz.
# See COPYING file for copyrights details.
from __future__ import absolute_import
from plcopen.XSLTModelQuery import XSLTModelQuery
class InstancesPathCollector(XSLTModelQuery):
""" object for collecting instances path list"""
def __init__(self, controller):
self.Instances = []
XSLTModelQuery.__init__(self,
controller,
"instances_path.xslt",
[("AddInstance", self.AddInstance)])
def AddInstance(self, context, *args):
self.Instances.append(args[0][0])
def Collect(self, root, name, debug):
self._process_xslt(root, debug, instance_type=name)
res = self.Instances
self.Instances = []
return res