Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

wxPython(dockアイコン変更)

More than 3 years have passed since last update.

情報が少なかったのでよかったどうぞ

環境

MacBookPro(Retina, 13-inch, Early2015)
macOS Sierra version 10.12.6
Python3 3.6
wxPython 4.0.0b2
wxpython.py
# -*- coding: utf-8 -*-
#!/usr/bin/python3
import wx.adv
application = wx.App()

frame = wx.Frame(None, wx.ID_ANY, u"テストフレーム")
dock = wx.adv.TaskBarIcon(iconType=wx.adv.TBI_DOCK)
icon = wx.Icon("logo.png",wx.BITMAP_TYPE_PNG)

dock.SetIcon(icon)
frame.Show()

application.MainLoop()

TaskBarへのアイコン設定方法

wxstatusBar.py
#-*- coding: utf-8 -*-
#!/usr/bin/python3

import wx.adv


class TaskBarFrame(wx.Frame):
    def __init__(self, parent):
        wx.Frame.__init__(self, parent)

        self.taskbar = wx.adv.TaskBarIcon()
        icon = wx.Icon('logo.png', wx.BITMAP_TYPE_PNG)
        self.taskbar.SetIcon(icon, '')


app = wx.App()
frame = TaskBarFrame(None)
frame.Show()
app.MainLoop()

参考サイト
https://stackoverflow.com/questions/2822052/how-to-add-osx-menu-bar-icon-with-wxpython

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away