473,385 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

wxNotebook color change

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??

thx in advance!

bye

Aug 31 '06 #1
3 3206

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

Aug 31 '06 #2
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
Aug 31 '06 #3

mardif wrote:
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!!!
Oh, I see now. I don't know if that is possible on windows.
SetBackgroundColour works differently on windows than on unix,
so probably native windows widget doesn't support this feature.
(but I can be wrong of course.)

Regards,
Rob

Aug 31 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gandalf | last post by:
How can I hide/show a page (wxNotebookPage) invisible of a wx.wxNotebook instance? There is a GetPage() method which returns a wxNotebookPage but I could not find any documentation in the help...
1
by: phark52 | last post by:
I have a wxFrame. On it is a wxNotebook, the Notebook ctrl has 5 tabs (Each one is a wxPanel.) On one of the tab pages (panels) I want to add another notebook ctrl. I get no errors but nothing...
4
by: support.services.complaints | last post by:
Ok i have a wxFrame with a wxNotebook that has two wxPanels, lets call them panel_1 and panel_2 i have wxTextCtrl in panel_1 (call it panel_1_ctrl) that i want the user to be able to fill up. I...
18
by: Jan Tuxen | last post by:
Jakob Nielsen in his most recent Alertbox (http://www.useit.com/alertbox/20040503.html) tells web authors to change the color of visited links. I agree to his purpose: Help users understand...
5
by: AFN | last post by:
I'm trying to set a submit button to change text and color when clicked. Like saying "please wait" instead of "submit" and then changing the background color and text color. All works, except for...
0
by: klaus.roedel | last post by:
Hi, I've implemented a wxnotebook on my application. I can set a tooltip for the complete notebook, but I want to set for every page a tooltip, so that the user can get additionally information...
3
by: Roger | last post by:
Is this an easy thing to change? I want to put an option button on a form and want to dynamically change the color (Red, Yellow, Green) for showing a status. I figured it would be an easy task,...
6
by: Joe | last post by:
I want to fade a color to another color in a user control. Actually the color is the BackColor of the User control. What's the easiest way to do this? Thanks, Joe
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
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...
1
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...
0
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.