Mercurial > dwindows
comparison gtk3/dw.c @ 1373:bad3e17ab6e5
Implemented dw_menu_delete_item() for GTK.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 22 Nov 2011 21:10:56 +0000 |
parents | 2f5e54b0c5c4 |
children | 156e32814c83 |
comparison
equal
deleted
inserted
replaced
1372:8e27dd96a97e | 1373:bad3e17ab6e5 |
---|---|
3402 } | 3402 } |
3403 DW_MUTEX_UNLOCK; | 3403 DW_MUTEX_UNLOCK; |
3404 } | 3404 } |
3405 | 3405 |
3406 /* | 3406 /* |
3407 * Deletes the menu item specified. | |
3408 * Parameters: | |
3409 * menu: The handle to the menu in which the item was appended. | |
3410 * id: Menuitem id. | |
3411 * Returns: | |
3412 * DW_ERROR_NONE (0) on success or DW_ERROR_UNKNOWN on failure. | |
3413 */ | |
3414 int API dw_menu_delete_item(HMENUI menu, unsigned long id) | |
3415 { | |
3416 char numbuf[11]; | |
3417 GtkWidget *tmphandle; | |
3418 int _locked_by_me = FALSE; | |
3419 int ret = DW_ERROR_UNKNOWN; | |
3420 | |
3421 if(!menu) | |
3422 return ret; | |
3423 | |
3424 DW_MUTEX_LOCK; | |
3425 snprintf(numbuf, 10, "%lu", id); | |
3426 tmphandle = _find_submenu_id(menu, numbuf); | |
3427 | |
3428 if(tmphandle) | |
3429 { | |
3430 gtk_widget_destroy(tmphandle); | |
3431 g_object_set_data(G_OBJECT(menu), numbuf, NULL); | |
3432 ret = DW_ERROR_NONE; | |
3433 } | |
3434 DW_MUTEX_UNLOCK; | |
3435 return ret; | |
3436 } | |
3437 | |
3438 /* | |
3407 * Pops up a context menu at given x and y coordinates. | 3439 * Pops up a context menu at given x and y coordinates. |
3408 * Parameters: | 3440 * Parameters: |
3409 * menu: The handle the the existing menu. | 3441 * menu: The handle the the existing menu. |
3410 * parent: Handle to the window initiating the popup. | 3442 * parent: Handle to the window initiating the popup. |
3411 * x: X coordinate. | 3443 * x: X coordinate. |