Fonky44
Fonky44

Reputation: 133

Secret tkinter widget?

I got this problem. when I write secretframe() I get a empty box any ideas to fix this? Also how can I put a little space between the 2 frames.
I'm new to tkinter and any tips is gladly appreciated.

import tkinter as tk
import time
import math
##----------Functions
root = tk.Tk()
def Pi():
    pi = math.pi
    x = list(str(pi))
    map(int,x)
    print(math.pi)
def Unfinished():
    print("This Button is not finished")

def secretframe(frame):
    secrett = tk.Toplevel()
    sframe = tk.Frame(secrett, height="300", width="300", bg="PeachPuff")
    sLabel = tk.Label(sframe, text="Secret")
    sframe.grid
    sLabel.grid


##Defining
##Frames
frame = tk.Frame(root, height="300", width="300", bg="Black")
Mframe = tk.Frame(root, height="300", width="300", bg="White")
##WIdgets
Label = tk.Label(frame, text="R1p windows", bg="Black", fg="White")
Label2 = tk.Label(Mframe, text="Math magic", bg="White", fg="Black")
Knapp = tk.Button(frame, text="ok(ADMIN)", fg="White", bg="Black", font="monospace")
PIKnapp = tk.Button(Mframe, text="Pi(WIP)(UNFINISHED)", bg="White", fg="Black", font="Times")


##Config and bindings
Knapp.config(command=Unfinished)
PIKnapp.config(command=Pi)

##Packing
##  Frame 1
Label.grid()
frame.grid()
Knapp.grid()
##  Frame 2
Label2.grid()
Mframe.grid()
PIKnapp.grid()

Upvotes: 0

Views: 96

Answers (1)

Minion Jim
Minion Jim

Reputation: 1279

You've forgotten the brackets. Try:

sframe.grid ()
sLabel.grid ()

Upvotes: 1

Related Questions