Re: [Gimp-developer] 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 ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
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 ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] 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 ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
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, GDestroyNotifypopdown_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 ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] 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, GDestroyNotifypopdown_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 ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
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 ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
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 ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer