I am using wxPython. I need to be able to add and remove panels/canvases on demand, but I don't know how to refresh the entire parent frame (the base starting window). I tried fooling with the Full_Repaint option, but got no where. The method I am using, to add and (hopefully) refresh the frame, Add_Canvas(), starts at line 50. -
canvas_List = [Cone_Canvas, CubeCanvas]
-
-
class MainWindow(wx.Frame):
-
def __init__(self, parent = None, id = -1, title = "PyOpenGL Example 1"):
-
# Init
-
wx.Frame.__init__(
-
self, parent, id, title, size = (400,200),
-
style = wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE
-
)
-
-
# TextCtrl
-
# self.control = wx.TextCtrl(self, -1, style = wx.TE_MULTILINE)
-
-
#self.control = ConeCanvas(self)
-
-
box = wx.BoxSizer(wx.HORIZONTAL)
-
-
for canvas in canvas_List:
-
box.Add(canvas(self), 1, wx.EXPAND)
-
-
-
self.SetAutoLayout(True)
-
self.SetSizer(box)
-
self.Layout()
-
-
# StatusBar
-
self.CreateStatusBar()
-
-
# Filemenu
-
filemenu = wx.Menu()
-
-
# Filemenu - About
-
menuitem = filemenu.Append(-1, "Add Canvas", "Add a Canvas")
-
self.Bind(wx.EVT_MENU, self.Add_Canvas, menuitem) # here comes the event-handler
-
# Filemenu - Separator
-
filemenu.AppendSeparator()
-
-
# Filemenu - Exit
-
menuitem = filemenu.Append(-1, "E&xit", "Terminate the program")
-
self.Bind(wx.EVT_MENU, self.OnExit, menuitem) # here comes the event-handler
-
-
# Menubar
-
menubar = wx.MenuBar()
-
menubar.Append(filemenu,"&File")
-
self.SetMenuBar(menubar)
-
-
# Show
-
self.Show(True)
-
-
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
-
-
# What do I call(or can I call anything at all?) to
-
# repaint the entire frame?
-
-
def Add_Canvas(self,event):
-
canvas_List.append(Cube_Canvas)
-
Repaint_Frame() # <---- pseudo....
-
-
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
-
-
def OnExit(self,event):
-
self.Close(True) # Close the frame.
-
3 2405 dwblas 626
Recognized Expert Contributor
I do not use Wx but know that it does have a Refresh() function. Try Google for more info.
I already tried it. Nothing happened.
Nevermind....it was a namespace conflict. I had to rename the sizer, dubbed 'box', as 'self.box'. The window was refreshing without problem, but since nothing was actually being appended to the sizer, there was no visible result to confirm the update of the window and I assumed it wasn't occurring. :P But yeh...it does work. Thanks.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Hari Prasad |
last post by:
I wrote an application where I am trying to kill a parent frame with
out killing the child one.
I have created a frame (F1) and if I click a button on F1 I am
getting a new frame (F2). Now, if...
|
by: sunil philip |
last post by:
How do i get the id of parent frame ie. "page1frame2" from page2.aspx?
I have a javascript function in page2.aspx.I need to get the id without
passing 'this'.
page1.aspx
-------
<Frameset id...
|
by: nicver |
last post by:
I am working on updating a Web site with a frameset. A page opens a
pop-up window in which the user uploads pictures. Once the upload is
done, I would like to refresh the content of the frame which...
|
by: Sidorf |
last post by:
Hi there
I've build a dynamic toolbar, based on xml. this toolbarClass will be
instantiated in some aplication, i don't know for sure how many, for
the moment.
i'm looking for a way to call a...
|
by: Jeronimo Bertran |
last post by:
Hi,
I have a page with a very data intensive grid which needs to be
automatically refreshed constantly if a change is detected. In order to
not refresh the complete page so often, I created an...
| |
by: BILL |
last post by:
Hi everyone- Just want other advice as to if this is acceptable or
correct. I'm looking to refresh the owner of my popup once "close" or
"update", etc. is clicked on a popup window. I've decided to...
|
by: Amadelle |
last post by:
Hi all,
I have multiple frames which I would like to get the query string from within one of the subframes. But when I do
HttpContext.Current.Request.QueryString
or Request.QueryString
...
|
by: sasi2103 |
last post by:
Hi all,
Let's assume that I have index.html and I want to change this page.
I can use redirect of other page and put it on onLoad in the body tag but I don't want to do so.
Is there any command...
|
by: dazzler |
last post by:
How do I add "background text" into MDI parent frame, the text will be now erased if I move the MDI Parent frame, or I can also erase text with moving MDI Child frame, need to somehow refresh the...
|
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...
| |
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...
|
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,...
|
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...
|
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...
|
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...
| |