I have the code below. I have changed the background of the frame to
white, but I cannot get the wxSlider to not be the ugly gray color.
Can someone tell me how to change it to a transparent background (I
tried wxTRANSPARENT_W INDOW without success)?
import os
from wxPython.wx import *
ID_ABOUT=101
ID_EXIT=110
class MainWindow(wxFr ame):
def __init__(self,p arent,id,title) :
wxFrame.__init_ _(self,parent,w xID_ANY, title, size = (
800,600),style= wxDEFAULT_FRAME _STYLE|wxNO_FUL L_REPAINT_ON_RE SIZE)
#self.control = wxTextCtrl(self , 1, style=wxTE_MULT ILINE)
wxStaticText(se lf, -1, "Distance to Move", (30, 40))
slider = wxSlider(self, 100, 25, 0, 3600, (30, 60), (400,
-1),wxSL_HORIZON TAL | wxSL_TOP | wxSL_AUTOTICKS | wxSL_LABELS |
wxTRANSPARENT_W INDOW)
slider.SetTickF req(1, 1)
slider.SetValue (1800)
self.CreateStat usBar() # A StatusBar in the bottom of the
window
# Setting up the menu.
filemenu= wxMenu()
filemenu.Append (ID_ABOUT, "&About"," Version 001")
filemenu.Append Separator()
filemenu.Append (ID_EXIT,"E&xit "," Terminate the program")
# Creating the menubar.
menuBar = wxMenuBar()
menuBar.Append( filemenu,"&File ") # Adding the "filemenu" to the
MenuBar
self.SetMenuBar (menuBar) # Adding the MenuBar to the Frame
content.
EVT_MENU(self, ID_ABOUT, self.OnAbout) # attach the menu-event
ID_ABOUT to the
EVT_MENU(self, ID_EXIT, self.OnExit) # attach the menu-event
ID_EXIT to the
self.SetBackgro undColour(wxWHI TE)
self.Show(true)
self.Center(wxB OTH)
def OnAbout(self,e) :
d= wxMessageDialog ( self, "test","Abo ut test", wxOK)
d.ShowModal() # Shows it
d.Destroy() # finally destroy it when finished.
def OnExit(self,e):
self.Close(true ) # Close the frame.
app = wxPySimpleApp()
frame = MainWindow(None , -1, "test")
app.MainLoop()
TIA,
Scott
white, but I cannot get the wxSlider to not be the ugly gray color.
Can someone tell me how to change it to a transparent background (I
tried wxTRANSPARENT_W INDOW without success)?
import os
from wxPython.wx import *
ID_ABOUT=101
ID_EXIT=110
class MainWindow(wxFr ame):
def __init__(self,p arent,id,title) :
wxFrame.__init_ _(self,parent,w xID_ANY, title, size = (
800,600),style= wxDEFAULT_FRAME _STYLE|wxNO_FUL L_REPAINT_ON_RE SIZE)
#self.control = wxTextCtrl(self , 1, style=wxTE_MULT ILINE)
wxStaticText(se lf, -1, "Distance to Move", (30, 40))
slider = wxSlider(self, 100, 25, 0, 3600, (30, 60), (400,
-1),wxSL_HORIZON TAL | wxSL_TOP | wxSL_AUTOTICKS | wxSL_LABELS |
wxTRANSPARENT_W INDOW)
slider.SetTickF req(1, 1)
slider.SetValue (1800)
self.CreateStat usBar() # A StatusBar in the bottom of the
window
# Setting up the menu.
filemenu= wxMenu()
filemenu.Append (ID_ABOUT, "&About"," Version 001")
filemenu.Append Separator()
filemenu.Append (ID_EXIT,"E&xit "," Terminate the program")
# Creating the menubar.
menuBar = wxMenuBar()
menuBar.Append( filemenu,"&File ") # Adding the "filemenu" to the
MenuBar
self.SetMenuBar (menuBar) # Adding the MenuBar to the Frame
content.
EVT_MENU(self, ID_ABOUT, self.OnAbout) # attach the menu-event
ID_ABOUT to the
EVT_MENU(self, ID_EXIT, self.OnExit) # attach the menu-event
ID_EXIT to the
self.SetBackgro undColour(wxWHI TE)
self.Show(true)
self.Center(wxB OTH)
def OnAbout(self,e) :
d= wxMessageDialog ( self, "test","Abo ut test", wxOK)
d.ShowModal() # Shows it
d.Destroy() # finally destroy it when finished.
def OnExit(self,e):
self.Close(true ) # Close the frame.
app = wxPySimpleApp()
frame = MainWindow(None , -1, "test")
app.MainLoop()
TIA,
Scott