Toolbar background color

167 views
Skip to first unread message

Søren Nielsen

unread,
Feb 12, 2008, 9:22:12 AM2/12/08
to wxPytho...@lists.wxwidgets.org
Hi,

I've created a toolbar in my program, but it has a lightgray background.. which is not the same as the  GetThemeBackgroundColour() .. which I would like it to be.. I've been trying to find the command for changing the background colour of a Toolbar.. without luck..

Does anyone know how to do this?

Best,
Soren

Christopher L. Spencer

unread,
Feb 13, 2008, 2:57:04 AM2/13/08
to wxPytho...@lists.wxwidgets.org
For various introspection reasons, I need to be able to ask a
wx.TextCtrl for the value previously set in
wx.TextCtrl.SetMaxLength(). Is there any mechanism available to do
this?

I don't understand why wxWigets provides a setter for maximum length,
but not a getter.

Christoper L. Spencer
CTO ROXX, LLC
4515 Leslie Ave.
Cincinnati, OH
45242
TEL: 513-297-1260
FAX: 513-297-1280
EMAIL: ch...@roxx.biz

Raffaello Barella

unread,
Feb 13, 2008, 6:25:04 AM2/13/08
to wxPytho...@lists.wxwidgets.org, ch...@roxx.biz
Sorry, there was a mishap.

I don't understand it either, but it is like the rain: don't protest in vain, and open your umbrella.
In the actual case, I suggest you subclass wx.TextCtrl, override the method SetMaxLength() as follows:
       def SetMaxlength(self, length):
               assert length >= 0
               self.MaxLength = length
               wx.TextCtrl.SetMaxLength(self, length)

and then you build your getter:
      def GetMaxLength(self):
               return self.MaxLength

2008/2/13, Raffaello Barella <barbaros...@gmail.com>:
I don't understand it either, but it is like the rain: don't protest in vain, and open your umbrella.
In the actual case, I suggest you subclass wx.TextCtrl, override the method SetMaxLength() as follows:


2008/2/13, Christopher L. Spencer <ch...@roxx.biz>:
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-user...@lists.wxwidgets.org
For additional commands, e-mail: wxPython-...@lists.wxwidgets.org



Søren Nielsen

unread,
Feb 14, 2008, 4:38:09 AM2/14/08
to wxPytho...@lists.wxwidgets.org

Thanks for the reply Robin!

Søren Nielsen wrote:
> Hi,
>
> I've created a toolbar in my program, but it has a lightgray
> background.. which is not the same as the  GetThemeBackgroundColour() ..
> which I would like it to be..

Platform and version?

I'm using win XP and wxpython 2.7.1
 

> I've been trying to find the command for
> changing the background colour of a Toolbar.. without luck..
>
> Does anyone know how to do this?


toolbar.SetBackgroundColour(newColour)

After some searching I found that method.. but I need the default system colour (the default toolbar gray in windows), is there a way to obtain this?


Reply all
Reply to author
Forward
0 new messages