Changeset 503

Show
Ignore:
Timestamp:
06/22/08 15:50:45 (3 months ago)
Author:
Mike Wey
Message:

getter and setter for GtkWidget?.allocation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/gtk/Widget.d

    r480 r503  
    237237        return height; 
    238238    } 
     239 
     240    public GtkAllocation getAllocation() 
     241    { 
     242        GtkAllocation allo; 
     243        int* pt = cast(int*)getStruct(); 
     244 
     245        pt += 36/4; 
     246        allo.x = *pt; 
     247 
     248        pt++; 
     249        allo.y = *pt; 
     250 
     251        pt++; 
     252        allo.width = *pt; 
     253 
     254        pt++; 
     255        allo.height = *pt; 
     256 
     257        return allo; 
     258    } 
     259 
     260    public void setAllocation(GtkAllocation allo) 
     261    { 
     262        int* pt = cast(int*)getStruct(); 
     263 
     264        pt += 36/4; 
     265        *pt = allo.x; 
     266 
     267        pt++; 
     268        *pt = allo.y; 
     269 
     270        pt++; 
     271        *pt = allo.width; 
     272 
     273        pt++; 
     274        *pt = allo.height; 
     275    } 
    239276     
    240277    /** 
  • trunk/wrap/APILookupGtk.txt

    r500 r503  
    59975997        return height; 
    59985998    } 
     5999 
     6000    /** 
     6001     * The widget's allocated size. 
     6002     * Returns: the GtkAllocation for this widget 
     6003     */ 
     6004    public GtkAllocation getAllocation() 
     6005    { 
     6006        GtkAllocation allo; 
     6007        int* pt = cast(int*)getStruct(); 
     6008 
     6009        pt += 36/4; 
     6010        allo.x = *pt; 
     6011 
     6012        pt++; 
     6013        allo.y = *pt; 
     6014 
     6015        pt++; 
     6016        allo.width = *pt; 
     6017 
     6018        pt++; 
     6019        allo.height = *pt; 
     6020 
     6021        return allo; 
     6022    } 
     6023 
     6024    /** 
     6025     * The widget's allocated size. 
     6026     */ 
     6027    public void setAllocation(GtkAllocation allo) 
     6028    { 
     6029        int* pt = cast(int*)getStruct(); 
     6030 
     6031        pt += 36/4; 
     6032        *pt = allo.x; 
     6033 
     6034        pt++; 
     6035        *pt = allo.y; 
     6036 
     6037        pt++; 
     6038        *pt = allo.width; 
     6039 
     6040        pt++; 
     6041        *pt = allo.height; 
     6042    } 
    59996043     
    60006044    /**