鱼C论坛

 找回密码
 立即注册
查看: 455|回复: 7

[已解决]求助

[复制链接]
发表于 2024-2-9 17:42:52 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
from tkinter import *
from math import *
from time import *

food = ['LV4 苹果(48)', 'LV4 苹果(48)', 'LV4 苹果(48)']
power = ['LV3 三jio尺', 'LV3 三jio尺', 'LV3 三jio尺', 'LV3 三jio尺', 'LV3 三jio尺']
full = 500
money = 666

root = Tk()
root.title('六六湖秘密探险 V2.0 Feb.6th 2024 -- 六六游戏城V8888.66.5.1.0.456.17.0a7')

w = Canvas(root, width=550, height=350)
w.pack()

v = IntVar()
v.set(1)

now = '家'

road = {'家':{'鱼C公园':[1, 2, 30], '食物超市1~6':[2, 4, 90]}, \
        '鱼C公园':{'家':[1, 2, 30], '食物超市1~6':[2, 3, 48], '武器超市1~6':[1, 3, 36]}, \
        '食物超市1~6':{'家':[2, 4, 90], '鱼C公园':[2, 3, 48], 'LV1打工仔公司':[3, 4, 100]}, \
        '武器超市1~6':{'鱼C公园':[1, 3, 36], 'LV1打工仔公司':[6, 6, 54]}, \
        'LV1打工仔公司':{'食物超市1~6':[3, 4, 100], '武器超市1~6':[6, 6, 54]}}

def callback():
    print('啊!我被调用了')

def go2(button):
    if button == now:
        label3 = Label(w, text='你就在这儿')
        label3_window = Canvas.create_window(w, 540, 200, window=label3)
    else:
        w.delete(ALL)
        sleep(0.5)
        label4 = Label(w, text='Loading... 口口20%')
        label4_window = Canvas.create_window(w, 275, 340, anchor=W, window=label4)
        w.delete(ALL)
        sleep(0.5)
        label5 = Label(w, text='Loading... 口口口口40%')
        label5_window = Canvas.create_window(w, 275, 340, anchor=W, window=label4)
        w.delete(ALL)
        sleep(0.5)
        label6 = Label(w, text='【777警报】怪兽来袭!')
        label6_window = Canvas.create_window(w, 275, 340, window=label4)
        lpower = len(power)
        for i in range(lpower):
            Radiobutton(v, text=power[i], variable=v, value=i+1, indicatoron=False).pack(anchor=W)

position = {'A':((5, 5), (65, 65), 30, 'red', '家'), \
            'B':((70, 70), (130, 130), 30, 'orange', '鱼C公\n园'), \
            'C':((170, 70), (230, 130), 30, 'yellow', '食物超\n市1~6'), \
            'D':((70, 170), (130, 230), 30, 'green', '武器超\n市1~6'), \
            'E':((170, 270), (230, 330), 30, 'blue', 'LV1打\n工仔公\n司')}

def connect(x):
    a = position[x[0]]
    b = position[x[1]]
    a_center = ((a[0][0] + a[2]), (a[0][1] + a[2]))
    b_center = ((b[0][0] + b[2]), (b[0][1] + b[2]))
    if a_center[0] < b_center[0] and a_center[1] < b_center[1]:
        #右下I
        temp = (a_center[0], b_center[1])
        s1 = b_center[0] - temp[0]
        s2 = temp[1] - a_center[1]
        diff1 = 30 * sin(atan(s1/s2))
        diff2 = 30 * sin(atan(s2/s1))
        return a_center[0] + diff1, a_center[1] + diff2, b_center[0] - diff1, b_center[1] - diff2
    elif a_center[0] > b_center[0] and a_center[1] < b_center[1]:
        #左下II
        temp = (a_center[0], b_center[1])
        s1 = temp[1] - b_center[1]
        s2 = temp[0] - a_center[0]
        diff1 = 30 * sin(atan(s1/s2))
        diff2 = 30 * sin(atan(s2/s1))
        return a_center[0] - diff1, a_center[1] + diff2, b_center[0] + diff1, b_center[1] - diff2
    elif a_center[0] > b_center[0] and a_center[1] > b_center[1]:
        #左上III
        temp = (a_center[0], b_center[1])
        s1 = temp[1] - b_center[1]
        s2 = a_center[0] - temp[0]
        diff1 = 30 * sin(atan(s1/s2))
        diff2 = 30 * sin(atan(s2/s1))
        return a_center[0] - diff1, a_center[1] - diff2, b_center[0] + diff1, b_center[1] + diff2
    elif a_center[0] < b_center[0] and a_center[1] > b_center[1]:
        #右上IV
        temp = (a_center[0], b_center[1])
        s1 = temp[1] - b_center[1]
        s2 = temp[0] - a_center[0]
        diff1 = 30 * sin(atan(s1/s2))
        diff2 = 30 * sin(atan(s2/s1))
        return a_center[0] + diff1, a_center[1] - diff2, b_center[0] - diff1, b_center[1] + diff2
    elif a_center[1] == b_center[1]:
        #同行
        return a_center[0] + 30, a_center[1], b_center[0] - 30, b_center[1]
    elif a_center[0] == b_center[0]:
        #同列
        return a_center[0], a_center[1] + 30, b_center[0], b_center[1] - 30

