[GNC] GnuCash source code
John Ralls
jralls at ceridwen.us
Fri Nov 29 12:26:36 EST 2024
Shashi,
Ultimately it’s called from https://gitlab.gnome.org/GNOME/glib/-/blame/main/gobject/gobject.c?ref_type=heads#L850, but if you’re looking for an explicit invocation of gnc_main_window_init you’re not going to find it. The COject creation macro G_DEFINE_TYPE_WITH_CODE at https://github.com/Gnucash/gnucash/blob/555e23e8b5153eaa6decebdcf912a889c96e6328/gnucash/gnome-utils/gnc-main-window.cpp#L263 generates a structure of functions that includes a pointer to it. Note the parent class GTK_TYPE_APPLICATION_WINDOW in the macro call: that’s the next link in a chain that eventually ends with GObject and for initialization with _g_object_type_init. There’s actually another layer on top of that, GType, and _g_object_type_init is called from gtype.c in the same directory as gobject.c
This is early 1990’s object-oriented programming implemented with the C preprocessor instead of the compiler. If you’re comfortable with C++98 then you can study the GOject and Gtk tutorials and map it conceptually to C++. If not https://wiki.gnucash.org/wiki/C++#Developer_Preparation provides some material you can study.
Regards,
John Ralls
> On Nov 26, 2024, at 23:33, Shashi Kant Singh <shashikantsingh69 at gmail.com> wrote:
>
> Dear John
>
> Thank you for your response. Can you please tell the name of the file in
> which gnc_main_winodow_init method is called
>
> Thanks and regards
> Shashi Kant Singh
>
> On Mon, 25 Nov, 2024, 11:23 am Shashi Kant Singh, <
> shashikantsingh69 at gmail.com> wrote:
>
>> Dear Sir/Madam
>>
>> I am exploring the source code of gnucash but not able to figure out how
>> and when menus are created . Can anyone please figure out when this
>> function gnc_main_window_init is called in the source code. I am not able
>> to find the same
>>
>> Please do the needful
>>
>> Thanks and regards
>> Shashi Kant Singh
>>
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
More information about the gnucash-user
mailing list