Package dtk :: Package ui :: Module frame

Source Code for Module dtk.ui.frame

 1  #! /usr/bin/env python 
 2  # -*- coding: utf-8 -*- 
 3   
 4  # Copyright (C) 2011 ~ 2012 Deepin, Inc. 
 5  #               2011 ~ 2012 Wang Yong 
 6  #  
 7  # Author:     Wang Yong <lazycat.manatee@gmail.com> 
 8  # Maintainer: Wang Yong <lazycat.manatee@gmail.com> 
 9  #  
10  # This program is free software: you can redistribute it and/or modify 
11  # it under the terms of the GNU General Public License as published by 
12  # the Free Software Foundation, either version 3 of the License, or 
13  # any later version. 
14  #  
15  # This program is distributed in the hope that it will be useful, 
16  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
17  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
18  # GNU General Public License for more details. 
19  #  
20  # You should have received a copy of the GNU General Public License 
21  # along with this program.  If not, see <http://www.gnu.org/licenses/>. 
22   
23  import gobject 
24  import gtk 
25   
26 -class HorizontalFrame(gtk.Alignment):
27 ''' 28 Horizontal frame to padding 1 pixel round child. 29 ''' 30
31 - def __init__(self, 32 padding=1, 33 xalign=0.0, 34 yalign=0.0, 35 xscale=1.0, 36 yscale=1.0):
37 ''' 38 Initialize HorizontalFrame class. 39 40 @param padding: Padding value. 41 @param xalign: The fraction of horizontal free space to the left of the child widget. Ranges from 0.0 to 1.0. 42 @param yalign: The fraction of vertical free space above the child widget. Ranges from 0.0 to 1.0. 43 @param xscale: The fraction of horizontal free space that the child widget absorbs, from 0.0 to 1.0. 44 @param yscale: The fraction of vertical free space that the child widget absorbs, from 0.0 to 1.0. 45 ''' 46 # Init. 47 gtk.Alignment.__init__(self) 48 self.set(xalign, yalign, xscale, yscale) 49 self.set_padding(0, 0, padding, padding)
50 51 gobject.type_register(HorizontalFrame) 52
53 -class VerticalFrame(gtk.Alignment):
54 ''' 55 Vertical frame to padding 1 pixel round child. 56 ''' 57
58 - def __init__(self, 59 padding=1, 60 xalign=0.0, 61 yalign=0.0, 62 xscale=1.0, 63 yscale=1.0):
64 ''' 65 Initialize VerticalFrame class. 66 67 @param padding: Padding value. 68 @param xalign: The fraction of horizontal free space to the left of the child widget. Ranges from 0.0 to 1.0. 69 @param yalign: The fraction of vertical free space above the child widget. Ranges from 0.0 to 1.0. 70 @param xscale: The fraction of horizontal free space that the child widget absorbs, from 0.0 to 1.0. 71 @param yscale: The fraction of vertical free space that the child widget absorbs, from 0.0 to 1.0. 72 ''' 73 # Init. 74 gtk.Alignment.__init__(self) 75 self.set(xalign, yalign, xscale, yscale) 76 self.set_padding(padding, padding, 0, 0)
77 78 gobject.type_register(VerticalFrame) 79