def go():
    w.delete(ALL)
    for i in list(position.keys()):
        w.create_oval(position[i][0][0], position[i][0][1], position[i][1][0], position[i][1][1], fill=position[i][3])
        center = (position[i][0][0] + position[i][2], position[i][0][1] + position[i][2])
        w.create_text(center[0], center[1], text=position[i][4])

    myline = [('A', 'B'), ('A', 'C'), ('B', 'C'), ('B', 'D'), ('C', 'E'), ('D', 'E')]

    for each in myline:
        w.create_line(connect(each))

    the_label = Label(w, text='你想去哪儿?')
    the_label_window = Canvas.create_window(w, 540, 10, anchor=E, window=the_label)
    button_a = Button(w, text='家', command=go2('家'))
    button_a_window = Canvas.create_window(w, 540, 35, anchor=E, window=button_a)
    button_b = Button(w, text='鱼C公园', command=go2('鱼C公园'))
    button_b_window = Canvas.create_window(w, 540, 60, anchor=E, wind3ow=button_b)
    button_c = Button(w, text='食物超市1~6', command=go2('食物超市1~6'))
    button_c_window = Canvas.create_window(w, 540, 85, anchor=E, window=button_c)
    button_d = Button(w, text='武器超市1~6', command=go2('武器超市1~6'))
    button_d_window = Canvas.create_window(w, 540, 110, anchor=E, window=button_d)
    button_e = Button(w, text='LV1打工仔公司', command=go2('LV1打工仔公司'))
    button_e_window = Canvas.create_window(w, 540, 135, anchor=E, window=button_e)

label1 = Label(w, text='六六湖秘密探险 V2.0\nSixty-six Lake Secret Adventure')
label1_window = Canvas.create_window(w, 275, 125, window=label1)
label2 = Label(w, text='你要做什么?')
label2_window = Canvas.create_window(w, 275, 150, window=label2)
choose1 = Button(w, text='出发', command=go)
choose1_window = Canvas.create_window(w, 275, 175, window=choose1)
choose2 = Button(w, text='查看背包', command=callback)
choose1_window = Canvas.create_window(w, 275, 200, window=choose2)

mainloop()
Exception in Tkinter callback
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/tkinter/__init__.py", line 2043, in __call__
    return self.func(*args)
           ~~~~~~~~~^^^^^^^
  File "/Users/zhangxiang/Documents/六六湖秘密探险2.x(最新).py", line 117, in go
    button_b = Button(w, text='鱼C公园', command=go2('鱼C公园'))
                                                 ~~~^^^^^^^^^^^
  File "/Users/zhangxiang/Documents/六六湖秘密探险2.x(最新).py", line 49, in go2
    Radiobutton(v, text=power[i], variable=v, value=i+1, indicatoron=False).pack(anchor=W)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/tkinter/__init__.py", line 3585, in __init__
    Widget.__init__(self, master, 'radiobutton', cnf, kw)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/tkinter/__init__.py", line 2718, in __init__
    self._setup(master, cnf)
    ~~~~~~~~~~~^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/tkinter/__init__.py", line 2687, in _setup
    self.tk = master.tk
              ^^^^^^^^^
