I try to reach a specific wx StaticText element's text and to change
it by clicking on a button
now let's say the this is my element:
wx.StaticText(panel, 15, "Hello" ,(30, 70) , style=wx.ALIGN_CENTRE)
And this is my EVT_BUTTON bind function :
def OnClick(event):
which code shude i enter to change "hello" to "goodbay"?
thanks 3 1089
On May 23, 8:24*am, Gandalf <goldn...@gmail.comwrote:
I try to reach a specific wx StaticText element's text and to change
it by clicking on a button
now let's say the this is my element:
wx.StaticText(panel, 15, "Hello" ,(30, 70) , style=wx.ALIGN_CENTRE)
And this is my EVT_BUTTON bind function :
def OnClick(event):
which code shude i enter to change "hello" to "goodbay"?
thanks
You're probably looking for SetLabel(). So if you do something like
this to instantiate the StaticText:
self.myText = wx.StaticText(panel, 15, "Hello" ,(30, 70) ,
style=wx.ALIGN_CENTRE)
Then you can change your text by adding this to your OnClick event
handler:
self.myText.SetLabel("goodbye")
Have fun! And remember, there's a great wxPython mailing list too: http://www.wxpython.org/maillist.php
Mike
On May 23, 3:29 pm, Mike Driscoll <kyoso...@gmail.comwrote:
On May 23, 8:24 am, Gandalf <goldn...@gmail.comwrote:
I try to reach a specific wx StaticText element's text and to change
it by clicking on a button
now let's say the this is my element:
wx.StaticText(panel, 15, "Hello" ,(30, 70) , style=wx.ALIGN_CENTRE)
And this is my EVT_BUTTON bind function :
def OnClick(event):
which code shude i enter to change "hello" to "goodbay"?
thanks
You're probably looking for SetLabel(). So if you do something like
this to instantiate the StaticText:
self.myText = wx.StaticText(panel, 15, "Hello" ,(30, 70) ,
style=wx.ALIGN_CENTRE)
Then you can change your text by adding this to your OnClick event
handler:
self.myText.SetLabel("goodbye")
Have fun! And remember, there's a great wxPython mailing list too:
http://www.wxpython.org/maillist.php
Mike
Thanks!
On Fri, 23 May 2008 06:40:13 -0700 (PDT), Gandalf <go******@gmail.com>
wrote:
>On May 23, 3:29 pm, Mike Driscoll <kyoso...@gmail.comwrote:
>On May 23, 8:24 am, Gandalf <goldn...@gmail.comwrote:
I try to reach a specific wx StaticText element's text and to change
it by clicking on a button
now let's say the this is my element:
wx.StaticText(panel, 15, "Hello" ,(30, 70) , style=wx.ALIGN_CENTRE)
And this is my EVT_BUTTON bind function :
def OnClick(event):
which code shude i enter to change "hello" to "goodbay"?
thanks
You're probably looking for SetLabel(). So if you do something like this to instantiate the StaticText:
self.myText = wx.StaticText(panel, 15, "Hello" ,(30, 70) , style=wx.ALIGN_CENTRE)
Then you can change your text by adding this to your OnClick event handler:
self.myText.SetLabel("goodbye")
Have fun! And remember, there's a great wxPython mailing list too:
http://www.wxpython.org/maillist.php
Mike
Thanks!
You should also note
docs.wxwidgets.org
(I tend to find that by googling "wxTreeCtrl" or whatever.)
The descriptions of various components there are more
complete than in the (excellent!) wxPython book - it's
C++ but usually not hard to figure out what the corresponding
wxPython should be.
David C. Ullrich This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Anand |
last post by:
I am calling a python script from LabVIEW. This is achieved by making
a dll call to python22.dll. It works perfectly well for most of my
code. I now want to throwup dialog boxes from python. It...
|
by: Equis Uno |
last post by:
Hi,
I'm trying to run some Python software I downloaded off of sf.net.
It's called Boa.
It uses wxPython.
It appears my install of Python cannot see my install of wxPython.
|
by: Erik Johnson |
last post by:
I am looking for some input on GUI libraries. I want to build a
Python-driven GUI, but don't really understand the playing field very well.
I have generally heard good things about wxPython. I...
|
by: Rod W |
last post by:
I'm just starting out on Python but my primary goal is to provide
applications with some user interface (GUI).
Can someone point me to a good comparison of whether I should use
wxPython (with...
|
by: KvS |
last post by:
Hi all,
I'm pretty new to (wx)Python so plz. don't shoot me if I've missed
something obvious ;). I have a panel inside a frame, on which a Button
and a StaticText is placed:
self.panel =...
|
by: OpenPavilion |
last post by:
Hello,
did anyone succeed in combining wxpython and a 3d engine (pyogre,
crystalblend, panda3d, soya etc.) ?
I would like to create an application, which uses wxpython tree, menu
and grid...
|
by: Steven W. Orr |
last post by:
python-2.3.5
wx-2.6
I just bought the wxPython In Action book and I see that all the examples
say to
import wx
All of our pre-existing code was horribly doing a
from wxPython import *
I...
|
by: python |
last post by:
I'm looking at rewriting some legacy VB applications and am pondering
which of the following techniques to use:
1. Browser based GUI with local web server (Browser +
wsgiref.simple_server) (I'm...
|
by: mistersulu |
last post by:
Hi all:
I'm using a wx.ListView object with a multi-threaded wxPython app.
The list is dynamically generated and accessed across two or more
threads. In spite of the fact that I have checks to...
|
by: gooli |
last post by:
The best thing I've found until now is XRCed. It has it's quirks and
pitfalls, but it fits the bill. Personally I prefer the previous version
(the one that comes with wxPython 2.8.6) and don't...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |