Hi,
I just started coding with wxPython. The idea is to be able to change the gui dynamically. I am trying to change the static text inside the panel after the panel is created without user input/interaction, and I am not very successful with it. Below is my codes: -
import wx
-
-
class MyForm (wx.Panel):
-
def __init__ (self, parent, id):
-
wx.Panel.__init__(self, parent, id)
-
self.info = wx.StaticText (self, 10, "This is my first text", wx.Point (10, 10))
-
-
def changeStaticText (self, newText):
-
self.info.SetLabel (newText)
-
-
-
app = wx.PySimpleApp()
-
frame = wx.Frame (None, -1, "Fun with wxPython")
-
myForm = MyForm (frame, -1)
-
frame.Show (True)
-
app.MainLoop()
-
-
# Change the text dynamically after the panel is created.
-
myForm.changeStaticText ("NEW line of text")
-
-
Is anyone can tell me what I have done wrong here. Thanks in advance.
0 1150 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Robert |
last post by:
Hello list,
could somebody point me to a good reference about wxPython event handling?
I have seen many examples but which one is the best. Waht are the advantages
and disadvantages?
Can you also have a short look at the example below and give me some
comments, please?
Example:
|
by: SeeBelow |
last post by:
Do many people think that wxPython should replace Tkinter? Is this
likely to happen?
I ask because I have just started learning Tkinter, and I wonder if I
should abandon it in favor of wxPython.
Mitchell Timin
--
"Many are stubborn in pursuit of the path they have chosen, few in
|
by: mdk.R |
last post by:
Hello all:
i'am installed wxPython 2.5 and Python2.3.4..i try execute script
with wxPython but it show error:
Traceback (most recent call last):
File "E:\py\test.py", line 7, in ?
import wx
File "E:\py\wx.py", line 10, in ?
from wxPython.wx import *
File "D:\Python23\Lib\site-package
import _wx
|
by: Jared Russell |
last post by:
I've recently decided to try my hand at GUI programming with wxPython,
and I've got a couple questions about the general conventions regarding
it.
To mess around with it, I decided to create a small app to check my
Gmail. I want something that will just sit in my system tray checking
for new emails every ten minutes or so. As such, I have no need for an
actual window anywhere. So I'm wondering if I should still use a Frame
or not. ...
|
by: zxo102 |
last post by:
Hi everyone,
I am using a python socket server to collect data from a socket
client and then control a image location ( wxpython) with the data,
i.e. moving the image around in the wxpython frame.
But the "app.MainLoop()" in wxpython looks like conflicting with
the "while 1:" in socket server. After I commented the
"app.MainLoop()", everything is working except two things:
1. if I click anywhere on the screen with the mouse, the image is...
| |
by: dynamo |
last post by:
Hi everyone.I'm new to wxpython.And i have a little problem.I tried to run the following wxpython app code in IDLE for python25:
import wx
import os
import re
def z(a):
for i in range(1,13):
return i*a
class Mine(wx.Frame):
def __init__(self,parent,id,title,pos,size,):
|
by: defireman |
last post by:
Hi,
Sorry for asking a newbie question, but I am currently using wxPython 2.6, and I don't know how to get the properties of an event object in wxPython when handling events. Is there some sort of documentation that I can use?
for example:
def OnEvent(self, event):
#code here
I would like to see a list of all properties for that event. How would I do this? (I searched for quite a bit, but I can't seem to find good...
|
by: Jimmy |
last post by:
hi, all
I'm having a problem with creating custom events in wxpython.
I have a class A handling some data processing work and another class
B of GUI matter. I need GUI to display information when data in A is
updated.
I know cutom events in wxpython may work. But I found no material
paricularly
helpful :(
|
by: Andrea Gavana |
last post by:
Hi Diez & All,
Do you mind explaining "why" you find it *buttugly*? I am asking just
out of curiosity, obviously. I am so biased towards wxPython that I
won't make any comment on this thread in particular, but I am curious
to know why some people find it "ugly" or "bad" or whatever. It has
its own bugs and missing features, of course, but it is one of the
major GUI player in the arena, together with PyQt and PyGTK.
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |