中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

網(wǎng)站建設(shè)需不需要編程企業(yè)培訓(xùn)機構(gòu)

網(wǎng)站建設(shè)需不需要編程,企業(yè)培訓(xùn)機構(gòu),如何做醫(yī)藥類網(wǎng)站,禮品回收網(wǎng)站建設(shè)在本文中,將介紹 tkinter Frame 框架小部件、 LabelFrame 標簽框架小部件的使用方法。 Frame 框架 Frame 框架在窗體上建立一個矩形區(qū)域,作為一個容器,用于組織分組排列其他小部件。 要創(chuàng)建框架,請使用以下構(gòu)造函數(shù)。 frame …

在本文中,將介紹 tkinter Frame 框架小部件、 LabelFrame 標簽框架小部件的使用方法。

Frame 框架

Frame 框架在窗體上建立一個矩形區(qū)域,作為一個容器,用于組織分組排列其他小部件。

要創(chuàng)建框架,請使用以下構(gòu)造函數(shù)。

frame = tk.Frame(master, **options)

tkinter 中的每個小部件都需要一個 “parent” 或 “master” 作為第一個參數(shù)。當使用框架時,要將框架作為其父級。

import?tkinter?as?tk
root?=?tk.Tk()
root.geometry('600x400+200+200')
root.title('Frame?框架演示')leftframe?=?tk.Frame(root)
leftframe.pack(side=tk.LEFT)rightframe?=?tk.Frame(root)
rightframe.pack(side=tk.RIGHT)button1?=?tk.Button(leftframe,?text?=?"Button1")
button1.pack(padx?=?10,?pady?=?10)
button2?=?tk.Button(rightframe,?text?=?"Button2")
button2.pack(padx?=?10,?pady?=?10)
button3?=?tk.Button(leftframe,?text?=?"Button3")
button3.pack(padx?=?10,?pady?=?10)root.mainloop()

在上面的代碼中,創(chuàng)建了leftframe、 rightframe 兩個框架并排左右放置,三個按鈕小部件分別放置到不同的框架中。

框架也可以作為分隔線使用。

import?tkinter?as?tk
root?=?tk.Tk()
root.geometry('600x400+200+200')
root.title('Frame?框架演示')
frame1?=?tk.Frame(root,?bd=5,?relief=tk.RIDGE)
frame1.pack(ipadx?=?100)button1?=?tk.Button(frame1,?text?=?"Button1")
button1.pack(padx?=?10,?pady?=?10)
button2?=?tk.Button(frame1,?text?=?"Button2")
button2.pack(padx?=?10,?pady?=?10)
button3?=?tk.Button(frame1,?text?=?"Button3")
button3.pack(padx?=?10,?pady?=?10)frame2?=?tk.Frame(frame1,?bd=5,?relief=tk.RIDGE,?bg="black")
frame2.pack(fill=tk.X)button4?=?tk.Button(frame1,?text?=?"Button1")
button4.pack(padx?=?10,?pady?=?10)
button5?=?tk.Button(frame1,?text?=?"Button2")
button5.pack(padx?=?10,?pady?=?10)
button6?=?tk.Button(frame1,?text?=?"Button3")
button6.pack(padx?=?10,?pady?=?10)
root.mainloop()

LabelFrame 標簽框架

tkinter 提供了 Frame 小部件的一個變體,稱為 LabelFrame。LabelFrame 標簽框架除了具備常規(guī)框架的功能外,還擴展了一些其他功能。

要創(chuàng)建框架,請使用以下構(gòu)造函數(shù)。

frame = tk.LabelFrame(master, **options)

LabelFrame 標簽框架增加了 Text 參數(shù),可以作為框架的標題。默認位置在左上角,也可以使用參數(shù) labelanchor ,改變標題的位置,可選參數(shù)如下圖所示。

使用 labelwidget 參數(shù),可以把其他小部件放到框架上。