AttributeError: 'IntVar' object has no attribute 'tk'. Did you mean: '_tk'?
最佳答案
2024-2-9 18:22:55
修正了你程序的部分问题,具体我懒得介绍了,自己看吧,求一个最佳答案。
from tkinter import *
from math import *
from time import *

food = ['LV4 苹果(48)', 'LV4 苹果(48)', 'LV4 苹果(48)']
power = ['LV3 三jio尺', 'LV3 三jio尺', 'LV3 三jio尺', 'LV3 三jio尺', 'LV3 三jio尺']
full = 500
money = 666

root = Tk()
root.title('六六湖秘密探险 V2.0 Feb.6th 2024 -- 六六游戏城V8888.66.5.1.0.456.17.0a7')

w = Canvas(root, width=550, height=350)
w.pack()

v = IntVar()
v.set(1)

now = '家'

road = {'家':{'鱼C公园':[1, 2, 30], '食物超市1~6':[2, 4, 90]}, \
        '鱼C公园':{'家':[1, 2, 30], '食物超市1~6':[2, 3, 48], '武器超市1~6':[1, 3, 36]}, \
        '食物超市1~6':{'家':[2, 4, 90], '鱼C公园':[2, 3, 48], 'LV1打工仔公司':[3, 4, 100]}, \
        '武器超市1~6':{'鱼C公园':[1, 3, 36], 'LV1打工仔公司':[6, 6, 54]}, \
        'LV1打工仔公司':{'食物超市1~6':[3, 4, 100], '武器超市1~6':[6, 6, 54]}}

def callback():
    print('啊!我被调用了')

def go2(button):
    if button == now:
        label3 = Label(w, text='你就在这儿')
        label3_window = Canvas.create_window(w, 540, 200, window=label3)
    else:
        w.delete(ALL)
        w.after(500)
        label4 = Label(w, text='Loading... 口口20%')
        label4_window = Canvas.create_window(w, 275, 340, anchor=W, window=label4)
        w.delete(ALL)
        w.after(500)
        label5 = Label(w, text='Loading... 口口口口40%')
        label5_window = Canvas.create_window(w, 275, 340, anchor=W, window=label4)
        w.delete(ALL)
        w.after(500)
        label6 = Label(w, text='【777警报】怪兽来袭!')
        label6_window = Canvas.create_window(w, 275, 340, window=label4)
        lpower = len(power)
        for i in range(lpower):
            Radiobutton(w, text=power[i], variable=v, value=i+1, indicatoron=False).pack(anchor=W)

position = {'A':((5, 5), (65, 65), 30, 'red', '家'), \
            'B':((70, 70), (130, 130), 30, 'orange', '鱼C公\n园'), \
            'C':((170, 70), (230, 130), 30, 'yellow', '食物超\n市1~6'), \
            'D':((70, 170), (130, 230), 30, 'green', '武器超\n市1~6'), \
            'E':((170, 270), (230, 330), 30, 'blue', 'LV1打\n工仔公\n司')}

def connect(x):
    a = position[x[0]]
    b = position[x[1]]
    a_center = ((a[0][0] + a[2]), (a[0][1] + a[2]))
    b_center = ((b[0][0] + b[2]), (b[0][1] + b[2]))
    if a_center[0] < b_center[0] and a_center[1] < b_center[1]:
        #右下I
        temp = (a_center[0], b_center[1])
        s1 = b_center[0] - temp[0]
        s2 = temp[1] - a_center[1]
        diff1 = 30 * sin(atan(s1/s2))
        diff2 = 30 * sin(atan(s2/s1))
        return a_center[0] + diff1, a_center[1] + diff2, b_center[0] - diff1, b_center[1] - diff2
    elif a_center[0] > b_center[0] and a_center[1] < b_center[1]:
        #左下II
        temp = (a_center[0], b_center[1])
        s1 = temp[1] - b_center[1]
        s2 = temp[0] - a_center[0]
        diff1 = 30 * sin(atan(s1/s2))
        diff2 = 30 * sin(atan(s2/s1))
        return a_center[0] - diff1, a_center[1] + diff2, b_center[0] + diff1, b_center[1] - diff2
    elif a_center[0] > b_center[0] and a_center[1] > b_center[1]:
        #左上III
        temp = (a_center[0], b_center[1])
        s1 = temp[1] - b_center[1]
        s2 = a_center[0] - temp[0]
        diff1 = 30 * sin(atan(s1/s2))
        diff2 = 30 * sin(atan(s2/s1))
        return a_center[0] - diff1, a_center[1] - diff2, b_center[0] + diff1, b_center[1] + diff2
    elif a_center[0] < b_center[0] and a_center[1] > b_center[1]:
        #右上IV
        temp = (a_center[0], b_center[1])
        s1 = temp[1] - b_center[1]
        s2 = temp[0] - a_center[0]
        diff1 = 30 * sin(atan(s1/s2))
        diff2 = 30 * sin(atan(s2/s1))
        return a_center[0] + diff1, a_center[1] - diff2, b_center[0] - diff1, b_center[1] + diff2
    elif a_center[1] == b_center[1]:
        #同行
        return a_center[0] + 30, a_center[1], b_center[0] - 30, b_center[1]
    elif a_center[0] == b_center[0]:
        #同列
        return a_center[0], a_center[1] + 30, b_center[0], b_center[1] - 30

