Re: wxNotebook color change



No no!!!
Your example is OK, great!
but is not my problem:

If you set:

frame.SetBackgroundColour(wx.RED)

On unix, you can see that label "form1" and "form2" are grey, and
others elements are red.
But on Windows, on the same line of "form1" and "form2", the color is
not red, but grey as labels.

I want to color this space RED!!!

Rob Wolfe wrote:
mardif wrote:
Hi !

this is my problem:

I've a wxNotebook object, which contains 2 Panels.
On up, there is TAB section, I have 2 tabs.
I want to color the TAB section with ( for example ) red color.

I've tried with SetBackgroundColour() for wxNotebook object and for 2
panel inside, but it doesn't works.
why??

Presumably you forgot to refresh window. Try this:

<code>
import wx

app = wx.PySimpleApp()

frame = wx.Frame(None, -1, "Notebook")
nb = wx.Notebook(frame, -1)
form1 = wx.Panel(nb, -1)
nb.AddPage(form1, "Form1")
form2 = wx.Panel(nb, -1)
form2.SetBackgroundColour(wx.RED)
nb.AddPage(form2, "Form2")
nb.SetSelection(1)
frame.Refresh()
frame.Show(True)

app.MainLoop()
</code>

HTH,
Rob

.



Relevant Pages

  • Re: wxNotebook color change
    ... I've a wxNotebook object, which contains 2 Panels. ... I want to color the TAB section with red color. ... I've tried with SetBackgroundColourfor wxNotebook object and for 2 ...
    (comp.lang.python)
  • wxNotebook color change
    ... I've a wxNotebook object, which contains 2 Panels. ... I want to color the TAB section with red color. ... I've tried with SetBackgroundColourfor wxNotebook object and for 2 ... thx in advance! ...
    (comp.lang.python)
  • Re: Selecting a cell
    ... tab to the correct field and type the new number you want. ... > it into a custom label program to print price & description barcoded labels. ... > Dialogue, tab right 4 cells, type the number of labels - then CTRL-F etc. etc. ...
    (microsoft.public.excel.programming)
  • Re: How can I format label name as I loop through records?
    ... I'm using a tab control to ... > identify all the potential subform records, ... > I have created small 'marker' labels above each tab and want to make ...
    (microsoft.public.access.formscoding)
  • Re: flag notes on tab
    ... "Damon Heron" wrote: ... the labels, if you have room. ... What I'd like to be able to do is that from the main tab, ... I was able to somewhat "fix" my issue using a msgbox. ...
    (microsoft.public.access.formscoding)