thinterにて各ボタンをgrop化して各ボタンに固有のなまえの設定を
したいのですが
(widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: unknown option "-variable"
というerrorが発生します
program下記です
import tkinter as tk
from PIL import Image, ImageTk
from tkinter import messagebox
def run():
root = tk.Tk()
#main window size
root.geometry('1000x700')
#window title
root.title(’test’)
label1 = tk.Label(root, text='1.Part Number') label1.place(x=10, y=10) frame = tk.Frame(root) frame.pack() frame.place(x=10, y=30) bottomframe = tk.Frame(root) bottomframe.pack() bottomframe.place(x=10, y=55) **val =tk.IntVar() val.set(1)** frame13 = tk.Button(frame, text='13',**variable = val,value=0**) frame13.pack(side=tk.LEFT)
あなたの回答
tips
プレビュー