Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
RHCSA, RHCE, AWS, Docker, Kubernetes Training
Sanjeewani95
Updated:
Tuesday at 10:28 AM
🛡️ Kaspersky Antivirus – 1 Year / 1 Device | Rs. 2,300 | Only 9 Left
KSPathirana
Updated:
Monday at 2:42 PM
Ad icon
Professional CCTV Installation Service
Techguy231
Updated:
Sunday at 10:50 AM
Ad icon
I'll research & write an article - Rs. 2000 onwards
Blogerwiki
Updated:
Sep 3, 2026
House Plan
lenura
Updated:
Sep 2, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
Python (tkinter/GUI) වැඩ්ඩො
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="tom2pd" data-source="post: 27188179" data-attributes="member: 66820"><p>මචං මේකයි කතන්දරේ</p><p>Module දෙකක් තියෙනවා එකක GUI class 1 තියෙනවා</p><p>අනිත් module එකේ තියෙන variable එක update වුනොත් GUI ක්ලාස් එකෙ තියෙන list box එකට add වෙන්න ඕන</p><p></p><p>දන්න කෙනෙක් sup එකක් දෙන්න </p><p></p><p></p><p><strong>GUI.py</strong></p><p>[CODE=python]from tkinter import *</p><p>import time</p><p></p><p># def main():</p><p># root = Tk()</p><p># window1 = Window(root)</p><p># # window1.insLi('00')</p><p></p><p>class Window:</p><p></p><p></p><p> def __init__(self,root,li) -> None:</p><p> self.li = li</p><p> self.root = root</p><p></p><p> def main(self):</p><p> # Creating the root window</p><p></p><p> self.root.geometry("609x96+951+216")</p><p> self.root.minsize(120, 1)</p><p> self.root.maxsize(2052, 1133)</p><p> self.root.resizable(1, 1)</p><p> self.root.title("Signal")</p><p> self.root.configure(background="#d9d9d9")</p><p> self.root.configure(highlightbackground="#d9d9d9")</p><p> self.root.configure(highlightcolor="black")</p><p></p><p> # Creating a Listbox and</p><p> # attaching it to root window</p><p> listbox = Listbox(self.root)</p><p> self.lb = listbox</p><p> # Adding Listbox to the left</p><p> # side of root window</p><p> listbox.pack(side=LEFT, fill=BOTH)</p><p></p><p> # Creating a Scrollbar and</p><p> # attaching it to root window</p><p> scrollbar = Scrollbar(self.root)</p><p></p><p> # Adding Scrollbar to the right</p><p> # side of root window</p><p> scrollbar.pack(side=RIGHT, fill=BOTH)</p><p></p><p> # Insert elements into the listbox</p><p> # for values in range(100):</p><p></p><p> listbox.config(yscrollcommand=scrollbar.set)</p><p> listbox.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0)</p><p> listbox.configure(background="#000000")</p><p> listbox.configure(disabledforeground="#6d6d6d")</p><p> listbox.configure(font="-family {Segoe UI Semibold} -size 18 -weight bold")</p><p> listbox.configure(foreground="#04ff24")</p><p> listbox.configure(highlightbackground="#d9d9d9")</p><p> listbox.configure(highlightcolor="black")</p><p> listbox.configure(selectbackground="blue")</p><p> listbox.configure(selectforeground="white")</p><p></p><p></p><p> # listbox.selection_set(END)</p><p> # listbox.see(END)</p><p></p><p> scrollbar.config(command=listbox.yview)</p><p> </p><p> # self.root.after(1000,insLi)</p><p> self.root.mainloop()</p><p> </p><p></p><p></p><p> def insLi(self):</p><p></p><p> # while True:</p><p> if self.li != '':</p><p> self.lb.selection_clear(0,END)</p><p> self.lb.insert(END, self.li)</p><p> self.lb.selection_set(END)</p><p> self.lb.see(END)</p><p> time.sleep(1)</p><p> [/CODE]</p><p></p><p><strong>updater.py</strong></p><p>[CODE=python]from tkinter import *</p><p>import GUI as sf</p><p></p><p></p><p>def popupmsg():</p><p> root = Tk()</p><p> window1 = sf.Window(root,'')</p><p> t=th.Thread(target=window1.main)</p><p> t.start()</p><p></p><p>popupmsg()</p><p>sf.window1.li='update me'</p><p></p><p></p><p></p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="tom2pd, post: 27188179, member: 66820"] මචං මේකයි කතන්දරේ Module දෙකක් තියෙනවා එකක GUI class 1 තියෙනවා අනිත් module එකේ තියෙන variable එක update වුනොත් GUI ක්ලාස් එකෙ තියෙන list box එකට add වෙන්න ඕන දන්න කෙනෙක් sup එකක් දෙන්න [B]GUI.py[/B] [CODE=python]from tkinter import * import time # def main(): # root = Tk() # window1 = Window(root) # # window1.insLi('00') class Window: def __init__(self,root,li) -> None: self.li = li self.root = root def main(self): # Creating the root window self.root.geometry("609x96+951+216") self.root.minsize(120, 1) self.root.maxsize(2052, 1133) self.root.resizable(1, 1) self.root.title("Signal") self.root.configure(background="#d9d9d9") self.root.configure(highlightbackground="#d9d9d9") self.root.configure(highlightcolor="black") # Creating a Listbox and # attaching it to root window listbox = Listbox(self.root) self.lb = listbox # Adding Listbox to the left # side of root window listbox.pack(side=LEFT, fill=BOTH) # Creating a Scrollbar and # attaching it to root window scrollbar = Scrollbar(self.root) # Adding Scrollbar to the right # side of root window scrollbar.pack(side=RIGHT, fill=BOTH) # Insert elements into the listbox # for values in range(100): listbox.config(yscrollcommand=scrollbar.set) listbox.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0) listbox.configure(background="#000000") listbox.configure(disabledforeground="#6d6d6d") listbox.configure(font="-family {Segoe UI Semibold} -size 18 -weight bold") listbox.configure(foreground="#04ff24") listbox.configure(highlightbackground="#d9d9d9") listbox.configure(highlightcolor="black") listbox.configure(selectbackground="blue") listbox.configure(selectforeground="white") # listbox.selection_set(END) # listbox.see(END) scrollbar.config(command=listbox.yview) # self.root.after(1000,insLi) self.root.mainloop() def insLi(self): # while True: if self.li != '': self.lb.selection_clear(0,END) self.lb.insert(END, self.li) self.lb.selection_set(END) self.lb.see(END) time.sleep(1) [/CODE] [B]updater.py[/B] [CODE=python]from tkinter import * import GUI as sf def popupmsg(): root = Tk() window1 = sf.Window(root,'') t=th.Thread(target=window1.main) t.start() popupmsg() sf.window1.li='update me' [/CODE] [/QUOTE]
Insert quotes…
Verification
Dahaya deken beduwama keeyada?
Post reply
Top
Bottom