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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:06:58+00:00 2026-06-19T03:06:58+00:00

I want to create buttons dynamically self.ctset = wx.BitmapButton(panel, -1, self.pic1, pos=(10,10), size=(50,50)) self.ctset.Bind(wx.EVT_BUTTON,

  • 0

I want to create buttons dynamically

     self.ctset = wx.BitmapButton(panel, -1, self.pic1, pos=(10,10), size=(50,50))
     self.ctset.Bind(wx.EVT_BUTTON, self.add_ct)
     self.ctset.SetDefault()

and the add_ct binding function

def add_ct(self, event):
 
    pos=(10,self.yct)
    self.yct+=65
    self.new = wx.BitmapButton(self, -1, self.pic1, pos=pos,size=(50,50))
    self.new.SetDefault()
    print "Cutset"

I don’t know where I am going wrong but my dynamically created buttons always seem disabled!

I want to bind a function to the dynamically created buttons that allows me to drag them around. Any ideas would be of great help!

I am pretty new to python and wxpython.

  • 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-19T03:06:59+00:00Added an answer on June 19, 2026 at 3:06 am

    I don’t see any code that captures the mouse’s coordinates or even any drag-and-drop code. You need to download the wxPython demo package from the wxPython website and look at the ShapedWindow example for catching mouse coordinates. See also this old thread: http://wxpython-users.1045709.n5.nabble.com/Drag-Button-around-a-Panel-td3358640.html

    In it you will find someone who is doing something very similar to what you want. I also found the following links which you might find helpful:

    • Drag button between panels in wxPython
    • How to move items smoothly in wxPython?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a panel with buttons. my buttons are create dynamically. I want to
I'm trying to create a buttons dynamically and add them to table layout panel
I want to create a layout dynamically in android which consist some buttons. But
I want to create 3 Div tags Dynamically when I press 3 different buttons
I want to create a grid view of buttons which will be created dynamically
I want to create matrix of buttons in Android dynamically for some m rows
I want to create and then destroy buttons, all with code, but can't find
I want to create a view that contains two forms with their submit buttons.
I want to create an alert box with 3 radio buttons in it. It
i want to create a form that has two submit buttons, but each one

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.