Mercurial > dwindows
comparison gtk/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 | d5c1ce21577e |
comparison
equal
deleted
inserted
replaced
1372:8e27dd96a97e | 1373:bad3e17ab6e5 |
---|---|
3937 } | 3937 } |
3938 DW_MUTEX_UNLOCK; | 3938 DW_MUTEX_UNLOCK; |
3939 } | 3939 } |
3940 | 3940 |
3941 /* | 3941 /* |
3942 * Deletes the menu item specified. | |
3943 * Parameters: | |
3944 * menu: The handle to the menu in which the item was appended. | |
3945 * id: Menuitem id. | |
3946 * Returns: | |
3947 * DW_ERROR_NONE (0) on success or DW_ERROR_UNKNOWN on failure. | |
3948 */ | |
3949 int API dw_menu_delete_item(HMENUI menu, unsigned long id) | |
3950 { | |
3951 char numbuf[11]; | |
3952 GtkWidget *tmphandle; | |
3953 int _locked_by_me = FALSE; | |
3954 int ret = DW_ERROR_UNKNOWN; | |
3955 | |
3956 if(!menu || !id) | |
3957 return ret; | |
3958 | |
3959 DW_MUTEX_LOCK; | |
3960 snprintf(numbuf, 10, "%lu", id); | |
3961 tmphandle = _find_submenu_id(menu, numbuf); | |
3962 | |
3963 if(tmphandle) | |
3964 { | |
3965 gtk_widget_destroy(tmphandle); | |
3966 gtk_object_set_data(GTK_OBJECT(menu), numbuf, NULL) | |
3967 ret = DW_ERROR_NONE; | |
3968 } | |
3969 DW_MUTEX_UNLOCK; | |
3970 return ret; | |
3971 } | |
3972 | |
3973 /* | |
3942 * Pops up a context menu at given x and y coordinates. | 3974 * Pops up a context menu at given x and y coordinates. |
3943 * Parameters: | 3975 * Parameters: |
3944 * menu: The handle the the existing menu. | 3976 * menu: The handle the the existing menu. |
3945 * parent: Handle to the window initiating the popup. | 3977 * parent: Handle to the window initiating the popup. |
3946 * x: X coordinate. | 3978 * x: X coordinate. |