I recently got back into Python, decided to give GUI a try. Yes, i know, there is better language to make GUI. However, I am familiar with Python I've used it, just never tried GUI.
I want to put two buttons next to each other using .grid() I know in .pack() can be done but I have programs organizing it so I used grid instead.
I'm using Tkinter and I have this:
mg]
the code:
I want to put two buttons next to each other using .grid() I know in .pack() can be done but I have programs organizing it so I used grid instead.
I'm using Tkinter and I have this:
mg]the code:
PHP Code
<?php
import Tkinter as tk
import tkFont
import ttk
def cbc(id, tex):
return lambda : callback(id, tex)
def callback(id, tex):
s = "wut \n"
tex.insert(tk.END, s)
tex.see(tk.END)
root = tk.Tk()
root.resizable(0,0)
dFont=tkFont.Font(family="Arial", size=10)
l1 = tk.Label(root, text="RTMPin:")
e1 = tk.Entry(root,width=50)
l1.grid(row=0, column=0, sticky="e")
e1.grid(row=0, column=1, sticky="news")
l2 = tk.Label(root, text="RTMPout:")
e2 = tk.Entry(root)
l2.grid(row=1, column=0, sticky="e")
e2.grid(row=1, column=1, sticky="news")
l3 = tk.Label(root, text="Log:")
e3 = tk.Text(master=root, width=50, height=5, font=dFont)
l3.grid(row=3, column=0, sticky="e")
e3.grid(row=3, column=1, sticky="news")
l4 = tk.Label(root)
e4 = tk.Button(root, text="start", command=cbc("1", e3))
e4b = tk.Button(root, text="stop")
l4.grid(row=2, column=0, sticky="e")
e4.grid(row=2, column=1, sticky="e")
e4b.grid(row=2, column=2, sticky="w")
l5 = tk.Label(root)
e5 = tk.Button(root, text='Exit', command=root.destroy)
l5.grid(row=4, column=0, sticky="e")
e5.grid(row=4, column=1, sticky="news")
root.columnconfigure(0, weight=0)
root.columnconfigure(1, weight=1)
root.mainloop()


![[Image: c5bcca49a3c4d3c6c7a27493507eba95.png]](https://i.gyazo.com/c5bcca49a3c4d3c6c7a27493507eba95.png)
