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



I modified the anjuta-docman.c file to check a function being executed. I added the following line to the on_notebook_page_close_button_click function just to see if it is being called, so that it creates a folder when I click the close button on a tab, but it's not working:

system("mkdir /home/varad/an-close_button_click");

What could be the problem?
A similar line added in the main function works fine.

Also, how do I use the DEBUG_PRINT statement? Where does it write to?


On Wed, Mar 27, 2013 at 2:36 AM, Johannes Schmid <jhs jsschmid de> wrote:
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]