RSS/Atom feed Twitter
Site is read-only, email is disabled

How to edit context menu?

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

9 of 9 messages available
Toggle history

Please log in to manage your subscriptions.

How to edit context menu? Bear 19 Jun 14:29
  How to edit context menu? Michael Natterer 19 Jun 17:05
  How to edit context menu? Bill Skaggs 20 Jun 00:02
How to edit context menu? Bear 19 Jun 17:49
  How to edit context menu? Sven Neumann 19 Jun 22:31
How to edit context menu? Bear 21 Jun 02:46
How to edit context menu? Bear 21 Jun 02:49
  How to edit context menu? Bill Skaggs 22 Jun 00:45
How to edit context menu? Bear 26 Jun 16:52
Bear
2010-06-19 14:29:37 UTC (almost 14 years ago)

How to edit context menu?

hi,
I wanna edit my GIMP's context menu. Now the context menu is as seems as the menu bar. I wanna use my customized context menu to replace the original one. I found some clue in
app/widgets/gimpuimanager.c:573
which say:
void
gimp_ui_manager_ui_popup (GimpUIManager *manager, const gchar *ui_path, GtkWidget *parent, GimpMenuPositionFunc position_func, gpointer position_data, GDestroyNotify popdown_func, gpointer popdown_data)

but how to do next? thx!!

-------------- Bear
2010-06-19

Michael Natterer
2010-06-19 17:05:50 UTC (almost 14 years ago)

How to edit context menu?

On Sat, 2010-06-19 at 20:29 +0800, Bear wrote:

hi,
I wanna edit my GIMP's context menu. Now the context menu is as seems as the menu bar. I wanna use my customized context menu to replace the original one. I found some clue in
app/widgets/gimpuimanager.c:573
which say:
void
gimp_ui_manager_ui_popup (GimpUIManager *manager, const gchar *ui_path, GtkWidget *parent, GimpMenuPositionFunc position_func, gpointer position_data, GDestroyNotify popdown_func, gpointer popdown_data)

but how to do next? thx!!

Hi,

edit menus/image-menu.xml.in, there is no need to change anything in the source.

ciao,
--mitch

Bear
2010-06-19 17:49:58 UTC (almost 14 years ago)

How to edit context menu?

hi,
Er... but my work is to make it popup something like a new window instead the original context menu... Could you help me? thx!

------------------ Bear
2010-06-19

------------------------------------------------------------- From:Michael Natterer
Send Date:2010-06-19 23:05:54
To:Bear
CC:gimp-developer
Subject:Re: [Gimp-developer] How to edit context menu?

On Sat, 2010-06-19 at 20:29 +0800, Bear wrote:

hi,
I wanna edit my GIMP's context menu. Now the context menu is as seems as the menu bar. I wanna use my customized context menu to replace the original one. I found some clue in
app/widgets/gimpuimanager.c:573
which say:
void
gimp_ui_manager_ui_popup (GimpUIManager *manager, const gchar *ui_path, GtkWidget *parent, GimpMenuPositionFunc position_func, gpointer position_data, GDestroyNotify popdown_func, gpointer popdown_data)

but how to do next? thx!!

Hi,

edit menus/image-menu.xml.in, there is no need to change anything in the source.

ciao,
--mitch

Sven Neumann
2010-06-19 22:31:41 UTC (almost 14 years ago)

How to edit context menu?

On Sat, 2010-06-19 at 23:49 +0800, Bear wrote:

hi,
Er... but my work is to make it popup something like a new window instead the original context menu... Could you help me? thx!

Are you familiar with GTK+? If not, please read the documentation and tutorials before you ask here. We can certainly help you with GIMP specific questions, but I get the impression that you are lacking some fundamental GTK+ knowledge that is absolutely essential for what you are trying to achieve.

Sven

Bill Skaggs
2010-06-20 00:02:24 UTC (almost 14 years ago)

How to edit context menu?

If you want to do this for your new tool, you might benefit from looking at gimptexttool.c --
the function gimp_text_tool_get_popup is what sets up the context menu for the text
tool. It is invoked in the gimp_text_tool_class_init function, in the line that reads

