471,073 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

help with wxSlider & wxPython

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_WINDOW without success)?

import os
from wxPython.wx import *
ID_ABOUT=101
ID_EXIT=110
class MainWindow(wxFrame):
def __init__(self,parent,id,title):
wxFrame.__init__(self,parent,wxID_ANY, title, size = (
800,600),style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REP AINT_ON_RESIZE)
#self.control = wxTextCtrl(self, 1, style=wxTE_MULTILINE)
wxStaticText(self, -1, "Distance to Move", (30, 40))
slider = wxSlider(self, 100, 25, 0, 3600, (30, 60), (400,
-1),wxSL_HORIZONTAL | wxSL_TOP | wxSL_AUTOTICKS | wxSL_LABELS |
wxTRANSPARENT_WINDOW)
slider.SetTickFreq(1, 1)
slider.SetValue(1800)
self.CreateStatusBar() # A StatusBar in the bottom of the
window
# Setting up the menu.
filemenu= wxMenu()
filemenu.Append(ID_ABOUT, "&About"," Version 001")
filemenu.AppendSeparator()
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.SetBackgroundColour(wxWHITE)
self.Show(true)
self.Center(wxBOTH)
def OnAbout(self,e):
d= wxMessageDialog( self, "test","About 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

Jul 18 '05 #1
0 1090

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by flupke | last post: by
7 posts views Thread by Pajo | last post: by
10 posts views Thread by Mario | last post: by
5 posts views Thread by linuxfreak | last post: by
5 posts views Thread by Gilles DRIDI | last post: by
16 posts views Thread by PyDenis | last post: by
2 posts views Thread by nelson | last post: by
5 posts views Thread by MatthewWarren | last post: by
1 post views Thread by Eric von Horst | last post: by

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.