0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

wxPython(dockアイコン変更)

Last updated at Posted at 2017-12-22

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

環境

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

0
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?