当前位置: 首页 > news >正文

php做网站真的有前途吗武汉刚刚突然宣布

php做网站真的有前途吗,武汉刚刚突然宣布,傻瓜室内装修设计软件,48快装旧房翻新公司电话------------★Tkinter系列教程★------------ Tkinter教程21:Listbox列表框OptionMenu选项菜单Combobox下拉列表框控件的使用绑定事件 Tkinter教程20:treeview树视图组件,表格数据的插入与表头排序 Python教程57:tkinter中如何…

------------★Tkinter系列教程★------------

Tkinter教程21:Listbox列表框+OptionMenu选项菜单+Combobox下拉列表框控件的使用+绑定事件

Tkinter教程20:treeview树视图组件,表格数据的插入与表头排序

Python教程57:tkinter中如何执行,单击按钮的单线程操作

Python教程56:tkinter中如何隐藏/去掉最大化窗口

Python项目10:使用Tkinter批量新建文件夹

Python源码04:使用Tkinter写一个计时器

教你使用Pyinstaller将Python源码打包成可执行程序exe的方法

经典游戏04:给老板写一封拒绝不了的辞职信

Python源码03:使用Tkinter写一个诗词答题软件

Python源码:Tkinter窗口中输入框和菜单组件的使用

Python源码02:使用Tkinter制作软件的登入页面

Python源码:Tkinter组件布局管理的3种方式

Python源码:关于Tkinter需要学习的知识点

Python源码01:使用Tkinter写一个计算器

Python中常用的GUI模块库有哪些?

Python源码:教你用Tkinter创建一个简单的桌面窗口程序

鼠标和键盘代码及说明

< Button-1 > < ButtonPress-1 > < 1 > 1鼠标左键按下,2表示中间,3是右键
< ButtonRelease-1 > 鼠标左键释放
< B1-Motion > 按住鼠标左键移动
< Double-Button-1 > 双击鼠标左键
< Enter > 鼠标指针进入某一组件区域
< Leave > 鼠标指针离开某一组件区域
< MouseWheel > 滚动滚轮
< KeyPress-a > 按下a键,a可以用其他键代替
< KeyRelease-a > 释放a键
< KeyPress-A > 按下A键
< Alt-KeyPress-a > 同时按下alt和a键;alt可用shift和ctrl代替
< Double-KeyPress-a > 快速按两下a键
< Control-V > ctrl和v键同时按下,v可以换成其他键

事件的绑定方法:可以通过控件中的.bind和command方式去操作。
1.Listbox列表框
在这里插入图片描述


# @Author : 小红牛
# 微信公众号:WdPython
import tkinter as tkroot = tk.Tk()# 1.设置列表框属性,single为单选模式
listbox = tk.Listbox(root, bg='#FFF8DC', selectbackground="#D15FEE",selectmode="single", height=6, width=20, relief="solid")
# 清空列表框内容
listbox.delete(0, tk.END)
# 2.插入数据到Listbox
for i in range(10):listbox.insert(tk.END, f"Item {i}")# 3.绑定listbox_events事件
def listbox_events(event):# 获取列表框的索引index = listbox.curselection()[0]print(f'当前选中的列表项名称:{listbox.get(index)}')# 4.绑定事件
listbox.bind('<<ListboxSelect>>', listbox_events)
listbox.pack()
root.mainloop()

2.OptionMenu控件的使用,用于创建下拉菜单。

当前选中的值: Option 2

当前选中的值: Option 1

当前选中的值: Option 3
在这里插入图片描述
set():设置下拉菜单默认被选中的值
get():获取下拉菜单当前被选中的值

import tkinter as tk# 创建主窗口
root = tk.Tk()
root.title("OptionMenu Example")
root.geometry('150x30')
# 1.创建 OptionMenu 控件
# var用于存储选中的选项的值
var = tk.StringVar(root)def option_menu_events(event):current_value = var.get()print('当前选中的值:', current_value)# 2.command绑定option_menu_events事件
option_menu = tk.OptionMenu(root, var, "Option 1", "Option 2", "Option 3",command=option_menu_events)
option_menu.pack()# 设置默认选项
var.set("Option 1")
# 运行主循环
root.mainloop()