def go():
    w.delete(ALL)
    for i in list(position.keys()):
        w.create_oval(position[i][0][0], position[i][0][1], position[i][1][0], position[i][1][1], fill=position[i][3])
        center = (position[i][0][0] + position[i][2], position[i][0][1] + position[i][2])
        w.create_text(center[0], center[1], text=position[i][4])

    myline = [('A', 'B'), ('A', 'C'), ('B', 'C'), ('B', 'D'), ('C', 'E'), ('D', 'E')]

    for each in myline:
        w.create_line(connect(each))

    the_label = Label(w, text='你想去哪儿?')
    the_label_window = Canvas.create_window(w, 540, 10, anchor=E, window=the_label)
    button_a = Button(w, text='家', command=lambda:go2('家'))
    button_a_window = Canvas.create_window(w, 540, 35, anchor=E, window=button_a)
    button_b = Button(w, text='鱼C公园', command=lambda:go2('鱼C公园'))
    button_b_window = Canvas.create_window(w, 540, 60, anchor=E, window=button_b)
    button_c = Button(w, text='食物超市1~6', command=lambda:go2('食物超市1~6'))
    button_c_window = Canvas.create_window(w, 540, 85, anchor=E, window=button_c)
    button_d = Button(w, text='武器超市1~6', command=lambda:go2('武器超市1~6'))
    button_d_window = Canvas.create_window(w, 540, 110, anchor=E, window=button_d)
    button_e = Button(w, text='LV1打工仔公司', command=lambda:go2('LV1打工仔公司'))
    button_e_window = Canvas.create_window(w, 540, 135, anchor=E, window=button_e)

label1 = Label(w, text='六六湖秘密探险 V2.0\nSixty-six Lake Secret Adventure')
label1_window = Canvas.create_window(w, 275, 125, window=label1)
label2 = Label(w, text='你要做什么?')
label2_window = Canvas.create_window(w, 275, 150, window=label2)
choose1 = Button(w, text='出发', command=go)
choose1_window = Canvas.create_window(w, 275, 175, window=choose1)
choose2 = Button(w, text='查看背包', command=callback)
choose1_window = Canvas.create_window(w, 275, 200, window=choose2)

mainloop()
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2024-2-9 17:43:15 | 显示全部楼层
你好,看起来你在编写一个使用Tkinter实现的游戏界面,但是代码中存在一些错误。以下是一些可能导致错误的地方:

1. 在创建按钮时,你给`command`参数传递了`go2('鱼C公园')`。然而,`command`参数需要的是一个函数名,而不是函数调用的结果。你可以将这个语句改为`command=lambda: go2('鱼C公园')`。

2. `Radiobutton`的第一个参数是父组件,但你传递的是一个`IntVar`对象。你应该将它改为传递`w`,即`Radiobutton(w, text=power, variable=v, value=i+1, indicatoron=False)`。

3. 在connect函数中,position[x]表示的是一个元组,你不能直接进行运算。你需要为元组中的每个元素进行运算。例如,`a_center = ((a[0] + a[2]) / 2, (a[1] + a[3]) / 2)`。

