I want my widget to look exactly like it does now, except to be smaller. It includes buttons, labels, text, images, etc. Is there any way to just say "scale this to be half the size", and have GTK do all the image processing, widget resizing, etc., necessary? If not, what's the easiest way to accomplish this?
There is no built in way to do this. To do this, you'll have to consider what is "taking up space" in your ui, and how to reduce it.
If your UI is mostly text and images, you can use a smaller font size, then scale all images down by an appropriate percentage. The widget sizing will shrink automatically once the text and images that they are displaying shrinks (unless you've done Bad Things like hardcode heights/widths, use GtkFixed, etc).
The tricky part will be determining the relationship between font point size and image scale.
EDIT:
Here's a post about the pygtk syntax to change the font size.
Change the theme from the user interface is not something that I recommend, but you can do it if you require it, using a custom gtkrc may help you to change the font and the way the buttons are drawed, mostly because of the xthickness and ythickness.
import gtk
file = "/path/to/the/gtkrc"
gtk.rc_parse(file)
gtk.rc_add_default_file(file)
gtk.rc_reparse_all()
And the custom gtkrc may look like this:
gtk_color_scheme = "fg_color:#ECE9E9;bg_color:#ECE9E9;base_color:#FFFFFF;text_color:#000000;selected_bg_color:#008DD7;selected_fg_color:#FFFFFF;tooltip_bg_color:#000000;tooltip_fg_color:#F5F5B5"
style "theme-fixes" {
fg[NORMAL] = @fg_color
fg[PRELIGHT] = @fg_color
fg[SELECTED] = @selected_fg_color
fg[ACTIVE] = @fg_color
fg[INSENSITIVE] = darker (@bg_color)
bg[NORMAL] = @bg_color
bg[PRELIGHT] = shade (1.02, @bg_color)
bg[SELECTED] = @selected_bg_color
bg[INSENSITIVE] = @bg_color
bg[ACTIVE] = shade (0.9, @bg_color)
base[NORMAL] = @base_color
base[PRELIGHT] = shade (0.95, @bg_color)
base[ACTIVE] = shade (0.9, @selected_bg_color)
base[SELECTED] = @selected_bg_color
base[INSENSITIVE] = @bg_color
text[NORMAL] = @text_color
text[PRELIGHT] = @text_color
text[ACTIVE] = @selected_fg_color
text[SELECTED] = @selected_fg_color
text[INSENSITIVE] = darker (@bg_color)
GtkTreeView::odd_row_color = shade (0.929458256, @base_color)
GtkTreeView::even_row_color = @base_color
GtkTreeView::horizontal-separator = 12
font_name = "Helvetica World 7"
}
class "*" style "theme-fixes"
Having written a 100% scalable gtk app, what I did was limit myself to gdk_draw_line, and gdk_draw_rectangle, which were easy to then scale myself. Text was "done" via gdk_draw_line. (for certain low values of "done.") See: http://wordwarvi.sourceforge.net
Not that it helps you any, I'm guessing.
Resolution independence has been worked on by some gtk devs, and here is an update with a very big patch to introduce it into GTK. The patch is however a year old now and it is still unclear how/when/if it is going to be included: (screenshots at the end)
http://mail.gnome.org/archives/gtk-devel-list/2008-August/msg00044.html