Re: Creating SubMenus
- From: Angelo Cano <acano systec com>
- To: gtk-app-devel-list gnome org
- Subject: Re: Creating SubMenus
- Date: Wed, 6 Dec 2000 04:38:46 -0500
On Sat, Dec 02, 2000 at 03:41:36PM -0300, Nicolas Raitman wrote:
I have been trying to do what I told you:
<---MenuBar
Edit <---Menu
Font <---SubMenu
Italics <---Italics
Bold <---Bold
Do you understand... I have done the following but I have many mistakes, I
mean, it does not work.. can you look at the code to see what is going wrong
please??
I put all the code just in case, but look at the functions to create menus
and what other thing should I add to create what I described above...
[snip]
int main (int argc, char * argv [])
{
struct objetos * widget;
GtkWidget *submenu;
[snip]
widget->editmenu = CreateRootMenu(widget->editmenu);
widget->editlabel = CreateRootMenuLabel(widget->editlabel, "Edit");
widget->fontlabel = CreateRootMenuLabel(widget->fontlabel, "Font");
widget->fontmenu = CreateRootMenu(widget->fontmenu);
reordering this
#if 0
widget->fontitalics = CreateMenuItem(widget->fontitalics,
widget->fontmenu,
NULL,
"",
"Italics",
"",
NULL,
NULL);
#endif
AddMenuToMenuBar(widget->filelabel, widget->filemenu, widget->menubar);
AddMenuToMenuBar(widget->editlabel, widget->editmenu, widget->menubar);
submenu = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (widget->editlabel), submenu);
gtk_menu_append (GTK_MENU (submenu), widget->fontlabel);
submenu = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (widget->fontlabel), submenu);
widget->fontitalics = CreateMenuItem(widget->fontitalics,
submenu,
NULL,
"",
"Italics",
"",
NULL,
NULL);
AddBoxToTable(widget->table, widget->vbox, 0, 4, 0, 4);
gtk_widget_show(widget->table);
gtk_widget_show(widget->vbox);
gtk_container_add(GTK_CONTAINER(widget->windowmain), widget->table);
gtk_widget_show(widget->windowmain);
gtk_main();
return 0;
}
[snip]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]