当前位置: 首页>>代码示例>>Python>>正文


Python Tk.iconbitmap方法代码示例

本文整理汇总了Python中Tkinter.Tk.iconbitmap方法的典型用法代码示例。如果您正苦于以下问题:Python Tk.iconbitmap方法的具体用法?Python Tk.iconbitmap怎么用?Python Tk.iconbitmap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tkinter.Tk的用法示例。


在下文中一共展示了Tk.iconbitmap方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: on_botaoselecionar_activate

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import iconbitmap [as 别名]
 def on_botaoselecionar_activate(self, widget):
     """Funcao responsavel pelo RadioButton"""
     
     if self.count == 1:
         self.camera.release()
         self.c = True
         self.count = 0
     if self.RadioButt == 1:
         self.camera = cv2.VideoCapture(0)
         self.count = 1
         if not self.threadflag:
             app.thread_gtk()                   # gtk.main() only once (first time)
             app.threadflag=0                     # change flag
     else:
         self.c = False
         root = Tk()
         root.iconbitmap(default='favicon.ico')
         root.withdraw()
         self.file = askopenfilename(filetypes=[("JPEG", "*.jpg; *.jpe; *.jpeg; *.jfif"),
                              ("Bitmap Files","*read().bmp; *.dib"),
                              ("PNG", "*.png"),
                              ("TIFF", "*.tiff; *.tif")],initialdir = 'C:\\',multiple = False,title = "Abrindo imagens..")
         
         self.imagecam.set_from_file(self.file)    
         self.varsave = 1 
开发者ID:EliasThiago,项目名称:PyProjectLibras,代码行数:27,代码来源:Principal.py

示例2: build

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import iconbitmap [as 别名]
def build():
    """
    Constructs the application

    :return:    An instance of Tk to launch
    """
    root = Tk()
    root.title("MazeBuilder")
    root.iconbitmap("Data/favicon.ico")
    root.geometry(str(WIN_X)+"x"+str(WIN_Y)+"+"+str(POSITION)+"+"+str(POSITION))
    mazeBuilder = MazeBuilder(root)
    mazeBuilder.pack(fill=BOTH, expand=1)
    return root
开发者ID:twisty-n,项目名称:MazeBuilder,代码行数:15,代码来源:MazeBuilder.py

示例3: on_save_image

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import iconbitmap [as 别名]
 def on_save_image(self, widget):
     """Funcao para salvar imagem"""
     root = Tk()
     root.iconbitmap(default='favicon.ico')
     root.withdraw()
     FileSave = asksaveasfilename(filetypes=[("JPEG", "*.jpg; *.jpe; *.jpeg; *.jfif"),],
                                     initialdir = 'C:\\',title = "Salvando a imagem..",
                                     initialfile = "*.jpg")
     if self.varsave == 1: 
         self.output_img = cv2.imread(self.file,1)
         self.varsave = 0
         cv2.imwrite(FileSave,self.output_img)
     else:
         #criar uma logica para salvar imagens tiradas da webcam
         cv2.imwrite(FileSave,self.im)
         self.varsave = 0
开发者ID:EliasThiago,项目名称:PyProjectLibras,代码行数:18,代码来源:Principal.py

示例4: run

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import iconbitmap [as 别名]
def run():
    """ starting the interface
    """

    from gui import GUI
    from Tkinter import Tk
    import system

    root = Tk()
    root.columnconfigure(0,weight=1)
    root.rowconfigure(1,weight=1)
    root.title(system.name + " " + system.version)
    root.minsize(width= system.minwidth , height=system.minheight)
    root.geometry(system.defsize)

    gui = GUI(root)
    gui.makeGUI()

    root.iconbitmap('hat2.ico')
    root.mainloop()
开发者ID:BackupTheBerlios,项目名称:pachat-svn,代码行数:22,代码来源:PAchat.py

示例5: open

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import iconbitmap [as 别名]
# icon genuinity

if os.path.isfile('icon.ico') and os.path.isfile('icon.png'):
    icon_i = ''.join(str(e) for e in open('icon.ico').readlines())
    icon_p = ''.join(str(e) for e in open('icon.png').readlines())
    if (md5(icon_i).hexdigest() != '89fcd9bcf566cb30d2e86d6e9b9f0bdc' and
        md5(icon_p).hexdigest() != '658e8dc0bf8b9a09b36994abf9242099'):
        easygui.msgbox(title='YoDa by Yogi', msg='One or More File is Invalid or Missing')
        exit(0)
else:
    easygui.msgbox(title='YoDa by Yogi', msg='One or More file is missing or corrupted. Try re-installing the software.')
    exit(0)
