top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to change scrollbar color in pygtk ?

+1 vote
855 views

I Tried the below code, the color is not reflected, Am i missing something?

#add description box beside test cases
    testCaseDescWindow = gtk.ScrolledWindow()
    testCaseDescWindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
    testCaseDescWindow.get_vscrollbar().modify_fg(gtk.STATE_NORMAL,gtk.gdk.color_parse('#40515F'))
    testCaseDescWindow.get_hscrollbar().modify_fg(gtk.STATE_NORMAL,gtk.gdk.color_parse('#40515F'))
posted Aug 21, 2013 by Sanjay D Raju

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
The modify_fg() method sets the foreground color to the widget(scrollbar in your case only in the specified state i.e. STATE_NORMAL) what is the version you are using, any more information would be useful.
What is the version of pygtk
Im using python 2.6.6 and pygtk 2.0

1 Answer

+1 vote

You are setting the foreground color which GtkScrollbar probably does not use.

You could try to use GtkCssProvider and check which property is the correct to modify (see http://worldofgnome.org/making-gtk3-themes-part-2-the-gtk-css-and-gtk-widgets-css-files/ for list of properties)

answer Aug 26, 2013 by anonymous
Similar Questions
+2 votes

I have a Tkinter app that can optionally label some buttons with certain Unicode glyphs that aren't always available (depending on the OS, etc.).

When they aren't available, Tkinter renders them as "uNNNN". What I'd like to do is check whether the glyphs are available, and fall back to my own alternate text for the button if not. Can I do this?

I'd also like to do the same in pygtk.

+1 vote

I tried the following code.But its not working.

html {scrollbar-face-color:#D6D7D6 ;
scrollbar-shadow-color: #FFFFFF;
scrollbar-highlight-color:#EFEFEF;
scrollbar-3dlight-color: #FFFFFF;

scrollbar-track-color: #FFFFFF;
scrollbar-arrow-color:  #000000;}
0 votes

I want to create a random float array of size 100, with the values in the array ranging from 0 to 5. I have tried random.sample(range(5),100) but that does not work. How can i get what i want to achieve?

+2 votes

I'm trying to access Apples iCal-Server on a Mac OS X Snow Leopard Server via Python. The server is up and running and working with it via the iCal-Application is just fine. Now I need to access this server via Python to use it as backend for resource planning.

So how can I read the events within a time range from a user's calendar using python?

+2 votes

How we can send mail with attachment in Python? Is it any prerequisite for it?

...