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 7798983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:09:42+00:00 2026-06-02T00:09:42+00:00

OK, so iv almost completed my program for my project but I cant get

  • 0

OK, so iv almost completed my program for my project but I cant get a BUTTON_EVT to work which if i am honest should be the easiest thing todo. I have the buttons on my program which represent the hardware and I have created a def function for them to appear on the OGL canvas.

  • Problem has been solved… The code associated with the problem is found in the answer below
  • 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-02T00:09:43+00:00Added an answer on June 2, 2026 at 12:09 am

    Edited from your last comment. Use this (using your own images):

    def OnClickRouter(self, event):
        image=wx.Image('cat.jpg', wx.BITMAP_TYPE_JPEG)
        self.frame = bucky(None, image)
        self.frame.Show()
    

    If you call bucky() this way you must also fix the class signature:

    class bucky(wx.Frame):      
      # Creating the outer window/frame
      def __init__(self, parent, image=None):
        wx.Frame.__init__(self, parent, -1,'Karls Network Tool', size=(900,700))
    
        my_image = image if image else wx.Image("myself.bmp", wx.BITMAP_TYPE_BMP) 
    
        ''''''''''''''''''''''''''''''''
        # Button images
        buttonOneRouter = my_image.ConvertToBitmap()
        self.buttonOneRouter = wx.BitmapButton(panel, -1, buttonOneRouter, pos=(20,340))
        self.buttonOneRouter.Bind(wx.EVT_BUTTON, self.OnClickRouter)
        ''''''''''''''''''''''''''''''''
    

    Then you can see that after clicking the buttonOnerouter what actually you are doing is opening a new frame. The left figure is what I get when I run the program, the right one is after I click and enter again my name (I simplified a bit your code. Thats why you only see one button at the bottom instead of 4):

    enter image description here

    If you want to put my cat in the canvas instead of in the button there is still some work to do. I recommend to you to give a look at the wxPython demo. In the miscellaneous group of examples you have one called OGL that shows how to do that.

    Edit: You can download the wxPython docs and demos package from here

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

Sidebar

Related Questions

I am making an installer in java swing it almost completed only one thing
I'm starting a new project which would greatly benefit from program add-ons. The program
I was trying to solve Project Euler problem 10 using python, but my program
i learning CFNetwork , socket, i almost completed. But, I want to use UIImageView,
I am writing an assignment in MASM32 Assembly and I almost completed it but
I am making my own installer and it's almost complete. The only thing lacking
Almost any mature program that involves text implements double click to select the word
In almost all of my projects I have few files that are project wide
Greetings all, I’m working on a C# program that requires being able to get
I have a program which needs to turn many large one-dimensional numpy arrays of

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.