gnome-popup-menu brokenness



I have been doing a bit of hacking on gnome-popup menu, and in the process
found that it seems really broken/hackish.

The brokenness stems from two things:
1.	There is much confusion over the user_data that is passed to the
	callbacks. Normally you specify user_data at signal connect time
	(e.g. when the GnomeUIInfo is turned into a menu). But in this
	case, it is taking user_data when the menu popup is actually done.
	This is in an attempt to allow people to use one popup menu for
	many different widgets.

2.	gnome_popup_menu_do_popup_modal()

What I propose is:
1.	Instead of just using the 'activate' signal handler signature,
	change it to be:

void (*popup_menu_item_activate)(GtkWidget *menu_item,
				 GtkWidget *rightclicked_widget,
				 gpointer user_data);

	The user_data would be specified at menu creation time, and then
	if the developer wanted to get context-specific data, they would
	use gtk_object_get_user_data(rightclicked_widget)

2.	Eliminating do_popup_modal() altogether. This is used once each in
	gmenu, gnome-terminal, evolution, and gnome-fm, and three times in
	gmc (says lxr). I looked at gmenu and gnome-terminal, and they
	basically are just being a tad lazy when using this function.

Objections?
-- Elliot
Do not meddle in the affairs of dragons,
for you are crunchy and good with ketchup. 






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]