4. 在connect函数的最后,你返回的是四个坐标,但你没有将它们存储在变量中。你需要在函数的结尾添加一个返回语句,例如`return a_x, a_y, b_x, b_y`。

请尝试根据上述建议进行修改,并确保代码的其他部分也正确无误。如果还有其他问题,请随时向我提问。

以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-2-9 18:09:02 | 显示全部楼层
换用低版本python(3.9)及所对应的低版本tkinter试试看
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2024-2-9 18:12:19 | 显示全部楼层
tommyyu 发表于 2024-2-9 18:09
换用低版本python(3.9)及所对应的低版本tkinter试试看

怎么改啊?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-2-9 18:15:44 | 显示全部楼层

下载低版本的 python
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-2-9 18:19:10 | 显示全部楼层


刚刚我在我这里试了一下,3.8 运行你这个程序没有问题,应该是 3.13 的 bug 导致出现的问题。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-2-9 18:22:55 | 显示全部楼层    本楼为最佳答案   
修正了你程序的部分问题,具体我懒得介绍了,自己看吧,求一个最佳答案。
from tkinter import *
from math import *
from time import *

food = ['LV4 苹果(48)', 'LV4 苹果(48)', 'LV4 苹果(48)']
power = ['LV3 三jio尺', 'LV3 三jio尺', 'LV3 三jio尺', 'LV3 三jio尺', 'LV3 三jio尺']
full = 500
money = 666

root = Tk()
root.title('六六湖秘密探险 V2.0 Feb.6th 2024 -- 六六游戏城V8888.66.5.1.0.456.17.0a7')

w = Canvas(root, width=550, height=350)
w.pack()

v = IntVar()
v.set(1)

now = '家'

road = {'家':{'鱼C公园':[1, 2, 30], '食物超市1~6':[2, 4, 90]}, \
        '鱼C公园':{'家':[1, 2, 30], '食物超市1~6':[2, 3, 48], '武器超市1~6':[1, 3, 36]}, \
        '食物超市1~6':{'家':[2, 4, 90], '鱼C公园':[2, 3, 48], 'LV1打工仔公司':[3, 4, 100]}, \
        '武器超市1~6':{'鱼C公园':[1, 3, 36], 'LV1打工仔公司':[6, 6, 54]}, \
        'LV1打工仔公司':{'食物超市1~6':[3, 4, 100], '武器超市1~6':[6, 6, 54]}}

def callback():
    print('啊!我被调用了')

def go2(button):
    if button == now:
        label3 = Label(w, text='你就在这儿')
        label3_window = Canvas.create_window(w, 540, 200, window=label3)
    else:
        w.delete(ALL)
        w.after(500)
        label4 = Label(w, text='Loading... 口口20%')
        label4_window = Canvas.create_window(w, 275, 340, anchor=W, window=label4)
        w.delete(ALL)
        w.after(500)
        label5 = Label(w, text='Loading... 口口口口40%')
        label5_window = Canvas.create_window(w, 275, 340, anchor=W, window=label4)
        w.delete(ALL)
        w.after(500)
        label6 = Label(w, text='【777警报】怪兽来袭!')
        label6_window = Canvas.create_window(w, 275, 340, window=label4)
        lpower = len(power)
        for i in range(lpower):
            Radiobutton(w, text=power[i], variable=v, value=i+1, indicatoron=False).pack(anchor=W)

position = {'A':((5, 5), (65, 65), 30, 'red', '家'), \
            'B':((70, 70), (130, 130), 30, 'orange', '鱼C公\n园'), \
            'C':((170, 70), (230, 130), 30, 'yellow', '食物超\n市1~6'), \
            'D':((70, 170), (130, 230), 30, 'green', '武器超\n市1~6'), \
            'E':((170, 270), (230, 330), 30, 'blue', 'LV1打\n工仔公\n司')}

