Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

wxPython troubles


  • Please log in to reply
No replies to this topic

#1 Poen

Poen

  • Members
  • 14 posts
  • OFFLINE
  •  
  • Local time:07:18 PM

Posted 20 October 2009 - 03:02 PM

I've been following some tutorials online. Python is my first programming language. I've been trying to start fresh with each tutorial to minimize confusion and then o test my mastery of the language I have a separate file where I compile all I've learned and mess with it.

Anyways, I learned how to make a bitmap button, it worked in the clean version, but when I added it it did not appear. Only one of the buttons was there.

I only really liked the idea of adding an image to my program, so I started searching the web for an explanation or at least an example of how to add an image. I can't find much that will help me, so maybe some of you who are good with python could take a look and advise me? This is the program in it's working form without the bitmap button.

PS, format is funky but it works...

import wx

class pwnzorz(wx.Frame):

def __init__(self,parent, id):
wx.Frame.__init__(self,parent,id,'Windows 69:Buttsex Edition', size=(550,400))
panel=wx.Panel(self)

status=self.CreateStatusBar()
menubar=wx.MenuBar()
first=wx.Menu()
second=wx.Menu()
first.Append(wx.NewId(),"Activate Magnetic Surge","Warning: erratic bursts of magnetism may loss of data." )
first.Append(wx.NewId(),"Download some drivers","We're hoping you know nothing about drivers. If we are mistaken, please disreguard this option." )
menubar.Append(first,"File")
second.Append(wx.NewId(),"About","Windows 69:Buttsex Edition is the only operating system available exclusively for homosexuals and the bi curious." )
second.Append(wx.NewId(),"Search Online for Solutions","Windows has lost connection with both Wired and Wireless networks. What a coincidence." )
menubar.Append(second,"Help")
self.SetMenuBar(menubar)

boxx=wx.TextEntryDialog(None, "Terminal has been locked due to inactivity. Please enter your Password to proceed: ", "Windows Login Assistant", "Password")
if boxx.ShowModal()==wx.ID_OK:
answer=boxx.GetValue()

wx.StaticText(panel, -1, answer, (230,300))

box=wx.MessageDialog(None,'Did you want me to download some viruses today?','Windows Virus Acquisition Assistant',wx.YES_NO)
answer=box.ShowModal()
box.Destroy()

textbox=wx.SingleChoiceDialog(None,'You have selected Yes! To get started, choose one of the following virus options you\'d think would best reduce your machine to useless lumps of plastic and metal!', 'Welcome to the Microsoft Windows Virus Acquisition Module!',['Spam the email of my friends and family','Access and distribute my financial documents','Slowly lower the RPM of my cooling fans over the course of an hour and auto ignore temperature failure warnings','Make my computer a server that facilitates the transfer and storage of child pornography'])
if textbox.ShowModal()==wx.ID_OK:
answer=textbox.GetStringSelection()

wx.StaticText(panel, -1, "Windows has encountered a fatal error!", (50,10), (400, -1),wx.ALIGN_CENTER)

flair=wx.StaticText(panel, -1, "You have no chance to survive make your time...", (50,30), (400, -1),wx.ALIGN_CENTER)
flair.SetForegroundColour('yellow')
flair.SetBackgroundColour('black')

detail=wx.StaticText(panel, -1, "Thanks for your password, chump", (5,300), (-1, -1),wx.ALIGN_BOTTOM)
detail.SetForegroundColour('black')

button=wx.Button(panel,label="Click to continue with hard drive reformat.",pos=(150,250),size=(220,40))
self.Bind(wx.EVT_BUTTON, self.closebutton, button)
self.Bind(wx.EVT_CLOSE, self.closewindow)

def closebutton(self,event):
self.Close(True)

def closewindow(self, event):
self.Destroy()


if __name__=='__main__':
app=wx.PySimpleApp()
frame=pwnzorz(parent=None,id=-1)
frame.Show()
app.MainLoop()

BC AdBot (Login to Remove)

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users