Re: wxNotebook color change




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
    ... not red, but grey as labels. ... 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: Panels !!!!!!
    ... Thay are changed by checkboxes and combobox. ... Now look at the panels Bookmarks and Pages in Abobe Acrobact Reader. ... NOT this checkboxes that act like raido buttons on the VIEW ribbon tab. ... LINKS for the 2007 Office System ...
    (microsoft.public.word.docmanagement)
  • Re: RequiredFieldValidators and user control required fields?
    ... If you'd used panels so that the various ... The required field validators all have an enabled property when created ... I'm using .NET 1.1 and wondering if I can use RequiredFieldValidators with ... Depending on which tab panel is visible upon the submit, ...
    (microsoft.public.dotnet.framework.aspnet)
  • swing widgets: Whos got the focus?
    ... I am using panels with etched and titled borders to group my bits and ... set of widgets I am working with ... And it seems I cannot use tab to put the focus to the next widget. ...
    (comp.lang.java.help)