Hello Robin,
I have several panels stacked over each over, showing just one, hiding
the overs. I use wxDC::Print
Huh?
Sorry I thought that was clear, I mean wxDC::DrawText. Since the
updating of textctrl did too long, by switching the panels.
The generic wxListCtrl used on wxGTK is actually composed of a couple
separate windows, so probably the window with the focus is not the actual
wxListCtrl window but one of its children.
How can I set the focus event on this windows?
BUt how are you getting input
via a list control?
The user has just to chose between several options, the listcontrol
pops up and he can pick what he wants.
Also the switching
between the panels seems to be very slow.
You're just doing a Hide() and Show()?
Yes. And afterwards painting with wxDC::DrawText. But that dosn't
explain the flicker. By the way, if I set the font size on windows
with:
fontn=dc.GetFont()
fontn.SetPointSize(3)
dc.SetFont(fontn)
I get a readable textsize. But on linux it will be pretty small. (As
it should be at 3 points.) However, if I set the font on windows with
fonts=wxFont(10,wxMODERN,wxNORMAL,wxLIGHT)
and change the pointsize afterwards to 3 points, it will be also very
small. Why is that?
I had set the panels to
black background colour and at every refresh they also seems to take the
original grey color for a moment, causing flicker.
It may be affected by any gtk theme you have active, otherwise I'll take a
look at a small sample if you have one.
It is the standard SUSE 8.0 theme, I think.
the code is:
class basepan(wxPanel):
def __init__(self,parent):
wxPanel.__init__(self,parent,-1,pos = wxPoint(750 , 100), size = wxSize(200, 300),style = wxDEFAULT_FRAME_STYLE)
self.SetBackgroundColour(wxColour(0,0,0))
.
.
.
class vplistgrid:
def __init__(self,parent):
self.Span = basepan(self.parent)
self.Span.Show(false)
self.Bpan = basepan(self.parent)
self.Bpan.Show(false)
def showBpan(self):
self.Span.Show(false)
self.Bpan.Show(true)
self.Bpan.DrawContent() # -> just wxDC::DrawText
def showSpan(self):
self.Bpan.Show(false)
self.Span.Show(true)
self.Span.DrawContent() # -> just wxDC::DrawText
My question are:, is it a correct way to put panels above each other?
I think the "Correct" way is to use a wxNotebook. Anything else and you're
on your own.
Is it possible to hide the tabs, so that the switching between the
pages can be controlled completely by the program?
And a new question: I tried the code on win98 and had problem with the
wxGrid, it didn't show up correctly, cleared stuff stays on screen,
and it will not be updated correctly, using this code:
def __init__(self,parent):
##print 'init im vpgrid'
wxGrid.__init__(self,parent, -1,pos = wxPoint(750 , 400), size = wxSize(250, 350))
self.CreateGrid(20,3)
.
.
.
self.Clear()
self.BeginBatch()
for obj in muster:
##print obj
x,y,name,col=obj
if type(name)!='str':
name=str(name)
y=y-off
self.SetCellValue(x,y,name)
self.SetCellTextColour(x,y,col)
self.SetCellFont(x,y,font)
self.EndBatch()
self.ForceRefresh()
I do not have a panel below it, draw it directly on the frame. It
works on WinXP and a different win98 computer with a better graphic
card. Something how I could improve in the code?
thanks for the answers and wxPython
Lucian