Ejemplo n.º 1
0
    def __init__(self, parent, title):

        wx.Frame.__init__(self, parent, wx.ID_ANY, title, size=(400, 300))
        panel = wx.Panel(self)

        # Build a bitmap button and a normal one
        bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_OTHER, (16, 16))
        btn1 = buttons.ThemedGenBitmapButton(panel, -1, bmp, pos=(50, 50))

        btn2 = buttons.GenButton(panel, -1, "Hello World!", pos=(50, 100))
Ejemplo n.º 2
0
    def test_lib_buttons2(self):
        
        btn = buttons.ThemedGenButton(self.frame, label='label')
        btn = buttons.ThemedGenButton(self.frame, -1, 'label', (10,10), (100,-1), wx.BU_LEFT)
        
        bmp = wx.Bitmap(pngFile)
        btn = buttons.ThemedGenBitmapButton(self.frame, bitmap=bmp)
        btn = buttons.ThemedGenBitmapTextButton(self.frame, label='label', bitmap=bmp)
        
        btn.SetBitmapFocus(bmp)
        btn.SetBitmapDisabled(bmp)
        btn.SetBitmapSelected(bmp)

        btn = buttons.ThemedGenBitmapToggleButton(self.frame, bitmap=bmp)
        btn.SetToggle(True)

        self.assertTrue(btn.GetValue())
        self.assertEqual(btn.GetBitmapLabel(), bmp)