Changeset 541
- Timestamp:
- 07/18/08 17:19:49 (3 months ago)
- Files:
-
- trunk/src/gdk/RgbCmap.d (modified) (1 diff)
- trunk/src/gdkpixbuf/PixbufLoader.d (modified) (1 diff)
- trunk/src/glib/ConstructionException.d (added)
- trunk/src/gtk/Button.d (modified) (3 diffs)
- trunk/src/gtk/CellEditable.d (modified) (3 diffs)
- trunk/src/gtk/CellView.d (modified) (1 diff)
- trunk/src/gtk/CheckButton.d (modified) (1 diff)
- trunk/src/gtk/CheckMenuItem.d (modified) (1 diff)
- trunk/src/gtk/ComboBox.d (modified) (1 diff)
- trunk/src/gtk/ComboBoxEntry.d (modified) (1 diff)
- trunk/src/gtk/Expander.d (modified) (1 diff)
- trunk/src/gtk/FileChooserDialog.d (modified) (4 diffs)
- trunk/src/gtk/Image.d (modified) (2 diffs)
- trunk/src/gtk/ImageMenuItem.d (modified) (3 diffs)
- trunk/src/gtk/Label.d (modified) (1 diff)
- trunk/src/gtk/ListStore.d (modified) (1 diff)
- trunk/src/gtk/MenuItem.d (modified) (1 diff)
- trunk/src/gtk/MenuToolButton.d (modified) (3 diffs)
- trunk/src/gtk/MessageDialog.d (modified) (4 diffs)
- trunk/src/gtk/RadioButton.d (modified) (2 diffs)
- trunk/src/gtk/RadioMenuItem.d (modified) (2 diffs)
- trunk/src/gtk/RecentAction.d (modified) (4 diffs)
- trunk/src/gtk/RecentChooserDialog.d (modified) (4 diffs)
- trunk/src/gtk/ScrolledWindow.d (modified) (1 diff)
- trunk/src/gtk/StatusIcon.d (modified) (2 diffs)
- trunk/src/gtk/Table.d (modified) (1 diff)
- trunk/src/gtk/ToggleButton.d (modified) (1 diff)
- trunk/src/gtk/TreeIter.d (modified) (1 diff)
- trunk/src/gtk/TreeModel.d (modified) (3 diffs)
- trunk/src/gtk/TreePath.d (modified) (1 diff)
- trunk/src/gtk/TreeStore.d (modified) (1 diff)
- trunk/src/gtk/TreeViewColumn.d (modified) (1 diff)
- trunk/srcgl/glgdk/GLConfig.d (modified) (2 diffs)
- trunk/wrap/APILookupGLd.txt (modified) (2 diffs)
- trunk/wrap/APILookupGdk.txt (modified) (1 diff)
- trunk/wrap/APILookupGdkPixbuf.txt (modified) (1 diff)
- trunk/wrap/APILookupGtk.txt (modified) (48 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/gdk/RgbCmap.d
r540 r541 182 182 if(p is null) 183 183 { 184 this = null; 185 version(Exceptions) throw new Exception("Construction failure."); 186 else return; 184 throw new ConstructionException("null returned by gdk_rgb_cmap_new(cast(uint*)(colors.ptr), colors.length)"); 187 185 } 188 186 this(cast(GdkRgbCmap*) p); trunk/src/gdkpixbuf/PixbufLoader.d
r540 r541 175 175 * A newly-created pixbuf loader. 176 176 */ 177 public this (string type, GError** error, bool isMimeType=false) 178 { 177 public this (string type, bool isMimeType=false) 178 { 179 GdkPixbufLoader* p; 180 GError* err = null; 181 179 182 if ( isMimeType ) 180 183 { 181 184 // GdkPixbufLoader* gdk_pixbuf_loader_new_with_mime_type (const char *mime_type, GError **error); 182 this(cast(GdkPixbufLoader*)gdk_pixbuf_loader_new_with_mime_type(Str.toStringz(type), error));185 p = cast(GdkPixbufLoader*)gdk_pixbuf_loader_new_with_mime_type(Str.toStringz(type), &err); 183 186 } 184 187 else 185 188 { 186 189 // GdkPixbufLoader* gdk_pixbuf_loader_new_with_type (const char *image_type, GError **error); 187 this(cast(GdkPixbufLoader*)gdk_pixbuf_loader_new_with_type(Str.toStringz(type), error) ); 188 } 190 p = cast(GdkPixbufLoader*)gdk_pixbuf_loader_new_with_type(Str.toStringz(type), &err); 191 } 192 193 if (err !is null) 194 { 195 throw new GException( new ErrorG(err) ); 196 } 197 198 if(p is null) 199 { 200 throw new ConstructionException("null returned by gtk_button_new()"); 201 } 202 203 this(p); 189 204 } 190 205 trunk/src/gtk/Button.d
r540 r541 166 166 * Returns: 167 167 * a new GtkButton 168 * Throws: ConstructionException GTK+ fails to create the object. 168 169 */ 169 170 public this (string label, bool mnemonic=true) 170 171 { 172 GtkButton* p; 173 171 174 if ( mnemonic ) 172 175 { 173 176 // GtkWidget* gtk_button_new_with_mnemonic (const gchar *label); 174 this(cast(GtkButton*)gtk_button_new_with_mnemonic(Str.toStringz(label)));177 p = cast(GtkButton*)gtk_button_new_with_mnemonic(Str.toStringz(label)); 175 178 } 176 179 else 177 180 { 178 181 // GtkWidget* gtk_button_new_with_label (const gchar *label); 179 this(cast(GtkButton*)gtk_button_new_with_label(Str.toStringz(label)) ); 180 } 182 p = cast(GtkButton*)gtk_button_new_with_label(Str.toStringz(label)); 183 } 184 185 if(p is null) 186 { 187 throw new ConstructionException("null returned by gtk_button_new_with_label"); 188 } 189 190 this(p); 181 191 } 182 192 … … 189 199 * Params: 190 200 * StockID = the name of the stock item 201 * Throws: ConstructionException GTK+ fails to create the object. 191 202 */ 192 203 public this (StockID stockID, bool hideLabel=false) … … 201 212 else 202 213 { 203 this(cast(GtkButton*)gtk_button_new_from_stock(Str.toStringz(StockDesc[stockID])) ); 214 auto p = gtk_button_new_from_stock(Str.toStringz(StockDesc[stockID])); 215 216 if(p is null) 217 { 218 throw new ConstructionException("null returned by gtk_button_new_from_stock"); 219 } 220 221 this(cast(GtkButton*) p); 204 222 } 205 223 trunk/src/gtk/CellEditable.d
r540 r541 43 43 * omit signals: 44 44 * imports: 45 * - gobject.ObjectG ;45 * - gobject.ObjectG 46 46 * - gdk.Event 47 47 * - gtk.CellEditableT … … 62 62 63 63 64 private import gobject.ObjectG; ;64 private import gobject.ObjectG; 65 65 private import gdk.Event; 66 66 private import gtk.CellEditableT; … … 93 93 { 94 94 this = null; 95 version(Exceptions) throw new Exception("Null gtkCellEditable passed to constructor.");96 else return;97 }98 //Check if there already is a D object for this gtk struct99 void* ptr = getDObject(cast(GObject*)gtkCellEditable);100 if( ptr !is null )101 {102 this = cast(CellEditable)ptr;103 95 return; 104 96 } 97 105 98 super(cast(GObject*)gtkCellEditable); 106 99 this.gtkCellEditable = gtkCellEditable; trunk/src/gtk/CellView.d
r540 r541 149 149 * Returns: 150 150 * A newly created GtkCellView widget. 151 * Throws: ConstructionException GTK+ fails to create the object. 151 152 */ 152 153 public this (string text, bool markup=true) 153 154 { 155 GtkCellView* p; 156 154 157 if ( markup ) 155 158 { 156 159 // GtkWidget* gtk_cell_view_new_with_markup (const gchar *markup); 157 this(cast(GtkCellView*)gtk_cell_view_new_with_markup(Str.toStringz(text)));160 p = cast(GtkCellView*)gtk_cell_view_new_with_markup(Str.toStringz(text)); 158 161 } 159 162 else 160 163 { 161 164 // GtkWidget* gtk_cell_view_new_with_text (const gchar *text); 162 this(cast(GtkCellView*)gtk_cell_view_new_with_text(Str.toStringz(text)) ); 163 } 165 p = cast(GtkCellView*)gtk_cell_view_new_with_text(Str.toStringz(text)); 166 } 167 168 if(p is null) 169 { 170 throw new ConstructionException("null returned by gtk_cell_view_new_with_"); 171 } 172 173 this(p); 164 174 } 165 175 trunk/src/gtk/CheckButton.d
r540 r541 123 123 * mnemonic character 124 124 * mnemonic = true if the button has an mnemnonic 125 * Throws: ConstructionException GTK+ fails to create the object. 125 126 */ 126 127 public this (string label, bool mnemonic=true) 127 128 { 129 GtkCheckButton* p; 130 128 131 if ( mnemonic ) 129 132 { 130 133 // GtkWidget* gtk_check_button_new_with_mnemonic (const gchar *label); 131 this(cast(GtkCheckButton*)gtk_check_button_new_with_mnemonic(Str.toStringz(label)));134 p = cast(GtkCheckButton*)gtk_check_button_new_with_mnemonic(Str.toStringz(label)); 132 135 } 133 136 else 134 137 { 135 138 // GtkWidget* gtk_check_button_new_with_label (const gchar *label); 136 this(cast(GtkCheckButton*)gtk_check_button_new_with_label(Str.toStringz(label)));139 p = cast(GtkCheckButton*)gtk_check_button_new_with_label(Str.toStringz(label)); 137 140 } 141 142 if(p is null) 143 { 144 throw new ConstructionException("null returned by gtk_check_button_new_"); 145 } 146 147 this(p); 138 148 } 139 149 trunk/src/gtk/CheckMenuItem.d
r540 r541 125 125 * will be created using gtk_label_new_with_mnemonic(), so underscores 126 126 * in label indicate the mnemonic for the menu item. 127 * Throws: ConstructionException GTK+ fails to create the object. 127 128 */ 128 129 public this (string label, bool mnemonic=true) 129 130 { 131 GtkCheckMenuItem* p; 132 130 133 if ( mnemonic ) 131 134 { 132 135 // GtkWidget* gtk_check_menu_item_new_with_mnemonic (const gchar *label); 133 this(cast(GtkCheckMenuItem*)gtk_check_menu_item_new_with_mnemonic(Str.toStringz(label)));136 p = cast(GtkCheckMenuItem*)gtk_check_menu_item_new_with_mnemonic(Str.toStringz(label)); 134 137 } 135 138 else 136 139 { 137 140 // GtkWidget* gtk_check_menu_item_new_with_label (const gchar *label); 138 this(cast(GtkCheckMenuItem*)gtk_check_menu_item_new_with_label(Str.toStringz(label)) ); 139 } 141 p = cast(GtkCheckMenuItem*)gtk_check_menu_item_new_with_label(Str.toStringz(label)); 142 } 143 144 if(p is null) 145 { 146 throw new ConstructionException("null returned by gtk_check_menu_item_new_with_"); 147 } 148 149 this(p); 140 150 } 141 151 trunk/src/gtk/ComboBox.d
r540 r541 183 183 * Returns: 184 184 * A new GtkComboBox. 185 * Throws: ConstructionException GTK+ fails to create the object. 185 186 */ 186 187 public this (bool text=true) 187 188 { 189 GtkComboBox* p; 188 190 if ( text ) 189 191 { 190 192 // GtkWidget* gtk_combo_box_new_text (void); 191 this(cast(GtkComboBox*)gtk_combo_box_new_text());193 p = cast(GtkComboBox*)gtk_combo_box_new_text(); 192 194 } 193 195 else 194 196 { 195 197 // GtkWidget* gtk_combo_box_new (void); 196 this(cast(GtkComboBox*)gtk_combo_box_new() ); 197 } 198 p = cast(GtkComboBox*)gtk_combo_box_new(); 199 } 200 201 if(p is null) 202 { 203 throw new ConstructionException("null returned by gtk_combo_box_new"); 204 } 205 206 this(p); 198 207 } 199 208 trunk/src/gtk/ComboBoxEntry.d
r540 r541 145 145 * Returns: 146 146 * A new GtkComboBoxEntry. 147 * Throws: ConstructionException GTK+ fails to create the object. 147 148 */ 148 149 public this (bool text=true) 149 150 { 151 GtkComboBoxEntry* p; 152 150 153 if ( text ) 151 154 { 152 155 // GtkWidget* gtk_combo_box_entry_new_text (void); 153 this(cast(GtkComboBoxEntry*)gtk_combo_box_entry_new_text());156 p = cast(GtkComboBoxEntry*)gtk_combo_box_entry_new_text(); 154 157 } 155 158 else 156 159 { 157 160 // GtkWidget* gtk_combo_box_entry_new (void); 158 this(cast(GtkComboBoxEntry*)gtk_combo_box_entry_new());161 p = cast(GtkComboBoxEntry*)gtk_combo_box_entry_new(); 159 162 } 160 163 164 if(p is null) 165 { 166 throw new ConstructionException("null returned by gtk_combo_box_entry_new"); 167 } 168 169 this(p); 161 170 } 162 171 trunk/src/gtk/Expander.d
r540 r541 174 174 * underscores). The first underlined character represents a keyboard 175 175 * accelerator called a mnemonic. 176 * Throws: ConstructionException GTK+ fails to create the object. 176 177 */ 177 178 public this (string label, bool mnemonic=true) 178 179 { 180 GtkExpander* p; 181 179 182 if ( mnemonic ) 180 183 { 181 184 // GtkWidget* gtk_expander_new_with_mnemonic (const gchar *label); 182 this(cast(GtkExpander*)gtk_expander_new_with_mnemonic(Str.toStringz(label)));185 p = cast(GtkExpander*)gtk_expander_new_with_mnemonic(Str.toStringz(label)); 183 186 } 184 187 else 185 188 { 186 189 // GtkWidget* gtk_expander_new (const gchar *label); 187 this(cast(GtkExpander*)gtk_expander_new(Str.toStringz(label)) ); 188 } 190 p = cast(GtkExpander*)gtk_expander_new(Str.toStringz(label)); 191 } 192 193 if(p is null) 194 { 195 throw new ConstructionException("null returned by gtk_expander_new"); 196 } 197 198 this(p); 189 199 } 190 200 trunk/src/gtk/FileChooserDialog.d
r540 r541 225 225 * buttonsText = text to go in the buttons 226 226 * responses = response ID's for the buttons 227 * Returns: 228 * a new GtkFileChooserDialog 227 * Throws: ConstructionException GTK+ fails to create the object. 229 228 */ 230 229 this(string title, Window parent, FileChooserAction action, string[] buttonsText=null, ResponseType[] responses=null) … … 241 240 } 242 241 243 this( 244 cast(GtkFileChooserDialog*)gtk_file_chooser_dialog_new( 242 auto p = gtk_file_chooser_dialog_new( 245 243 Str.toStringz(title), 246 244 parent.getWindowStruct(), 247 245 action, 248 246 null, 249 0)); 247 0); 248 249 if(p is null) 250 { 251 throw new ConstructionException("null returned by gtk_file_chooser_dialog_new"); 252 } 253 254 this(cast(GtkFileChooserDialog*) p); 255 250 256 addButtons(buttonsText, responses); 251 257 } … … 264 270 * buttonsText = text to go in the buttons 265 271 * responses = response ID's for the buttons 266 * Returns:267 * a new GtkFileChooserDialog268 272 * See_Also: 269 273 * GtkFileChooser, GtkDialog 274 * Throws: ConstructionException GTK+ fails to create the object. 270 275 */ 271 276 public this (string title, Window parent, GtkFileChooserAction action, string backend, string[] buttonsText=null, ResponseType[] responses=null) 272 277 { 273 278 // GtkWidget* gtk_file_chooser_dialog_new_with_backend (const gchar *title, GtkWindow *parent, GtkFileChooserAction action, const gchar *backend, const gchar *first_button_text, ...); 274 this( 275 cast(GtkFileChooserDialog*)gtk_file_chooser_dialog_new_with_backend( 279 auto p = gtk_file_chooser_dialog_new_with_backend( 276 280 Str.toStringz(title), 277 281 parent.getWindowStruct(), … … 280 284 null, 281 285 0 282 )); 286 ); 287 288 if(p is null) 289 { 290 throw new ConstructionException("null returned by gtk_file_chooser_dialog_new_with_backend"); 291 } 292 293 this(cast(GtkFileChooserDialog*) p); 294 283 295 if ( buttonsText is null ) 284 296 { trunk/src/gtk/Image.d
r540 r541 202 202 * Returns: 203 203 * a new GtkImage displaying the stock icon 204 * Throws: ConstructionException GTK+ fails to create the object. 204 205 */ 205 206 public this (StockID stockID, GtkIconSize size) 206 207 { 207 208 // GtkWidget* gtk_image_new_from_stock (const gchar *stock_id, GtkIconSize size); 208 this(cast(GtkImage*)gtk_image_new_from_stock(Str.toStringz(StockDesc[stockID]), size) ); 209 auto p = gtk_image_new_from_stock(Str.toStringz(StockDesc[stockID]), size); 210 if(p is null) 211 { 212 throw new ConstructionException("null returned by gtk_image_new_from_stock(Str.toStringz(StockDesc[stockID]), size)"); 213 } 214 this(cast(GtkImage*)p); 209 215 } 210 216 … … 219 225 * Returns: 220 226 * a new GtkImage displaying the themed icon 227 * Throws: ConstructionException GTK+ fails to create the object. 221 228 */ 222 229 public this (string iconName, GtkIconSize size) 223 230 { 224 231 // GtkWidget* gtk_image_new_from_icon_name (const gchar *icon_name, GtkIconSize size); 225 this(cast(GtkImage*)gtk_image_new_from_icon_name(Str.toStringz(iconName), size) ); 232 auto p = gtk_image_new_from_icon_name(Str.toStringz(iconName), size); 233 if(p is null) 234 { 235 throw new ConstructionException("null returned by gtk_image_new_from_icon_name(Str.toStringz(iconName), size)"); 236 } 237 this(cast(GtkImage*)p); 226 238 } 227 239 trunk/src/gtk/ImageMenuItem.d
r540 r541 129 129 * Returns: 130 130 * a new GtkImageMenuItem. 131 * Throws: ConstructionException GTK+ fails to create the object. 131 132 */ 132 133 public this (string label, bool mnemonic=true) 133 134 { 135 GtkImageMenuItem* p; 136 134 137 if ( mnemonic ) 135 138 { 136 139 // GtkWidget* gtk_image_menu_item_new_with_mnemonic (const gchar *label); 137 this(cast(GtkImageMenuItem*)gtk_image_menu_item_new_with_mnemonic(Str.toStringz(label)));140 p = cast(GtkImageMenuItem*)gtk_image_menu_item_new_with_mnemonic(Str.toStringz(label)); 138 141 } 139 142 else 140 143 { 141 144 // GtkWidget* gtk_image_menu_item_new_with_label (const gchar *label); 142 this(cast(GtkImageMenuItem*)gtk_image_menu_item_new_with_label(Str.toStringz(label)) ); 143 } 145 p = cast(GtkImageMenuItem*)gtk_image_menu_item_new_with_label(Str.toStringz(label)); 146 } 147 148 if(p is null) 149 { 150 throw new ConstructionException("null returned by gtk_image_menu_item_new_with_"); 151 } 152 153 this(p); 144 154 } 145 155 … … 157 167 * accelGroup = the GtkAccelGroup to add the menu items accelerator to, 158 168 * or NULL. 169 * Throws: ConstructionException GTK+ fails to create the object. 159 170 */ 160 171 public this (StockID stockID, AccelGroup accelGroup) … … 164 175 if(p is null) 165 176 { 166 throw new Exception("Construction failure.");177 throw new ConstructionException("null returned by gtk_image_menu_item_new_from_stock"); 167 178 } 168 179 this(cast(GtkImageMenuItem*) p); trunk/src/gtk/Label.d
r540 r541 202 202 * mnemonic character 203 203 * mnemonic = when false uses the literal text passed in without mnemonic 204 * Throws: ConstructionException GTK+ fails to create the object. 204 205 */ 205 206 public this (string str, bool mnemonic=true) 206 207 { 208 GtkLabel* p; 209 207 210 if ( mnemonic ) 208 211 { 209 212 // GtkWidget* gtk_label_new_with_mnemonic (const gchar *str); 210 this(cast(GtkLabel*)gtk_label_new_with_mnemonic(Str.toStringz(str)));213 p = cast(GtkLabel*)gtk_label_new_with_mnemonic(Str.toStringz(str)); 211 214 } 212 215 else 213 216 { 214 217 // GtkWidget* gtk_label_new (const gchar *str); 215 this(cast(GtkLabel*)gtk_label_new(Str.toStringz(str)) ); 216 } 218 p = cast(GtkLabel*)gtk_label_new(Str.toStringz(str)); 219 } 220 221 if(p is null) 222 { 223 throw new ConstructionException("null returned by gtk_label_new"); 224 } 225 226 this(p); 217 227 } 218 228 trunk/src/gtk/ListStore.d
r540 r541 286 286 * Returns: 287 287 * a new GtkListStore 288 * Throws: ConstructionException GTK+ fails to create the object. 288 289 */ 289 290 public this (GType[] types) 290 291 { 291 292 // GtkListStore* gtk_list_store_newv (gint n_columns, GType *types); 292 this(cast(GtkListStore*)gtk_list_store_newv(types.length, cast(GType*)(types.ptr)) ); 293 auto p = gtk_list_store_newv(types.length, cast(GType*)(types.ptr)); 294 if(p is null) 295 { 296 throw new ConstructionException("null returned by gtk_list_store_newv"); 297 } 298 this(cast(GtkListStore*)p); 293 299 } 294 300 trunk/src/gtk/MenuItem.d
r540 r541 191 191 * will be created using gtk_label_new_with_mnemonic(), so underscores 192 192 * in label indicate the mnemonic for the menu item. 193 * Throws: ConstructionException GTK+ fails to create the object. 193 194 */ 194 195 public this (string label, bool mnemonic=true) 195 196 { 197 GtkMenuItem* p; 198 196 199 if ( mnemonic ) 197 200 { 198 201 // GtkWidget* gtk_menu_item_new_with_mnemonic (const gchar *label); 199 this(cast(GtkMenuItem*)gtk_menu_item_new_with_mnemonic(Str.toStringz(label)));202 p = cast(GtkMenuItem*)gtk_menu_item_new_with_mnemonic(Str.toStringz(label)); 200 203 } 201 204 else 202 205 { 203 206 // GtkWidget* gtk_menu_item_new_with_label (const gchar *label); 204 this(cast(GtkMenuItem*)gtk_menu_item_new_with_label(Str.toStringz(label)) ); 205 } 207 p = cast(GtkMenuItem*)gtk_menu_item_new_with_label(Str.toStringz(label)); 208 } 209 210 if(p is null) 211 { 212 throw new ConstructionException("null returned by gtk_menu_item_new_with_"); 213 } 214 215 this(p); 216 206 217 setName(label); 207 218 } trunk/src/gtk/MenuToolButton.d
r540 r541 137 137 * iconWidget = a widget that will be used as icon widget, or NULL 138 138 * label = a string that will be used as label, or NULL 139 * Throws: ConstructionException GTK+ fails to create the object. 139 140 */ 140 141 public this(Widget iconWidget, string label) 141 142 { 142 143 // GtkToolItem* gtk_menu_tool_button_new (GtkWidget *icon_widget, const gchar *label); 143 this( cast(GtkMenuToolButton*)gtk_menu_tool_button_new( 144 (iconWidget is null) ? null : iconWidget.getWidgetStruct(), 145 Str.toStringz(label)) 146 ); 144 auto p = gtk_menu_tool_button_new((iconWidget is null) ? null : iconWidget.getWidgetStruct(), 145 Str.toStringz(label)); 146 147 if(p is null) 148 { 149 throw new ConstructionException("null returned by gtk_menu_tool_button_new"); 150 } 151 152 this(cast(GtkMenuToolButton*) p); 147 153 } 148 154 … … 154 160 * Params: 155 161 * stockID = the name of a stock item 162 * Throws: ConstructionException GTK+ fails to create the object. 156 163 */ 157 164 public this(StockID stockId) 158 165 { 159 166 // GtkToolItem* gtk_menu_tool_button_new_from_stock (const gchar *stock_id); 160 this( 161 cast(GtkMenuToolButton*)gtk_menu_tool_button_new_from_stock( 162 Str.toStringz(StockDesc[stockId])) 163 ); 167 auto p = gtk_menu_tool_button_new_from_stock( 168 Str.toStringz(StockDesc[stockId])); 169 170 if(p is null) 171 { 172 throw new ConstructionException("null returned by gtk_menu_tool_button_new_from_stock"); 173 } 174 175 this(cast(GtkMenuToolButton*) p); 164 176 } 165 177 … … 178 190 if(p is null) 179 191 { 180 version(Exceptions) throw new Exception("Null GObject from GTK+."); 181 else return null; 192 return null; 182 193 } 183 194 return new Menu(cast(GtkMenu*)p); trunk/src/gtk/MessageDialog.d
r540 r541 202 202 * messageFormat = printf()-style format string, or NULL 203 203 * message = the message - should be null, any formatting should be done prior to call this constructor 204 * Throws: ConstructionException GTK+ fails to create the object. 204 205 */ 205 206 public this (Window parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, bool markup, string messageFormat, string message=null ) 206 207 { 208 GtkMessageDialog* p; 209 207 210 if ( markup ) 208 211 { 209 212 // GtkWidget* gtk_message_dialog_new_with_markup (GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, const gchar *message_format, ...); 210 this( 211 cast(GtkMessageDialog*)gtk_message_dialog_new_with_markup( 213 p = cast(GtkMessageDialog*)gtk_message_dialog_new_with_markup( 212 214 parent is null ? null : parent.getWindowStruct(), 213 215 flags, … … 217 219 Str.toStringz(message), // this should be null 218 220 null 219 )220 221 ); 221 222 } … … 223 224 { 224 225 // GtkWidget* gtk_message_dialog_new (GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, const gchar *message_format, ...); 225 this( 226 cast(GtkMessageDialog*)gtk_message_dialog_new( 226 p = cast(GtkMessageDialog*)gtk_message_dialog_new( 227 227 parent is null ? null : parent.getWindowStruct(), 228 228 flags, … … 232 232 Str.toStringz(message), // this should be null 233 233 null 234 )235 234 ); 236 235 } 236 237 if(p is null) 238 { 239 throw new ConstructionException("null returned by gtk_button_new()"); 240 } 241 242 this(p); 237 243 } 238 244 trunk/src/gtk/RadioButton.d
r540 r541 170 170 * gtk_label_new_with_mnemonic(), so underscores in label indicate the 171 171 * mnemonic for the button. 172 * Throws: ConstructionException GTK+ fails to create the object. 172 173 */ 173 174 public this (ListSG group, string label, bool mnemonic=true) 174 175 { 176 GtkRadioButton* p; 177 175 178 if ( mnemonic ) 176 179 { 177 180 // GtkWidget* gtk_radio_button_new_with_mnemonic (GSList *group, const gchar *label); 178 this(cast(GtkRadioButton*)gtk_radio_button_new_with_mnemonic(181 p = cast(GtkRadioButton*)gtk_radio_button_new_with_mnemonic( 179 182 group is null ? null : group.getListSGStruct(), 180 Str.toStringz(label)) 181 ); 183 Str.toStringz(label)); 182 184 } 183 185 else 184 186 { 185 187 // GtkWidget* gtk_radio_button_new_with_label (GSList *group, const gchar *label); 186 this(cast(GtkRadioButton*)gtk_radio_button_new_with_label(188 p = cast(GtkRadioButton*)gtk_radio_button_new_with_label( 187 189 group is null ? null : group.getListSGStruct(), 188 Str.toStringz(label)) 189 ); 190 } 190 Str.toStringz(label)); 191 } 192 193 if(p is null) 194 { 195 throw new ConstructionException("null returned by gtk_radio_button_new_"); 196 } 197 198 this(p); 191 199 } 192 200 … … 200 208 * will be created using gtk_label_new_with_mnemonic(), so underscores 201 209 * in label indicate the mnemonic for the button. 210 * Throws: ConstructionException GTK+ fails to create the object. 202 211 */ 203 212 public this (RadioButton radioButton, string label, bool mnemonic=true) 204 213 { 214 GtkRadioButton* p; 215 205 216 if ( mnemonic ) 206 217 { 207 218 // GtkWidget* gtk_radio_button_new_with_mnemonic_from_widget (GtkRadioButton *group, const gchar *label); 208 this(cast(GtkRadioButton*)gtk_radio_button_new_with_mnemonic_from_widget(219 p = cast(GtkRadioButton*)gtk_radio_button_new_with_mnemonic_from_widget( 209 220 radioButton.getRadioButtonStruct(), 210 Str.toStringz(label)) 211 ); 221 Str.toStringz(label)); 212 222 } 213 223 else 214 224 { 215 225 // GtkWidget* gtk_radio_button_new_with_label_from_widget (GtkRadioButton *group, const gchar *label); 216 this(cast(GtkRadioButton*)gtk_radio_button_new_with_label_from_widget(226 p = cast(GtkRadioButton*)gtk_radio_button_new_with_label_from_widget( 217 227 radioButton.getRadioButtonStruct(), 218 Str.toStringz(label)) 219 ); 220 } 228 Str.toStringz(label)); 229 } 230 231 if(p is null) 232 { 233 throw new ConstructionException("null returned by gtk_radio_button_new_"); 234 } 235 236 this(p); 221 237 } 222 238 trunk/src/gtk/RadioMenuItem.d
r540 r541 144 144 * group = an existing GtkRadioMenuItem 145 145 * label = the text for the label 146 * Throws: ConstructionException GTK+ fails to create the object. 146 147 */ 147 148 public this (RadioMenuItem radioMenuItem, string label, bool mnemonic=true) 148 149 { 150 GtkRadioMenuItem* p; 151 149 152 if ( mnemonic ) 150 153 { 151 154 // GtkWidget* gtk_radio_menu_item_new_with_mnemonic_from_widget (GtkRadioMenuItem *group, const gchar *label); 152 this(cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_mnemonic_from_widget(153 radioMenuItem.getRadioMenuItemStruct(), Str.toStringz(label)) );155 p = cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_mnemonic_from_widget( 156 radioMenuItem.getRadioMenuItemStruct(), Str.toStringz(label)); 154 157 } 155 158 else 156 159 { 157 160 // GtkWidget* gtk_radio_menu_item_new_with_label_from_widget (GtkRadioMenuItem *group, const gchar *label); 158 this(cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_label_from_widget( 159 radioMenuItem.getRadioMenuItemStruct(), Str.toStringz(label)) ); 160 } 161 } 162 163 /** 164 * Creates a new GtkRadioMenuItem containing a label. T 165 * The new GtkRadioMenuItem is added to the same group as group. 166 * Since 2.4 167 * Params: 168 * group = An existing GtkRadioMenuItem 169 * label = the text of the button, with an underscore in front of the 170 * mnemonic character 171 */ 172 public this (string label) 173 { 161 p = cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_label_from_widget( 162 radioMenuItem.getRadioMenuItemStruct(), Str.toStringz(label)); 163 } 164 165 if(p is null) 166 { 167 throw new ConstructionException("null returned by gtk_radio_menu_item_new_with_"); 168 } 169 170 this(p); 174 171 } 175 172 … … 182 179 * will be created using gtk_label_new_with_mnemonic(), so underscores 183 180 * in label indicate the mnemonic for the menu item. 181 * Throws: ConstructionException GTK+ fails to create the object. 184 182 */ 185 183 public this (ListSG group, string label, bool mnemonic=true) 186 184 { 185 GtkRadioMenuItem* p; 186 187 187 if ( mnemonic ) 188 188 { 189 189 // GtkWidget* gtk_radio_menu_item_new_with_mnemonic (GSList *group, const gchar *
