473,379 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

HOWTO: Set Main Application Font in PyGTK

This was a tough one (at least for me), and wasn't exactly what I
wanted when I was working on just setting on item's font, but shows
how you can change the font for an entire PyGTK application. I
stumbled on to it by accident.

Once you have your widget as, say, variable 'w', do this:

w.get_settings().set_string_property('gtk-font-name', 'sans normal
9','');
# some other font choices are:
# courier bold 10
# serif oblique 12
# you get the idea?

....I know, I know, it doesn't make sense to me either, but once you
attempt this on any widget in your project, the whole project changes
its fonts. At least it does with my project. Note I did my project in
Glade as one big Glade XML file, then loaded it in with PyGTK. I have
RH9 Linux and I'm using the defaults with that, which I think is
PyGTK2, Python 2.2, and Glade 2.

Anyway, I hope this helps you. Now if anyone knows how to change the
font and size on a single radio button in PyGTK, I welcome the
suggestion. I don't think it can be done.
Jul 18 '05 #1
3 4902
P
Google Mike wrote:
if anyone knows how to change the
font and size on a single radio button in PyGTK, I welcome the
suggestion. I don't think it can be done.


You have read section 4 of the FAQ haven't you?
http://www.async.com.br/faq/pygtk/index.py?req=index

Pádraig.
Jul 18 '05 #2
> You have read section 4 of the FAQ haven't you?
http://www.async.com.br/faq/pygtk/index.py?req=index

Pádraig.


This was extremely useful and had much more information that I found
useful than I expected! Why hadn't I known about it sooner?? :)
Jul 18 '05 #3
Unfortunately, Pádraig, the main font change is the /only/ way to
change the font on a radio button item. The FAQ also mentions that
this is one of those things that cannot be changed individually.
However, the rest of the FAQ was very enlightening and helped me
complete my project, which was a user-friendly GUI front-end for
PostgreSQL that's way better than phpAdmin III.
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or...
4
by: j_mckitrick | last post by:
Hi all. Here is a tiny container for one of each combo box, along with the glade file. Just 2 widgets, so hopefully not too large. How the heck do I get the selection from the ComboBox, as...
6
by: Mark Mitchell | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I have a program written in python that tells me it requires PyGTK, so I DLed, ./configure, make, make install and the process seems to go ok. Some...
5
by: Egbert Bouwman | last post by:
As a newby to PyGTK I already have produced some gui's I like, but I have difficulties in finding out what method or other instrument I need for doing various things. I have not yet found the...
1
by: Henry | last post by:
I was trying to work through the Lab 2 exercises in the Microsoft's Windows-Based Applications in Visual C#. While I am not showing any errors I am also not seeing the mainMenu object when I run...
1
by: BillZondlo | last post by:
Can someone look at this and tell me why, when I call this from my main app, it displays fine (fades form in and out) but then before my main app displays, I see other dialog boxes flash...
3
by: # Cyrille37 # | last post by:
Hello, Font.Size Property is readonly. How can I change the Size of a Font ??? Thanks for your help cyrille
7
by: james_027 | last post by:
Hi, I am using delphi to develop gui application, and wish to make a shift to python. here are some of my question/concern... 1. is python develop gui application a cross platform? just like...
1
by: krishnakant Mane | last post by:
hello, I will be writing some code in PyGTK to run on linux. but I want to know if there are any installers or distutils available for PyGTK on windows? I have heard that installing gimp or even...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.