# Replacing the tk logo
tk = Tk()
tk.withdraw()
tk.iconbitmap(default='icon.ico')
tk.destroy()
#



class ConfigClass:
        def __init__(self):
                if not os.path.isdir(os.environ['APPDATA']+r'\FeedAbyte'):
                        os.makedirs(os.environ['APPDATA']+r'\FeedAbyte\YoDa')
                if not os.path.isdir(os.environ['APPDATA']+r'\FeedAbyte\YoDa'):
                        os.mkdir(os.environ['APPDATA']+r'\FeedAbyte\Yoda')
                if not os.path.isfile(os.environ['APPDATA']+r'\FeedAbyte\YoDa\config'):
                        self.create_default()

        def create_default(self):
开发者ID:acetheultimate,项目名称:python,代码行数:33,代码来源:YoDa.py

示例6: Tk

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import iconbitmap [as 别名]
import Tkinter
import Image 
import ImageTk
from Tkinter import Tk
from Tkinter import *
import os

#attendance.py Integrity! Offsite 11:30 Pings 40 50 17

master = Tk()
master.title("PyAttendance Gui")
master.iconbitmap(default='icon.ico')

master.minsize(width=300, height=100)
master.maxsize(width=1000, height=1000)

canvas = Canvas(width = 300, height = 100)
canvas.pack(expand = YES, fill = BOTH)
image = ImageTk.PhotoImage(file = "logo.gif")
canvas.create_image(20, 5, image = image, anchor = NW)


StatusLabel = Label(canvas, text="Status Name:")
StatusLabel.grid(row=0,column=0)
StatusLabel.pack()

status = Entry(canvas)
status.grid(row=0,column=1)
status.pack()

ReturnLabel = Label(canvas, text="Return Time:")
开发者ID:PSCS-Coding,项目名称:Python-Attendance,代码行数:33,代码来源:gui.py

示例7: runGui

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import iconbitmap [as 别名]
def runGui(argv):
    def bonjourmadame(argv):
        argv.common = False
        argv.space = False
        setLikeThat(argv)
        pass

    def nasa(argv):
        argv.common = False
        argv.space = True
        setLikeThat(argv)
        pass

    def laphoto(argv):
        argv.common = True
        argv.space = False
        setLikeThat(argv)
        pass

    def setLikeThat(argv):
        root = getFolder(argv)
        url = getBackgound(argv)
        setBackground(url, root)
        pass

    global mainWin
    mainWin = Tk()
    try:
        img = PhotoImage(file='icon.png')
        mainWin.tk.call('wm', 'iconphoto', mainWin._w, img)
        pass
    except Exception as e:
        iconPath = os.path.abspath('icon.ico')
        mainWin.iconbitmap(default=iconPath)
    mainWin.title("BonjourBackground")
    mainWin.geometry("300x400")
    label = Label(mainWin, text="BonjourBackground", font=("Courier", 18),
                  pady=30)
    label.pack()

    bouton = Button(mainWin, text="Bonjour Madame",
                    command=lambda: bonjourmadame(argv),
                    width=100)
    bouton.pack(pady=10, padx=10)

    bouton = Button(mainWin, text="Bonjour Madame on startup",
                    command=lambda: addStartup(argv, ""),
                    width=100)
    bouton.pack(pady=10, padx=10)

    bouton = Button(mainWin, text="NASA", command=lambda: nasa(argv),
                    width=100)
    bouton.pack(pady=10, padx=10)
    bouton = Button(mainWin, text="NASA on startup",
                    command=lambda: addStartup(argv, " --space"), width=100)
    bouton.pack(pady=10, padx=10)

    bouton = Button(mainWin, text="La photo du jour",
                    command=lambda: laphoto(argv),
                    width=100)
    bouton.pack(pady=10, padx=10)
    bouton = Button(mainWin, text="La photo du jour on startup",
                    command=lambda: addStartup(argv, "--common"),
                    width=100)
    bouton.pack(pady=10, padx=10)

    bouton = Button(mainWin, text="Fermer", command=mainWin.quit, width=50)
    bouton.pack(side=BOTTOM)
    return mainWin.mainloop()
开发者ID:kermito,项目名称:BonjourBackground,代码行数:71,代码来源:background.py

示例8: Tk

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import iconbitmap [as 别名]
import Tkinter
from Tkinter import Tk

root = Tk()
imgif = Tkinter.Image("photo", file="../data/img/icon_AddContact_np10888.gif")
imicon = "../Metadator.ico"
root.iconbitmap(imicon)
root.tk.call('wm','iconphoto',root._w,imgif)

root.mainloop()
开发者ID:Guts,项目名称:Metadator,代码行数:12,代码来源:test_windows_icon.py


注:本文中的Tkinter.Tk.iconbitmap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。