python tkinter窗口切换_tkinter--实现简单的页面切换

[Python] 纯文本查看 复制代码import tkinter as tk

index_num = 4

def up_page():

info = frame_root.place_info()

x = int(info['x']) + 100

y = info['y']

frame_root.place(x=x, y=y)

global index_num

index_num += 1

index['text'] = "第 {} 页".format( index_num)

def down_page():

info = frame_root.place_info()

x = int (info['x'] ) - 100

y = info['y']

frame_root.place(x=x, y=y)

global index_num

index_num -=1

index['text'] = "第 {} 页".format( index_num)

root = tk.Tk()

root.title("滚动页面")

root.geometry("800x300+200+200")

# 显示框架- 大小和最小子框架相同

show_frame = tk.Frame( master=root, width= 100, height=200, bg="

你可能感兴趣的:(python,tkinter窗口切换)