def connect(x):
    a = position[x[0]]
    b = position[x[1]]
    a_center = ((a[0][0] + a[2]), (a[0][1] + a[2]))
    b_center = ((b[0][0] + b[2]), (b[0][1] + b[2]))
    if a_center[0] < b_center[0] and a_center[1] < b_center[1]:
        #右下I
        temp = (a_center[0], b_center[1])
        s1 = b_center[0] - temp[0]
        s2 = temp[1] - a_center[1]
        diff1 = 30 * sin(atan(s1/s2))
        diff2 = 30 * sin(atan(s2/s1))
        return a_center[0] + diff1, a_center[1] + diff2, b_center[0] - diff1, b_center[1] - diff2
    elif a_center[0] > b_center[0] and a_center[1] < b_center[1]:
        #左下II
        temp = (a_center[0], b_center[1])
        s1 = temp[1] - b_center[1]
        s2 = temp[0] - a_center[0]
        diff1 = 30 * sin(atan(s1/s2))
        diff2 = 30 * sin(atan(s2/s1))
        return a_center[0] - diff1, a_center[1] + diff2, b_center[0] + diff1, b_center[1] - diff2
    elif a_center[0] > b_center[0] and a_center[1] > b_center[1]:
        #左上III
        temp = (a_center[0], b_center[1])
        s1 = temp[1] - b_center[1]
        s2 = a_center[0] - temp[0]
        diff1 = 30 * sin(atan(s1/s2))
        diff2 = 30 * sin(atan(s2/s1))
        return a_center[0] - diff1, a_center[1] - diff2, b_center[0] + diff1, b_center[1] + diff2
    elif a_center[0] < b_center[0] and a_center[1] > b_center[1]:
        #右上IV
        temp = (a_center[0], b_center[1])
        s1 = temp[1] - b_center[1]
        s2 = temp[0] - a_center[0]
        diff1 = 30 * sin(atan(s1/s2))
        diff2 = 30 * sin(atan(s2/s1))
        return a_center[0] + diff1, a_center[1] - diff2, b_center[0] - diff1, b_center[1] + diff2
    elif a_center[1] == b_center[1]:
        #同行
        return a_center[0] + 30, a_center[1], b_center[0] - 30, b_center[1]
    elif a_center[0] == b_center[0]:
        #同列
        return a_center[0], a_center[1] + 30, b_center[0], b_center[1] - 30

def go():
    w.delete(ALL)
    for i in list(position.keys()):
        w.create_oval(position[i][0][0], position[i][0][1], position[i][1][0], position[i][1][1], fill=position[i][3])
        center = (position[i][0][0] + position[i][2], position[i][0][1] + position[i][2])
        w.create_text(center[0], center[1], text=position[i][4])

    myline = [('A', 'B'), ('A', 'C'), ('B', 'C'), ('B', 'D'), ('C', 'E'), ('D', 'E')]

    for each in myline:
        w.create_line(connect(each))

    the_label = Label(w, text='你想去哪儿?')
    the_label_window = Canvas.create_window(w, 540, 10, anchor=E, window=the_label)
    button_a = Button(w, text='家', command=lambda:go2('家'))
    button_a_window = Canvas.create_window(w, 540, 35, anchor=E, window=button_a)
    button_b = Button(w, text='鱼C公园', command=lambda:go2('鱼C公园'))
    button_b_window = Canvas.create_window(w, 540, 60, anchor=E, window=button_b)
    button_c = Button(w, text='食物超市1~6', command=lambda:go2('食物超市1~6'))
    button_c_window = Canvas.create_window(w, 540, 85, anchor=E, window=button_c)
    button_d = Button(w, text='武器超市1~6', command=lambda:go2('武器超市1~6'))
    button_d_window = Canvas.create_window(w, 540, 110, anchor=E, window=button_d)
    button_e = Button(w, text='LV1打工仔公司', command=lambda:go2('LV1打工仔公司'))
    button_e_window = Canvas.create_window(w, 540, 135, anchor=E, window=button_e)

label1 = Label(w, text='六六湖秘密探险 V2.0\nSixty-six Lake Secret Adventure')
label1_window = Canvas.create_window(w, 275, 125, window=label1)
label2 = Label(w, text='你要做什么?')
label2_window = Canvas.create_window(w, 275, 150, window=label2)
choose1 = Button(w, text='出发', command=go)
choose1_window = Canvas.create_window(w, 275, 175, window=choose1)
choose2 = Button(w, text='查看背包', command=callback)
choose1_window = Canvas.create_window(w, 275, 200, window=choose2)

mainloop()
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-2-9 19:03:45 | 显示全部楼层
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-9-22 07:13

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表