|
1 | 1 | from tkinter import *
|
2 | 2 | import pymongo
|
3 |
| -import time |
| 3 | + |
4 | 4 | myclient = pymongo.MongoClient(
|
5 | 5 | "mongodb+srv://CodingBlood:[email protected]/myFirstDatabase?retryWrites=true&w=majority")
|
6 | 6 | mydb = myclient["Chatbox"]
|
@@ -29,7 +29,7 @@ def PuGrp():
|
29 | 29 | sl3.destroy()
|
30 | 30 | sl4.destroy()
|
31 | 31 | def PuGrpChat(Grpname):
|
32 |
| - import PublicChatGUI |
| 32 | + from ChatBoxGUI import PublicChatGUI |
33 | 33 | PublicChatGUI.main(Grpname, name)
|
34 | 34 | #===========================================================================================================================
|
35 | 35 | #===========================================================================================================================
|
@@ -66,8 +66,49 @@ def PuGrpChat(Grpname):
|
66 | 66 |
|
67 | 67 |
|
68 | 68 | def PrGrp():
|
69 |
| - import GlobalChatGUI |
70 |
| - GlobalChatGUI.main(str(name)) |
| 69 | + sb1.destroy() |
| 70 | + sl1.destroy() |
| 71 | + sl2.destroy() |
| 72 | + sl3.destroy() |
| 73 | + sl4.destroy() |
| 74 | + |
| 75 | + def PrGrpChat(Grpname): |
| 76 | + from ChatBoxGUI import PrivateChatGUI |
| 77 | + PrivateChatGUI.main(Grpname, name) |
| 78 | + |
| 79 | + # =========================================================================================================================== |
| 80 | + # =========================================================================================================================== |
| 81 | + # =========================================================================================================================== |
| 82 | + # ================NOT WORKING================================================================================================ |
| 83 | + # def JoinGrp(): |
| 84 | + # |
| 85 | + join = Button(root1, text='+', bg=color["nero"], fg=color["orange"], |
| 86 | + font=('Malgun Gothic Semilight', 15), width=2, bd=5, height=1, command=PrGrpChat) |
| 87 | + canvas1.create_window(65, 190, anchor="nw", window=join) |
| 88 | + # =========================================================================================================================== |
| 89 | + # =========================================================================================================================== |
| 90 | + # =========================================================================================================================== |
| 91 | + # =========================================================================================================================== |
| 92 | + pug_details = mydb["PrivateChatGroups"] |
| 93 | + b = 245 |
| 94 | + turn = 0 |
| 95 | + for iterate in pug_details.find(): |
| 96 | + for member in iterate["Members"]['username']: |
| 97 | + if member['username'] == name: |
| 98 | + Gname = iterate["GName"] |
| 99 | + pgrp = Button(root1, text=iterate["GName"], bg=color["nero"], fg=color["orange"], |
| 100 | + font=('Malgun Gothic Semilight', 25, "bold"), width=500, height=100, bd=5, |
| 101 | + image=login, |
| 102 | + compound=LEFT, |
| 103 | + anchor="nw", command=lambda Grpname=Gname: PrGrpChat(Grpname)) |
| 104 | + if turn >= 3: |
| 105 | + m = 700 |
| 106 | + else: |
| 107 | + m = 100 |
| 108 | + canvas1.create_window(m, b, anchor="nw", window=pgrp) |
| 109 | + b += 120 |
| 110 | + turn += 1 |
| 111 | + |
71 | 112 | def NPuGrp():
|
72 | 113 | import GlobalChatGUI
|
73 | 114 | GlobalChatGUI.main(str(name))
|
@@ -139,13 +180,10 @@ def switch():
|
139 | 180 | global btnState
|
140 | 181 | btnState = False
|
141 | 182 | # loading Navbar icon image:
|
142 |
| - navIcon = PhotoImage(file="ham.png") |
143 |
| - closeIcon = PhotoImage(file="goback.png") |
144 |
| - login = PhotoImage(file=r"login.png", height=100, width=100) |
145 |
| - signup = PhotoImage(file=r"signup.png", height=100, width=105) |
146 |
| - find = PhotoImage(file=r"find.png", height=100, width=105) |
147 |
| - delete = PhotoImage(file=r"delete.png", height=100, width=100) |
148 |
| - photo1 = PhotoImage(file=r"heytest.png") |
| 183 | + navIcon = PhotoImage(file=r"./ChatBoxGUI/ham.png") |
| 184 | + closeIcon = PhotoImage(file=r"./ChatBoxGUI/goback.png") |
| 185 | + login = PhotoImage(file=r"./ChatBoxGUI/login.png", height=100, width=100) |
| 186 | + photo1 = PhotoImage(file=r"./ChatBoxGUI/heytest.png") |
149 | 187 | canvas1 = Canvas(root1, width=400, height=400)
|
150 | 188 | canvas1.pack(fill="both", expand=True)
|
151 | 189 | canvas1.create_image(0, 0, image=photo1, anchor="nw")
|
|
0 commit comments