Commit 7fef9404 authored by George Lebl's avatar George Lebl

tried to make menu popup-like, but it doesn't work! - George

parent 0dcdb1ad
......@@ -225,6 +225,7 @@ init_user_panels(void)
/*FIXME: this should be made cleaner I guess*/
if(!root_menu) init_main_menu(panel);
panel_menu = create_panel_root_menu(PANEL_WIDGET(panel));
gtk_signal_connect(GTK_OBJECT(panel),
"button_press_event",
......
......@@ -326,13 +326,17 @@ destroy_menu (GtkWidget *widget, gpointer data)
g_free(menu);
}
void
activate_menu (GtkWidget *widget, gpointer data)
/*FIXME: this is starting to piss me off it doesn't work as it should*/
static gint
menu_button_press(GtkWidget *widget, GdkEventButton *event, gpointer data)
{
Menu *menu = data;
gtk_menu_popup (GTK_MENU (menu->menu), 0, 0, menu_position, data,
1, 0);
if(event->button==1) {
gtk_menu_popup(GTK_MENU(menu->menu), 0,0, menu_position,
data, event->button, time(NULL));
return TRUE;
}
return FALSE;
}
void
......@@ -597,8 +601,8 @@ create_panel_menu (GtkWidget *window, char *menudir, int main_menu,
} else {
menu->menu = create_menu_at (window, menudir, 0);
}
gtk_signal_connect (GTK_OBJECT (menu->button), "clicked",
GTK_SIGNAL_FUNC (activate_menu), menu);
gtk_signal_connect (GTK_OBJECT (menu->button), "button_press_event",
GTK_SIGNAL_FUNC (menu_button_press), menu);
gtk_signal_connect (GTK_OBJECT (menu->button), "destroy",
GTK_SIGNAL_FUNC (destroy_menu), menu);
......@@ -610,10 +614,20 @@ GtkWidget *
init_main_menu(GtkWidget *window)
{
GtkWidget *app_menu;
char *menu_base = gnome_unconditional_datadir_file ("apps");
char *menudir;
menudir = g_concat_dir_and_file (menu_base, ".");
g_free (menu_base);
if (!g_file_exists (menudir)) {
g_free (menudir);
return NULL;
}
root_menu = create_menu_at(window,".",0);
app_menu = create_menu_at (window, ".", 1);
root_menu = create_menu_at(window,menudir,0);
app_menu = create_menu_at (window,menudir, 1);
add_special_entries (root_menu, app_menu);
g_free (menudir);
}
Menu *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment