im trying to make a simple dropdown gui,but i need some help on how to position the dropdown menu , the full code is :
import tkinter as tk
from tkinter import *
root=tk.Tk()
canvas1 = tk.Canvas(root, width = 400, height = 300)
canvas1.pack()
username = tk.Entry(root)
canvas1.create_window(200,140, window=username)
canvas1.create_text(100,140,fill="darkblue",text="username")
password = tk.Entry(root)
canvas1.create_window(200,180,window=password)
canvas1.create_text(100,180,fill="darkblue",text="password")
variable = StringVar(root)
variable.set("Facebook")
w=OptionMenu(root , variable, "Facebook","Twitter","Spotify","Swiggy")
w.pack()
button1= tk.Button(text='Go')
canvas1.create_window(250,250, window=button1)
root.mainloop()
the dropdown menu was obtained by using the OptionMenu but im unable to change its position, i need help with that code for just the OptionMenu:
from Tkinter import *
master = Tk()
variable = StringVar(master)
variable.set("one") # default value
w = OptionMenu(master, variable, "one", "two", "three")
w.pack()
mainloop()