|
From: <kr_...@us...> - 2003-04-01 23:54:23
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv606/port/src/cbits/GTK
Modified Files:
Menu.c
Log Message:
Implementation for SDI/MDI menu
Index: Menu.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Menu.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Menu.c 26 Mar 2003 12:59:24 -0000 1.4
--- Menu.c 1 Apr 2003 23:54:20 -0000 1.5
***************
*** 4,16 ****
#include "Handlers_stub.h"
! MenuHandle osCreateMenuBar(WindowHandle window)
{
! GtkWidget *menuBar = gtk_menu_bar_new();
! gtk_box_pack_start(GTK_BOX(GTK_BIN(window)->child), menuBar,FALSE, TRUE, 0);
! gtk_widget_show(menuBar);
! return menuBar;
};
! MenuHandle osAddSubMenu(MenuHandle parent, char *title)
{
gchar *szText = toMnemonicString(title);
--- 4,27 ----
#include "Handlers_stub.h"
! GtkWidget *gMenuBar = NULL;
!
! static MenuHandle getMenu(MenuHandle parent)
{
! if (!parent)
! {
! if (!gMenuBar)
! {
! gMenuBar = gtk_menu_bar_new();
! gtk_box_pack_start(GTK_BOX(GTK_BIN(gFrameWidget)->child), gMenuBar, FALSE, TRUE, 0);
! gtk_widget_show(gMenuBar);
! }
!
! parent = gMenuBar;
! }
!
! return parent;
};
! MenuHandle osAddMenu(MenuHandle parent, char *title)
{
gchar *szText = toMnemonicString(title);
***************
*** 20,24 ****
rfree(szText);
! gtk_menu_shell_append(GTK_MENU_SHELL(parent), menuItem);
gtk_widget_show(menuItem);
return popUpMenu;
--- 31,35 ----
rfree(szText);
! gtk_menu_shell_append(GTK_MENU_SHELL(getMenu(parent)), menuItem);
gtk_widget_show(menuItem);
return popUpMenu;
***************
*** 35,39 ****
NULL);
! gtk_menu_shell_append(GTK_MENU_SHELL(parent), menuItem);
gtk_widget_show(menuItem);
return menuItem;
--- 46,50 ----
NULL);
! gtk_menu_shell_append(GTK_MENU_SHELL(getMenu(parent)), menuItem);
gtk_widget_show(menuItem);
return menuItem;
***************
*** 63,67 ****
NULL);
! gtk_menu_shell_append(GTK_MENU_SHELL(parent), menuItem);
gtk_widget_show(menuItem);
return menuItem;
--- 74,78 ----
NULL);
! gtk_menu_shell_append(GTK_MENU_SHELL(getMenu(parent)), menuItem);
gtk_widget_show(menuItem);
return menuItem;
***************
*** 71,75 ****
{
GtkWidget *item = gtk_separator_menu_item_new();
! gtk_menu_shell_append(GTK_MENU_SHELL(parent), item);
gtk_widget_show(item);
}
--- 82,86 ----
{
GtkWidget *item = gtk_separator_menu_item_new();
! gtk_menu_shell_append(GTK_MENU_SHELL(getMenu(parent)), item);
gtk_widget_show(item);
}
|