import?tkinter?as?tk
root?=?tk.Tk()
root.geometry('600x400+200+200')
root.title('LabelFrame?標簽框架演示')button?=?tk.Button(root,?text?=?"Hello!")
button.pack(padx?=?5,?pady?=?6)LabelFrame1?=?tk.LabelFrame(root,?text='LabelFrame')
LabelFrame1.pack(ipadx?=?100)LabelFrame2?=?tk.LabelFrame(root,?text='LabelFrame',?labelanchor?=?"se")
LabelFrame2.pack(ipadx?=?100)LabelFrame3?=?tk.LabelFrame(root,?text='LabelFrame',?labelanchor?=?"s",?labelwidget?=?button)
LabelFrame3.pack(ipadx?=?100)button1?=?tk.Button(LabelFrame1,?text?=?"Button1")
button1.pack(padx?=?10,?pady?=?10)
button2?=?tk.Button(LabelFrame1,?text?=?"Button2")
button2.pack(padx?=?10,?pady?=?10)
button3?=?tk.Button(LabelFrame2,?text?=?"Button3")
button3.pack(padx?=?10,?pady?=?10)button4?=?tk.Button(LabelFrame2,?text?=?"Button4")
button4.pack(padx?=?10,?pady?=?10)
button5?=?tk.Button(LabelFrame3,?text?=?"Button5")
button5.pack(padx?=?10,?pady?=?10)
button6?=?tk.Button(LabelFrame3,?text?=?"Button6")
button6.pack(padx?=?10,?pady?=?10)
root.mainloop()

Frame LabelFrame 選項

選項名稱說明
bd邊框的寬度。默認 2 像素。
bg背景顏色。
cursor鼠標指針類型。
height框架的高度。
width框架的寬度。
highlightbackground背景顏色。
highlightthickness獲得焦點時邊框粗細。
relief框架的邊框類型。默認 FLAT。
highlightcolor獲得焦點時高亮顏色。
http://www.risenshineclean.com/news/11025.html

相關(guān)文章:

  • 網(wǎng)站html5自適應(yīng)屏幕營銷策劃精準營銷
  • 那些免費網(wǎng)站可以做國外貿(mào)易國內(nèi)最新新聞大事
  • 上海網(wǎng)站制作優(yōu)化公司臨沂做網(wǎng)絡(luò)優(yōu)化的公司
  • 檔案網(wǎng)站建設(shè)思考北京seo多少錢
  • 廣州seo培訓(xùn)機構(gòu)seo在線教程
  • 河南省建設(shè)廳門戶網(wǎng)站100個免費推廣網(wǎng)站
  • 茶葉有什么網(wǎng)站可以做推廣微營銷
  • 手機網(wǎng)站生成app網(wǎng)頁怎么優(yōu)化
  • 蘇州企業(yè)網(wǎng)站設(shè)計方案網(wǎng)站關(guān)鍵詞優(yōu)化wang
  • 做app 的模板下載網(wǎng)站有哪些網(wǎng)站seo外包靠譜嗎
  • 政府網(wǎng)站建設(shè)的重要性wordpress建站
  • 蘇州市政府網(wǎng)站建設(shè)評估免費外鏈發(fā)布平臺
  • 今天最新新聞報道seo關(guān)鍵詞推廣優(yōu)化
  • 動態(tài)網(wǎng)站沒有數(shù)據(jù)庫怎么做快手作品免費推廣軟件
  • 九江網(wǎng)站開發(fā)汕頭百度推廣公司
  • 百度公司可以做網(wǎng)站么中國搜索引擎排名2021
  • 學(xué)網(wǎng)站開發(fā)培訓(xùn)機構(gòu)今日新聞聯(lián)播主要內(nèi)容
  • 內(nèi)容相同的 網(wǎng)站網(wǎng)絡(luò)軟營銷
  • WordPress一鍵安裝安全東莞百度seo推廣公司
  • 擁有服務(wù)器后如何做網(wǎng)站廣告推廣軟件
  • 什么網(wǎng)站比較少人做國家市場監(jiān)督管理總局官網(wǎng)
  • 品牌設(shè)計公司哪里seo流量排行榜神器
  • 綠色資源網(wǎng)汕頭seo網(wǎng)站建設(shè)
  • 網(wǎng)站備案幕布尺寸網(wǎng)站seo快速
  • 男女主網(wǎng)站上做的popo網(wǎng)站建設(shè)優(yōu)化
  • 鶴崗北京網(wǎng)站建設(shè)谷歌搜索引擎怎么才能用
  • 廈門同安區(qū)建設(shè)局網(wǎng)站軟文營銷常用的方式是什么
  • 重慶網(wǎng)站有哪些太原百度快速優(yōu)化
  • 深圳營銷型網(wǎng)頁設(shè)計公司鄭州seo外包v1
  • 手機網(wǎng)站設(shè)計模板營銷推廣方法有哪些