|
2009-06-09
, 17:14
|
Posts: 146 |
Thanked: 15 times |
Joined on Oct 2008
|
#2
|
|
2009-06-09
, 19:21
|
|
Posts: 2,427 |
Thanked: 2,986 times |
Joined on Dec 2007
|
#3
|
window.changePango(window) def changePango (self, child): if child is a container: for subChild in child.get_children(): changePango (subChild) else: change the child's pango context
|
2009-06-10
, 03:01
|
Posts: 146 |
Thanked: 15 times |
Joined on Oct 2008
|
#5
|
|
2009-08-28
, 21:58
|
Posts: 146 |
Thanked: 15 times |
Joined on Oct 2008
|
#6
|
My opinion is that every widget inherits its pango context from its container parent. I don't think it makes a copy. But if it does, I would just make a recursive call starting at the top level window.
Maybe use the gtk.Container.get_children() call
The pseudo code might look something like this:
If a child doesn't make a copy, just change the toplevel window's pango context and then maybe call the toplevel window's check_resize().Code:window.changePango(window) def changePango (self, child): if child is a container: for subChild in child.get_children(): changePango (subChild) else: change the child's pango context
Check gtk.Container for more info.
|
2009-08-28
, 23:38
|
|
Posts: 2,427 |
Thanked: 2,986 times |
Joined on Dec 2007
|
#7
|
yes yes no
import gobject import gtk myContainer = gtk.Window() if gobject.type_is_a(myContainer,gtk.Window): print 'yes' else: print 'no' if gobject.type_is_a(myContainer,gtk.Container): print 'yes' else: print 'no' if gobject.type_is_a(myContainer,gtk.Label): print 'yes' else: print 'no'
|
2009-08-29
, 01:41
|
Posts: 146 |
Thanked: 15 times |
Joined on Oct 2008
|
#8
|
The appended script returned:
and it should be robust.Code:yes yes no
Code:import gobject import gtk myContainer = gtk.Window() if gobject.type_is_a(myContainer,gtk.Window): print 'yes' else: print 'no' if gobject.type_is_a(myContainer,gtk.Container): print 'yes' else: print 'no' if gobject.type_is_a(myContainer,gtk.Label): print 'yes' else: print 'no'
|
2009-08-29
, 03:24
|
|
Posts: 2,427 |
Thanked: 2,986 times |
Joined on Dec 2007
|
#9
|
Attributes
"vbox" Read A gtk.VBox that is the main container of the dialog - all the other widgets are packed in it.
"action_area" Read A gtk.HBox that contains the buttons of the dialog.
|
2009-08-31
, 20:26
|
Posts: 146 |
Thanked: 15 times |
Joined on Oct 2008
|
#10
|
From the gtk.Dialog reference page:
So, maybe you have to traverse these containers individually.
myDialog.vbox
myDialog.action_area
def changePango(self, child): if gobject.type_is_a(child,gtk.Container): for subChild in child.get_children(): self.changePango(subChild) else: child.modify_font(pango.FontDescription("courier bold 60"))
I made a pygtk app, and want to use the +/- buttons to change the whole app font size (yeah, I'm becoming old quickly...). I know how to do that with pango in each widget, but I want to change ALL sizes at once.
Any help will be appreciated!
Thanks,
L.