Ticket #1: ddoc-glade.diff
| File ddoc-glade.diff, 3.5 kB (added by Mike Wey, 1 year ago) |
|---|
-
gtkD/wrap/APILookupGlade.txt
old new 104 104 nocode: glade_xml_get_widget_prefix 105 105 106 106 code: start 107 /**107 /** 108 108 * This function is used to get a pointer to the GtkWidget corresponding to 109 109 * name in the interface description. You would use this if you have to do 110 110 * anything to the widget after loading. 111 * self: 112 * the GladeXML object. 113 * name: 114 * the name of the widget. 111 * Params: 112 * name = the name of the widget. 115 113 * Returns: 116 114 * the widget matching name, or NULL if none exists. 117 115 */ … … 133 131 * only want to build say a toolbar or menu from the XML file, but not the 134 132 * window it is embedded in. Note also that the XML parse tree is cached 135 133 * to speed up creating another GladeXML object for the same file 136 * fname: 137 * the XML file name. 138 * root: 139 * the widget node in fname to start building from (or NULL) 140 * domain: 141 * the translation domain for the XML file (or NULL for default) 142 * Returns: 143 * the newly created GladeXML object, or NULL on failure. 134 * Params: 135 * fname = the XML file name. 136 * root = the widget node in fname to start building from (or NULL) 137 * domain = the translation domain for the XML file (or NULL for default) 144 138 */ 145 139 public this (char[] fname, char[] root = null, char[] domain=null) 146 140 { … … 151 145 } 152 146 153 147 /** 154 * This function is used to get a list of pointers to the GtkWidget(s) 155 * with names that start with the string name in the interface description. 156 * You would use this if you have to do something to all of these widgets 157 * after loading. 158 * self: 159 * the GladeXML object. 160 * name: 161 * the name of the widget. 162 * Returns: 163 * A list of the widget that match name as the start of their 164 * name, or NULL if none exists. 165 */ 166 public Widget[] getWidgetPrefix(char[] name) 167 { 168 // GList* glade_xml_get_widget_prefix (GladeXML *self, const char *name); 148 * This function is used to get a list of pointers to the GtkWidget(s) 149 * with names that start with the string name in the interface description. 150 * You would use this if you have to do something to all of these widgets 151 * after loading. 152 * Params: 153 * self = the GladeXML object. 154 * name = the name of the widget. 155 * Returns: 156 * A list of the widget that match name as the start of their 157 * name, or NULL if none exists. 158 */ 159 public Widget[] getWidgetPrefix(char[] name) 160 { 161 // GList* glade_xml_get_widget_prefix (GladeXML *self, const char *name); 169 162 Widget[] ret; 170 163 ListG widgets = new ListG( glade_xml_get_widget_prefix(gladeXML, Str.toStringz(name)) ); 171 for (int i=0;i < widgets.length; i++) { 164 for (int i=0;i < widgets.length; i++) 165 { 172 166 ret ~= newFromWidget( cast(void *)widgets.nthData(i) ); 173 167 } 174 return widgets.length ? ret : null;175 }168 return widgets.length ? ret : null; 169 } 176 170 177 171 178 /**179 * Utilitiy method to create objects that are castable.180 *181 */182 172 private import gobject.Type; 183 173 private import gtk.Container; 184 174 private import gtk.Bin; … … 295 285 //private import gtk.Preview; 296 286 private import gtk.Progress; 297 287 private import gtk.ProgressBar; 298 288 289 /** 290 * Utilitiy method to create objects that are castable. 291 * 292 */ 299 293 Widget newFromWidget(void * ptr) 300 294 { 301 295 if (ptr is null) { … … 430 424 431 425 } 432 426 433 434 435 436 437 438 439 427 440 428 code: end 441 429
