Menu

How to find GUI entries in the source code

Jonathan
2016-12-13
2016-12-13
  • Jonathan

    Jonathan - 2016-12-13

    Hi everybody. For a project, I need to exactly know, what some code in Gwyddion is doing to my images. For that reason, I would like to have a look in the source code and follow along the lines belonging to one entry. In my example, I would like to know, what the Correct Data -> Align rows entry in the menu is exactly doing, dependent on the parameters, but I would like to ask this question in general so:
    How is it possible to find the exact block of code, that will be run, when I click on a menu entry?

     
  • David Nečas

    David Nečas - 2016-12-13

    In general by starting from the menu construction code in app/menu.c, finding the callback invoked by the specific menu item and following the code from there.

    For the typical case, i.e. the menu item runs some module function and you are not interested in the GUI stuff and bookkeeping that wraps its execution, it is simpler. You start with the on-line module list and find the menu path, which gives you the module name. So you find the module in the source code tree and follow from there. It helps to understand how modules are structured, of course.

     

Log in to post a comment.