Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7913753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:54:59+00:00 2026-06-03T13:54:59+00:00

This source code class MyToolBar(wx.ToolBar): def AddTool2(self, id, shortHelp = ”, longHelp = ”):

  • 0

This source code

class MyToolBar(wx.ToolBar):
  def AddTool2(self, id, shortHelp = '', longHelp = ''):
    global TB_SIZE
    try:
      ArtId = ArtMap.get(id)
      Ico = wx.ArtProvider.GetBitmap(ArtId, wx.ART_TOOLBAR, TB_SIZE)
      self.AddSimpleTool(id, Ico, shortHelp, longHelp)
    except StandardError:
      print('Something wrong, maybe wrong id')

Class MyFrame(wx.Frame):
  def __init__(self, parent, *args, **kwargs):
    wx.Frame.__init__(self, parent, *args, **kwargs)

    ToolBar = MyToolBar(self)
    ToolBar.AddTool2(wx.ID_NEW, 'New', 'Creates new file')
    self.SetToolBar(ToolBar)
    self.GetToolBar().Realize()


ArtMap = { wx.ID_NEW : wx.ART_NEW,
          }
ID_BOUNCE = wx.NewId()
TB_SIZE = wx.Size(16,16)

app = wx.app()
frame = MyFrame(None, -1, 'MyFrame', (0,0))
app.MainLoop()

works well for adding tools to toolbar when the tool has a wx.ART. But how do you add a new tool that have no wx.ART or no wx.ART that can represent it well like the ID_BOUNCE where the tool Bounce is suppose to make a ball bounce in the frame?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:55:00+00:00Added an answer on June 3, 2026 at 1:55 pm

    wx.ToolBar has AddLabelTool method with a bitmap parameter.
    Find an example over at zetcode.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this source code: idx=0 b=plt.psd(dOD[:,idx],Fs=self.fs,NFFT=512) B=np.zeros((2*len(self.Chan),len(b[0]))) B[idx,:]=20*log10(b[0]) c=plt.psd(dOD_filt[:,idx],Fs=self.fs,NFFT=512) C=np.zeros((2*len(self.Chan),len(b[0]))) C[idx,:]=20*log10(c[0]) for idx
I have a Tomcat application server and this Java source code: public class MyServlet
I have this source code at the moment, but the issue I am having
I have this source code from 2001 that I would like to compile. It
I'm trying include this barcode source code Stefanhafeneger - Barcode github.com to my project
I'm reading this C++ open source code and I came to a constructor but
I have a problem with one JSF page. This is the source code: <!DOCTYPE
I'm new in ASP development. This is my source code : ident = request.Form(ident)
This is the complete source code: http://www.sendspace.com/file/lwxpyf I have a problem with a JSF
I have some C++ source code with templates maybe like this - doxygen runs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.