Dear friends,
First of all , i wish a Happy New Year to all of you!!!!
I have been learning Python and the Tkinter GUI package for the last 6 months ,
and now i am trying to rewrite a program i made using the wxPython package.
I have a toolbar , a panel ( on which all the 'action' takes place ) ,and a status bar.
My question is , how do i delete and then redraw the panel? Here is an example of the code i use: -
# -*- coding: cp1253 -*-
-
from wxPython.wx import *
-
import wx
-
-
-
class ApplicationFrame(wxFrame):
-
def __init__(self, parent, ID, title):
-
wxFrame.__init__(self, parent, ID, title,
-
wxDefaultPosition, wxSize(720, 450))
-
self.CreateStatusBar()
-
self.SetStatusText(u" StatusBar : Σύντομη περιγραφή της υπό επιλογή λειτουργίας")
-
toolbar1 = self.CreateToolBar( wx.TB_HORIZONTAL | wx.TB_TEXT | wx.BORDER_DOUBLE)
-
toolbar1.SetToolBitmapSize((70,63))
-
toolbar1.SetBackgroundColour("#d5ab6c")
-
toolbar1.AddSimpleTool(10, wx.Bitmap('Apothiki_Button.gif'),u" Αποθήκη ",u" Άνοιγμα καταλόγου αποθήκης")
-
toolbar1.AddSimpleTool(20, wx.Bitmap('Pelates_Button.gif'),u" Πελάτες ",u" Άνοιγμα καταλόγου πελατών")
-
toolbar1.AddSimpleTool(30, wx.Bitmap('Promitheftes_Button.gif'),u" Προμηθευτές ",u" Άνοιγμα καταλόγου προμηθευτών")
-
toolbar1.AddSimpleTool(40, wx.Bitmap('Exit_Button.gif'),u" Έξοδος ",u" Έξοδος από το πρόγραμμα")
-
toolbar1.Realize()
-
EVT_MENU(self,40,self.TimeToQuit)
-
EVT_MENU(self,20,self.Pelates)
-
EVT_MENU(self,30,self.ChangeColour)
-
self.panel=wx.Panel(self,id=50,style=wx.BORDER_SUNKEN,name=" My Panel")
-
self.panel.SetBackgroundColour("red")
-
self.panel.Show()
-
self.panel.Bind(EVT_LEFT_DCLICK,lambda event:self.panel.SetBackgroundColour("blue"))
-
-
-
def ChangeColour(self,event):
-
self.panel.SetBackgroundColour("skyblue")
-
self.panel.Refresh(true)
-
-
def Pelates ( self,event):
-
pass
-
-
def TimeToQuit(self, event):
-
self.Close(true)
-
-
-
class MyApp(wxApp):
-
def OnInit(self):
-
frame = ApplicationFrame(NULL, -1, "Midas wx_Python")
-
frame.Show(true)
-
self.SetTopWindow(frame)
-
return true
-
-
app = MyApp(0)
-
app.MainLoop()
As you can see , i try both ways to change the colour of the panel , but none of
them works properly. I have noticed that with the Bind method , the panel gets refreshed when i drag and move on it another window from my desktop.
I am using Python 2.5.1 on Windows Vista.
Thank you all in advance!!!!
Elias
1 2221
Puzzle solved!!!!
No need to answer this post!!
Elias
Sign in to post your reply or Sign up for a free account.
Similar topics
by: justin__devine |
last post by:
I have a quick question here is my widget it is a Radiobox.
rb = wx.RadioBox(
self, -1, "Quick Sites", (10, 215), (425, 70),
labellist, 5, wx.RA_SPECIFY_COLS
)
self.rb = rb
later on in the...
|
by: LRD |
last post by:
Form not refreshing after autopostback unless keyboard or mouse move
Hi,
We created several new ASP.NET C# forms for our intranet. In each form we
use panels for different sections of the...
|
by: Seansan |
last post by:
Hi,
Does anyone know how I can disable the click sound that is heard when a
IFRAME is reloaded?
I use javascript to reload an IFRAME every minute or so and I keep hearing
this "click".
thx...
|
by: Greg Scharlemann |
last post by:
Given some recent success on a simple form validation (mainly due to
the kind folks in this forum), I've tried to tackle something a bit
more difficult. I'm pulling data down from a database and...
|
by: evanburen |
last post by:
When a user clicks the "Close Panel Manager" link on page2.htm I would
like page1.htm to be refreshed without losing the address in
browser1/page1.htm. Page2.htm is a child popup from parent...
|
by: evanburen |
last post by:
I use this code in a popup to refresh the parent browser. It works fine
as long as the user actually clicks on this link but does not work in
cases where the user closes the child popup through the...
|
by: Monty |
last post by:
Sometimes, after designing for over an hour or so, I notice that when I
have selected an object, like a panel or really just anything, the
properties with not refresh to show its details. Closing...
|
by: Mark Denardo |
last post by:
This is related to another post I submitted, but I'll be more precise this
time.
I have a web page that contains an Image webcontrol that loads its image by:
Image1.ImageUrl="<username>.jpg",...
|
by: Cecco |
last post by:
Hi everybody,
I just made a simple control called clock for including a "windows sidebar
modern clock" in my applications.
It works fine but there some "flashing effect" when the control...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
| |