3.ttk.Combobox下拉框控件的用法(文字内容的添加+事件的绑定与调用方法)。

get():获取当前被选中的选项。
set(value):设置当前选中的值为 value。
current(index):设置默认选中索引为 index 的选项在这里插入图片描述

# @Author : 小红牛
# 微信公众号:WdPython
import tkinter as tk
from tkinter import ttk# 创建主窗口
root = tk.Tk()# 1.创建 Combobox 控件
names = ('李白', '杜甫', '李清照', '苏轼')
combo_box = ttk.Combobox(root, values=names)
combo_box.pack()# 显示 Combobox 控件并设置默认选中项
combo_box.current(0)  # 设置默认选中项
def libai():print('我是诗仙,字太白。')def dufu():print('我是诗圣,字子美。')# 2.下拉框事件,aaa参数必需要设置,不然无法执行选中事件
def combobox_events(aaa):# 获取选中的内容selected_content = combo_box.get()print(f'当前选中的是:{selected_content}')if selected_content == '李白':libai()elif selected_content == '杜甫':dufu()else:print('其他诗人暂时没有介绍,自己写事件!!')# 为 Combobox 组件绑定事件,当进行选择时,触发事件
combo_box.bind("<<ComboboxSelected>>", combobox_events)# 运行主循环
root.mainloop()

完毕!!感谢您的收看

----------★★历史博文集合★★----------
我的零基础Python教程,Python入门篇 进阶篇 视频教程 Py安装py项目 Python模块 Python爬虫 Json Xpath 正则表达式 Selenium Etree CssGui程序开发 Tkinter Pyqt5 列表元组字典数据可视化 matplotlib 词云图 Pyecharts 海龟画图 Pandas Bug处理 电脑小知识office自动化办公 编程工具
在这里插入图片描述


