Re: [anjuta-devel] A "Close All But This" Feature for Tabs



Hi Varad!

I want to add a "Close All But This" menu item that appears in the
right click menu for editor tabs (or make a menu appear on middle
mouse press on a tab, which I think would be better), that lets users
do the same if they have multiple editor tabs open. I would like to
have your opinions.

Please keep it in the right-click menu - a middle-click menu is nothing
that is expected to exist in any gnome application.

Here's what I think I need to do:
- Modify the 'on_notebook_tab_btnpress/btnrelease' function in the
file anjuta-docman.c and add a 'gtk_notebook_remove_page' call to
remove the tabs.

However, I still need to figure out how to make a menu appear, which
shouldn't be a problem.

The menu is defined in the .xml file together with the data given in the
plugin.c file (the big arrays defined in the front of the file). You can
simply add another menu item there together with necessary seperators.

The callback (and code) for closing all other tabs already exists (see
the menu item in the "Document" menu) and is defined in
action-callbacks.c (IIRC). So you just have to add the callback for the
new menu item in the array.

Regards,
Johannes



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