当前位置:网站首页>When using the MessageBox of class toplevel, a problem pops up in the window.
When using the MessageBox of class toplevel, a problem pops up in the window.
2022-06-28 05:16:00 【sunshinei928】
Encountered main window and... In a small project toplevel Windows all use class Class time ,toplevel The window pops up messagebox Will automatically jump to the main window , meanwhile toplevel The window will automatically be behind the main window .
Looking up the information on the Internet , The main methods are in messagebox increase parent Parameters , The following code .
from tkinter.messagebox import *
root = Tk()
texto = Toplevel(root)
showinfo("title", "message",parent=texto)But the project uses class,toplevel There is no clear parent, stay csdn Is used by netizens parent=self._root, But after the test, it is not correct .
from tkinter import *
from tkinter.ttk import *
from tkinter.messagebox import *
import os
currentpath=os.path.dirname(__file__)
class AcurateQueryWindow(Toplevel):
showwarning('warning','input four parameters!')
Later stackoverflow Go up for help , The answer is parent=self. The test passed , Pop up messagebox be located toplevel Before window .
showwarning('warning','input four parameters!',parent=self)
边栏推荐
- DPDK 源码测试时性能下降问题
- Metartc5.0 API programming guide (I)
- Extjs library management system source code intelligent library management system source code
- Steve Jobs' speech at Stanford University -- follow your heart
- 公司为什么选择云数据库?它的魅力到底是什么!
- msa.h:没有那个文件或目录
- 大促场景下,如何做好网关高可用防护
- Lumiprobe细胞成像分析:PKH26 细胞膜标记试剂盒
- Opencv实现颜色检测
- Camera Basics
猜你喜欢

!‘cat‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件。

【LeetCode】12、整数转罗马数字

gorm事务体验

机器人学DH参数及利用matlab符号运算推导

基于订单流工具,我们能看到什么?

Extjs library management system source code intelligent library management system source code

The latest examination questions and answers for the eight members (standard members) of Liaoning architecture in 2022

氨基染料研究:Lumiprobe FAM 胺,6-异构体

大促场景下,如何做好网关高可用防护
![[leetcode] 12. Integer to Roman numeral](/img/3e/815f24a85a3333ce924acee1856f62.png)
[leetcode] 12. Integer to Roman numeral
随机推荐
2022 high altitude installation, maintenance and removal examination questions and answers
项目经理考完PMP就够了?不是的!
2022年安全员-B证考试题库及答案
Learn Taiji Maker - mqtt Chapter 2 (IV) esp8266 reserved message application
quartus 复制IP核
Is it enough for the project manager to finish the PMP? no, it isn't!
信息学奥赛一本通 1360:奇怪的电梯(lift)
[leetcode] 12. Integer to Roman numeral
证明素数/质数有无限多个
Deeplearning ai-week1-quiz
How does the power outlet transmit electricity? Simple problems that have plagued my little friend for so many years
Carboxylic acid study: lumiprobe sulfoacyanine 7 dicarboxylic acid
The short video local life section has become popular. How to grasp the new opportunities?
Wireless sensor network learning notes (I)
大促场景下,如何做好网关高可用防护
How to do a good job of gateway high availability protection in the big promotion scenario
Programmer - Shepherd
氨基染料研究:Lumiprobe FAM 胺,6-异构体
Prove that there are infinite primes / primes
【无标题】drv8825步进电机驱动板子原理图