Advertisement
Guest User

Untitled

a guest
Oct 21st, 2018
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. from tkinter import *
  2. from tkinter import ttk
  3. import tkinter as tk
  4. from tkinter.messagebox import showinfo
  5.  
  6. class Game:
  7. def __init__(self, name, rating, price, publisher, sale):
  8. self.name = name
  9. self.rating = rating
  10. self.price = price
  11. self.publisher = publisher
  12. self.sale = sale #will be used a mutliplier e.g. 0.6 x price, 1 x price (default)
  13. gameList.append(Game)
  14.  
  15. class User:
  16. def __init__(self, username, password, balance, library):
  17. self.username = username
  18. self.password = password
  19. self.balance = balance
  20. self.library = library #this will be an array which will be added via, gta.name etc
  21. userList.append(User)
  22.  
  23. #interface code it's pretty aesthetic i know
  24. root = Tk()
  25. root.title('Steam Backup Launcher')
  26. root.resizable(0,0)
  27. root.geometry('{}x{}'.format(700, 400))
  28. root.configure(background="black")
  29. mainFrame = Frame(root)
  30. BotFrame = Frame(root)
  31.  
  32.  
  33. gameNames = []
  34. gameList = []
  35. userList = []
  36.  
  37. GTA4 = Game("grand theft auto 4", "3/5", 45, "rockstar", 1) #name, stock, price, publisher
  38. destiny = Game("destiny", "4/5", 45, "bungie", 1) #name, stock, price, publisher
  39. jamie = User("joji", "2low4ahoe", 244, [GTA4.name, destiny.name])#game library working!
  40.  
  41.  
  42. print(GTA4.name + GTA4.rating)
  43. print(jamie.username + " " + str(jamie.library))
  44.  
  45. #title
  46. labelCom = Label(mainFrame, text="steam", font=("arial", 34), background="#999", width=10).grid(row=0, column=1, sticky=N, padx=6, pady=6)
  47.  
  48. #sell pop up box i want to make a list of avaliable game where they can be displayed
  49. sellButton = Button(mainFrame, text="Sell")#, command=sales_func)
  50. sellButton.grid(row=1, column=0, ipadx=10, ipady=5)
  51. sellButton.bind("<Button-1>") #sell_comic) #this will activate pop up
  52.  
  53. #sales pop up box i want to make a list of games of sale
  54. salesButton = Button(BotFrame, text="Sales!") # command=sales_func)
  55. salesButton.grid(row=2, column=0, ipadx=10, ipady=5)
  56. salesButton.bind("<Button-2>") # sales_func)#important part look through make sales function
  57.  
  58. ''' #concept idea first might remove later
  59. #notification box
  60. LabelNotification = Label(mainFrame, text="notifications", font=("arial", 16), background="#999", width=10).grid(row=1, column=2, sticky=N, padx=3, pady=3)
  61.  
  62. #notification content update with notify_1-4
  63. spaceNotString = StringVar()
  64. spaceNotString.set("")
  65. LabelNotContent = Label(mainFrame, textvariable=spaceNotString, width=20, font=("arial",10))
  66. LabelNotContent.grid(row=2, column=2, sticky=N)
  67. '''
  68.  
  69. #display board content
  70. displayBoardString = StringVar()
  71. displayBoardString.set("")
  72. LabeldisplayBoardContent = Label(mainFrame, textvariable=displayBoardString, width=25, height=5, font=("arial",12))
  73. LabeldisplayBoardContent.grid(row=2, column=1, sticky=N, rowspan=2,padx=6)
  74.  
  75. #balance display
  76. LabelbalanceTitle = Label(BotFrame, text="balance", font=("arial", 9), background="#999", width=15).grid(row=3, column=0, sticky=N, padx=20, pady=3)
  77.  
  78. #main frame
  79. mainFrame.pack(side=TOP, fill=BOTH, expand=TRUE)
  80. BotFrame.pack(side=BOTTOM, fill=BOTH, expand=TRUE)
  81. #root.bind("<space>", clear)
  82.  
  83. #displaymoney()
  84. root.mainloop()
  85. #all prints are for testing purposes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement