从PropertyGrid的FloatProperty读取值

时间:2014-10-07 11:35:58

标签: python user-interface wxpython propertygrid

有人能帮帮我吗??? 我用属性网格创建了这个代码,我没有从float属性" window"中读取这个值。变量。在这种情况下,此值为100。谢谢。学家

class LevyPanelNastaveni(wx.Panel):
    def __init__(self, parent, id=-1):
        wx.Panel.__init__( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 500,300 ), style = wx.TAB_TRAVERSAL )

        bs = wx.BoxSizer(wx.VERTICAL)

        self.m_propertyGrid = pg.PropertyGrid(self, wx.ID_ANY, wx.DefaultPosition, wx.Size( 200,-1 ), wx.propgrid.PG_DEFAULT_STYLE)
        self.m_propertyGridItem = self.m_propertyGrid.Append(pg.PropertyCategory(u"Inlet value"))
        self.m_propertyGridItem1 = self.m_propertyGrid.Append(pg.FloatProperty("R1", value=100))
        bs.Add(self.m_propertyGrid, 0, wx.GROW+wx.ALL, 5)

        self.m_propertyGrid.

        self.SetSizerAndFit(bs)

        self.Layout()

1 个答案:

答案 0 :(得分:0)

在wxPython演示中,这样做:

pg.Append(wxpg.FloatProperty(“Float”,value = 100.0))

请注意,Value是Float而不是Int