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

  • Home
  • SEARCH
  • 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 7710893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:14:14+00:00 2026-06-01T01:14:14+00:00

import wx class bucky(wx.Frame): # Creating the outer window/frame def __init__(self,parent,id): wx.Frame.__init__(self,parent,id,’Karls Network Tool’,

  • 0
import wx

class bucky(wx.Frame):

    # Creating the outer window/frame
    def __init__(self,parent,id):
        wx.Frame.__init__(self,parent,id,'Karls Network Tool', size=(900,700))
        panel=wx.Panel(self, -1)

        # Exit Button
        button=wx.Button(panel,label="Exit",pos=(840,580),size=(40,40))

        # Close event for exit button
        self.Bind(wx.EVT_BUTTON, self.closebutton, button)
        self.Bind(wx.EVT_CLOSE, self.closewindow)

        # Network Topology Area - User can map a network
        wx.TextCtrl(panel, -1, pos=(10,40), size=(525, 400)) # Network topology Panel

        # Creating the bitmap buttons - Images appear on buttons 
        buttonOneRouter=wx.Image("router.bmp", wx.BITMAP_TYPE_BMP).ConvertToBitmap()
        self.buttonRouter=wx.BitmapButton(panel, -1, buttonOneRouter, pos=(20,580))

Ok so I have my Frame working as I would expect set at the size I need, I also have my exit button which works as expected etc etc….. So as we can see the general program is working fine. All I want todo now is have the program do the following:

  • When a user clicks on the buttonOneRouter which as you would expect is a button within my frame with a picture of a router on. The router image that is used on the button and stored in my Python directory should appear in the TextCtrl – network topology area.

-Taking this a step forward, if its possible I would then want to be able to drag this small image which has appeard in the TextCtrl within this area so the user can create their simulated network.

I understand that this should be pretty simple, as all I have to really do is create an event to assign to the button, but I dont no were to even begin. Any pointers?

  • 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-01T01:14:15+00:00Added an answer on June 1, 2026 at 1:14 am

    Here is what I think you should do:

    write init method which also takes image as your argument that you will be using for for textctrl background.

    In your case, it will be:

    def __init__(self,parent, id, image)
    

    Create your own app class and create image object on you OnInit method:

    def OnInit(self):
    
       image=wx.Image('your_image.jpg',wx.BITMAP_TYPE_JPEG)
       self.frame=bucky(image)
    

    Rest of the process are as same as you do other things.

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

Sidebar

Related Questions

import wx class MainFrame(wx.Frame): def __init__(self,parent,title): wx.Frame.__init__(self, parent, title=title, size=(640,480)) self.mainPanel=DoubleBufferTest(self,-1) self.Show(True) class DoubleBufferTest(wx.Panel):
Given the following simple program: import wx class TestDraw(wx.Panel): def __init__(self,parent=None,id=-1): wx.Panel.__init__(self,parent,id,style=wx.TAB_TRAVERSAL) self.SetBackgroundColour(#FFFFFF) self.Bind(wx.EVT_PAINT,self.onPaint)
#!/usr/bin/python # -*- coding: iso-8859-1 -*- import Tkinter import twitter class simpleapp_tk(Tkinter.Tk): def __init__(self,parent):
#!/usr/bin/python # -*- coding: iso-8859-1 -*- import Tkinter class simpleapp_tk(Tkinter.Tk): def __init__(self,parent): Tkinter.Tk.__init__(self,parent) self.parent=parent
from Tkinter import * class StatusBar(Frame): def __init__(self, master): Frame.__init__(self, master) self.label = Label(self,
from TKinter import * class Ui(Frame): def __init__(self) Frame.__init__(self, None) self.grid() bquit=Button(self, text=Quit, command=self.quit_pressed)
Having a snippet like this: import yaml class User(object): def __init__(self, name, surname): self.name=
here is some code: from Tkinter import * class Main(object): def __init__(self): self.console =
import time import threading class test(threading.Thread): def __init__ (self): threading.Thread.__init__(self) self.doSkip = False self.count
I have the following Python (3.2) code: from pygame import * class Application: def

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.