tool_class->get_popup = gimp_text_tool_get_popup;

The code is pretty hard to understand without deep knowledge of the Gtk menu system,
though.

The actual contents of the context menu are where Mitch pointed you.

-- Bill

Bear
2010-06-21 02:46:15 UTC (almost 14 years ago)

How to edit context menu?

hi,
Maybe my poor english made you confused about my task? I have some knowledge on gtk+. My task is to response the right-click message on canvas. Is this clear? The original responding is to popup a menu which as same as the menubar. I wanna modify it. For example, to popup a message box or new window and so on.

------------------ Bear
2010-06-21

------------------------------------------------------------- From:Sven Neumann
Send Date:2010-06-20 04:31:11
To:Bear
CC:gimp-developer
Subject:Re: [Gimp-developer] How to edit context menu?

On Sat, 2010-06-19 at 23:49 +0800, Bear wrote:

hi,
Er... but my work is to make it popup something like a new window instead the original context menu... Could you help me? thx!

Are you familiar with GTK+? If not, please read the documentation and tutorials before you ask here. We can certainly help you with GIMP specific questions, but I get the impression that you are lacking some fundamental GTK+ knowledge that is absolutely essential for what you are trying to achieve.

Sven

Bear
2010-06-21 02:49:09 UTC (almost 14 years ago)

How to edit context menu?

hi,
thx for your help!!!
I will read the code you referred. Thx a lot. But it seems like that gimp_text_tool_get_popup is very complex...

------------------ Bear
2010-06-21

------------------------------------------------------------- From:Bill Skaggs
Send Date:2010-06-20 06:02:25
To:Bear
CC:gimp-developer
Subject:Re: [Gimp-developer] How to edit context menu?

If you want to do this for your new tool, you might benefit from looking at gimptexttool.c --
the function gimp_text_tool_get_popup is what sets up the context menu for the text
tool. It is invoked in the gimp_text_tool_class_init function, in the line that reads

tool_class->get_popup = gimp_text_tool_get_popup;

The code is pretty hard to understand without deep knowledge of the Gtk menu system,
though.

The actual contents of the context menu are where Mitch pointed you.

-- Bill

Bill Skaggs
2010-06-22 00:45:50 UTC (almost 14 years ago)

How to edit context menu?

It isn't as bad as it looks. The im_menu stuff all relates to a special submenu, and
you can discard it. The rest you can replicate as is (with the obvious changes).

Here is a quick summary of how to create a context menu for a tool:

1) Create a get_popup handler similar to gimp_text_tool_get_popup.

2) Create menu actions by creating a file similar to app/actions/text-tool-actions.c.

3) Create menu commands by creating a file similar to app/actions/text-tool-commands.c.

4) Define the menu structure by creating a file similar to menus/text-tool-menu.xml.

It should be possible to do most of this without a very deep understanding of the code.

-- Bill

Bear
2010-06-26 16:52:59 UTC (almost 14 years ago)

How to edit context menu?

hi,
I am very very thankful for your help!!! After 3 days working, I already done this job! Without your help, I wont finish it. Thx so much!

------------------ Bear
2010-06-26

------------------------------------------------------------- From:Bill Skaggs
Send Date:2010-06-22 06:45:50
To:Bear
CC:gimp-developer
Subject:Re: Re: [Gimp-developer] How to edit context menu?

It isn't as bad as it looks. The im_menu stuff all relates to a special submenu, and
you can discard it. The rest you can replicate as is (with the obvious changes).

Here is a quick summary of how to create a context menu for a tool:

1) Create a get_popup handler similar to gimp_text_tool_get_popup.

2) Create menu actions by creating a file similar to app/actions/text-tool-actions.c.

3) Create menu commands by creating a file similar to app/actions/text-tool-commands.c.

4) Define the menu structure by creating a file similar to menus/text-tool-menu.xml.

It should be possible to do most of this without a very deep understanding of the code.

-- Bill