post
poster: jsaxton
description: Broken Python GUI
language: Python
[download]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/python

# border.py

import wx

class MainFrame(wx.Frame):
    def __init__(self, parent, id, title):
        try:
        wx.Frame.__init__(self, parent, id, title, size=(800, 600))

        #Create Main Panel
        panel = wx.Panel(self, -1)
        #panel.SetBackgroundColour('#4f5049')
        panel.SetBackgroundColour('#00A03D')
        wx.Frame.SetMinSize(self, (800,600))
        vbox = wx.BoxSizer(wx.VERTICAL)

        dealerPanel = wx.Panel(panel, -1)
        dealerPanel.SetBackgroundColour('#ededed')
        AIPanel1 = wx.Panel(panel, -1)
        AIPanel1.SetBackgroundColour('#3d3d3d')
        AIPanel2 = wx.Panel(panel, -1)
        AIPanel2.SetBackgroundColour('#5d3d3d')
        AIPanel3 = wx.Panel(panel, -1)
        AIPanel3.SetBackgroundColour('#7d3d3d')
        playerPanel = wx.Panel(panel, -1)
        playerPanel.SetBackgroundColour('#9d3d3d')
        buttonPanel = wx.Panel(panel, -1)
        buttonPanel.SetBackgroundColour('#9d9d9d')

        vbox.Add(dealerPanel, 1, wx.EXPAND | wx.ALL)
        vbox.Add(AIPanel1, 1, wx.EXPAND | wx.ALL)
        vbox.Add(AIPanel2, 1, wx.EXPAND | wx.ALL)
        vbox.Add(AIPanel3, 1, wx.EXPAND | wx.ALL)
        vbox.Add(playerPanel, 1, wx.EXPAND | wx.ALL)
        vbox.Add(buttonPanel, 1, wx.EXPAND | wx.ALL)
        panel.SetSizer(vbox)
        
        #Create a window
        #window = DrawWindow(self)
        
        dummyPanel = wx.Panel(AIPanel2, -1)
        dummyPanel.SetBackgroundColour('#3d1000')
        dummyPanel2 = wx.Panel(AIPanel2, -1)
        dummyPanel2.SetBackgroundColour('#3dFF00')
        dummyPanel3 = wx.Panel(AIPanel2, -1)
        dummyPanel3.SetBackgroundColour('#9d10FF')
        
        #Create a sizer
        hbox = wx.BoxSizer(wx.HORIZONTAL)
        hbox.Add(dummyPanel, 1, wx.EXPAND | wx.ALL)
        hbox.Add(dummyPanel2, 1, wx.EXPAND | wx.ALL)
        hbox.Add(dummyPanel3, 1, wx.EXPAND | wx.ALL)
        AIPanel2.SetSizer(hbox)
        
        # Create Buttons
        buttonBox = wx.BoxSizer(wx.HORIZONTAL)
        button1 = wx.Button(self, id=-1, label="Button1")
        ret = buttonBox.Add(button1, 1, wx.EXPAND | wx.ALL)
        print ret
        ret = buttonPanel.SetSizer(buttonBox)
        print ret

        self.Centre()
        self.Show(True)
    except:
        print "Error"
        
        

app = wx.App()
MainFrame(None, -1, 'Blackjack')
app.MainLoop()