[pygtk] Improving pygtk appearance, or moving to wxPython?
JUAN ERNESTO FLORES BELTRAN
juanernestof at hotmail.com
Mon May 8 20:34:03 WST 2006
thanks a lot!!!
very helpfull!!! i will get the desired appeareance any computer this
way....
thanks paul!!
Juan
>From: Paul Malherbe <paul at tartan.co.za>
>To: JUAN ERNESTO FLORES BELTRAN <juanernestof at hotmail.com>
>Subject: Re: [pygtk] Improving pygtk appearance, or moving to wxPython?
>Date: Sat, 06 May 2006 10:50:55 +0200
>
>JUAN ERNESTO FLORES BELTRAN wrote:
> > hi you guys,
> >
> > no doubt...i will follow your instructions and i will just change the
> > theme...i did find some icons and figures wich are going to help me
> > too...
> >
> > thanks for your patience, and i am sorry for being so insistent about
> > this issue...
> >
> > Regards :-)
> >
> > Juan
> >
> >
> >
>Hi Juan
>
>I have written a small routine to show you that you can change the theme
>for your application.
>
>This only changes the theme of your application and not the system.
>
>
>I hope it helps.
>
>regards, Paul
>
>#!/usr/bin/python
>
>import os,sys
>import pygtk
>#This is needed for py2exe
>if sys.platform != "win32": pygtk.require("2.0")
>import gtk
>
>window = gtk.Window()
>window.connect("destroy", gtk.main_quit)
>
># Set the theme you want for your application
>thmdir = gtk.rc_get_theme_dir()
>theme = os.path.join(thmdir, "Grand-Canyon", "gtk-2.0", "gtkrc")
>if os.path.exists(theme): style = "include '%s'\n" % theme
>else: style = ""
>
># Here you can change any of the individual widget characteristics
># as well as default fonts, colours etc.
>style = style + """
>style "mystyle"
>{
> font_name = "%s"
> GtkWidget::interior_focus = 1
>}
>widget "*" style "mystyle"
>
>style "mymenu"
>{
> font_name = "%s"
>}
>widget "*Menu*" style "mymenu"
>""" % ("Courier 10", "Arial 10")
>
># Apply this theme to your app
>gtk.rc_parse_string(style)
>
>button = gtk.Button(theme)
>button.connect("clicked", gtk.main_quit)
>window.add(button)
>window.show_all()
>gtk.main()
More information about the pygtk
mailing list