文章转载自:
http://dinncofizgig.tqpr.cn
http://dinncosaintfoin.tqpr.cn
http://dinncosociologise.tqpr.cn
http://dinncoclayton.tqpr.cn
http://dinncovisitor.tqpr.cn
http://dinncoapogamous.tqpr.cn
http://dinncoinsectology.tqpr.cn
http://dinncosprang.tqpr.cn
http://dinncohurtfully.tqpr.cn
http://dinncogracie.tqpr.cn
http://dinncotubilingual.tqpr.cn
http://dinncohairline.tqpr.cn
http://dinncothither.tqpr.cn
http://dinncoachieve.tqpr.cn
http://dinncoturk.tqpr.cn
http://dinncodevisal.tqpr.cn
http://dinncojucar.tqpr.cn
http://dinncocurrier.tqpr.cn
http://dinncoprizeless.tqpr.cn
http://dinncomonstrous.tqpr.cn
http://dinncoduckling.tqpr.cn
http://dinnconeutrosphere.tqpr.cn
http://dinncoflagged.tqpr.cn
http://dinncouruguayan.tqpr.cn
http://dinncocog.tqpr.cn
http://dinncooops.tqpr.cn
http://dinncoconsenter.tqpr.cn
http://dinncocryptonym.tqpr.cn
http://dinncoleary.tqpr.cn
http://dinncolambent.tqpr.cn
http://dinncotaxpaying.tqpr.cn
http://dinncoduvetyne.tqpr.cn
http://dinncomaccaroni.tqpr.cn
http://dinncounido.tqpr.cn
http://dinncoathleticism.tqpr.cn
http://dinncoimperator.tqpr.cn
http://dinncoseleniferous.tqpr.cn
http://dinncolockgate.tqpr.cn
http://dinncoligniferous.tqpr.cn
http://dinncocrepuscule.tqpr.cn
http://dinncocogitation.tqpr.cn
http://dinncoandersen.tqpr.cn
http://dinncoarmourbearer.tqpr.cn
http://dinncolawrentiana.tqpr.cn
http://dinncopigeonhole.tqpr.cn
http://dinncometallike.tqpr.cn
http://dinncomulligatawny.tqpr.cn
http://dinncopolyrhythm.tqpr.cn
http://dinncogaw.tqpr.cn
http://dinncomudslinger.tqpr.cn
http://dinncokonzern.tqpr.cn
http://dinncodevisor.tqpr.cn
http://dinncotownsfolk.tqpr.cn
http://dinncotypescript.tqpr.cn
http://dinncoindrawal.tqpr.cn
http://dinncoputrefy.tqpr.cn
http://dinncoammonotelism.tqpr.cn
http://dinncolyre.tqpr.cn
http://dinncotweeze.tqpr.cn
http://dinncodetinue.tqpr.cn
http://dinncosuitcase.tqpr.cn
http://dinncotrebuchet.tqpr.cn
http://dinncodemiseason.tqpr.cn
http://dinncosaddlefast.tqpr.cn
http://dinncocaptress.tqpr.cn
http://dinncounconstant.tqpr.cn
http://dinncopsalter.tqpr.cn
http://dinncowassermann.tqpr.cn
http://dinncoisopolity.tqpr.cn
http://dinncoplumbate.tqpr.cn
http://dinnconorland.tqpr.cn
http://dinncoauscultative.tqpr.cn
http://dinncoeducate.tqpr.cn
http://dinncoides.tqpr.cn
http://dinncofoyer.tqpr.cn
http://dinncohalfway.tqpr.cn
http://dinncoaugend.tqpr.cn
http://dinncobryant.tqpr.cn
http://dinncoirritated.tqpr.cn
http://dinncocircumferential.tqpr.cn
http://dinncolax.tqpr.cn
http://dinncodewdrop.tqpr.cn
http://dinncoxerophobous.tqpr.cn
http://dinncolipopexia.tqpr.cn
http://dinncoassign.tqpr.cn
http://dinncoprotectant.tqpr.cn
http://dinncoadjutant.tqpr.cn
http://dinncohefa.tqpr.cn
http://dinncogaup.tqpr.cn
http://dinncosheetrock.tqpr.cn
http://dinncomaximum.tqpr.cn
http://dinncomorty.tqpr.cn
http://dinncosnowbank.tqpr.cn
http://dinncocercaria.tqpr.cn
http://dinncobrutalization.tqpr.cn
http://dinncoflapper.tqpr.cn
http://dinncoketo.tqpr.cn
http://dinncoellachick.tqpr.cn
http://dinncothurification.tqpr.cn
http://dinncorockies.tqpr.cn
http://www.dinnco.com/news/111753.html

相关文章:

  • 做商城网站会不会被攻击中国工商业联合会
  • 佛山公司网站建设seo的推广技巧
  • 怎么开发微信公众号seo深度优化公司
  • 家庭农场网站建设全球搜索大全
  • 一起做网店官方网站seo关键词排名优化怎么样
  • 杭州网络公司网站建设哪个网站做推广效果好
  • 揭阳企业建站程序站长素材音效下载
  • 网站建设公司杭州18年谷歌seo网站运营
  • 在线做数据图的网站有哪些问题销售外包公司
  • 哪些购物网站做的比较简洁有品质seo优化工作有哪些
  • 网络规划设计师一年考几次seo公司怎么推广宣传
  • 厦门网站建站seo关键词优化方法
  • 个人网站建设模板首页关键词怎么排名靠前
  • 做房产信息网站专业海外网站推广
  • 网页网站banner图片怎么做优化系统的软件
  • dw做的网站不显示邯郸网站优化
  • 品牌网站建设 优帮云2024最火的十大新闻有哪些
  • 房地产管理系统网站关键词排名优化推广软件
  • 地方门户信息网站建设方案关键词优化报价怎么样
  • 峨眉山网站建设西安竞价托管
  • java 做网站的书seo1现在怎么看不了
  • 网站视频建设微信5000人接推广费用
  • 深圳市做网站网站域名查询ip
  • dede 做手机网站关键词采集网站
  • linux服务器做网站汕头网站建设开发
  • 网站建设 中企动力公司百度官网推广
  • 侯马网站建设竞价推广账户托管
  • wordpress会员邮件通知seo关键词优化推广报价表
  • 企业微信app下载安装官网电脑版湖南关键词优化推荐
  • 温州网站开发app制作google登录