Problems changing Loan Druid- Amendment to Glade or glade-fixup?

John Ralls jralls at ceridwen.us
Sun Apr 17 11:55:00 EDT 2011


On Apr 17, 2011, at 8:01 AM, Nick wrote:

> I had a look at the conversion but I just couldn't get gtkbuilder to pull the new assistant object out of the glade file in gtkbuilder folder.
> 
> The lines I am using in druid.c are:
> 
> #define SX_GLADE_FILE "sched-xact.glade"
> #define LOAN_DRUID_GLADE_NAME     "Loan Assistant"
> 
> GtkBuilder *builder;
> GtkAssistant *assistest;
> 
> builder =  gnc_builder_add_from_file (SX_GLADE_FILE, LOAN_DRUID_GLADE_NAME);
> assistest = GTK_ASSISTANT (gtk_builder_get_object (builder, LOAN_DRUID_GLADE_NAME));
> 
> and then fails on
> 
> g_assert (assistest !=NULL); before I even try to do anything with it.
> 
> Any hints on what else needs to be changed just to get this bit to work? Is there another file that tells it to look in gtkbuilder not glade (I thought that was what gnc_builder_add_from_file was supposed to sort out?)
> Probably a total noob error but can't think what I am missing (Getting frustrated as have trawled hard through the file to get it to compile, still a lot more work to go though.) I have checked that the new sched-xact.glade is appearing in unstable/share/gnucash/gtkbuilder
> 
> 
> (And the start of the additions to the sched-xact.glade file:
> <object class="GtkAssistant" id="Loan Assistant">
> <property name="border_width">12</property>
> <property name="title">Loan and Mortgage Repayment Setup</property>
> <child>
> <object class="GtkLabel" id="loan_intro_pg">
> <property name="visible">True</property>
>        ....)

Are you getting the warning (probably in your gnucash.trace unless you've set logging to go to STDERR) "Couldn't load builder file"? If not, then it's loading the file OK but not finding the Loan Assistant object.

If you are getting the warning, it will explain why the  file didn't load.

Also, you should change the name of your new file to something like "loan-assistant.[ch]". "druid.[ch]" is both too generic and reflects the old libgnome term rather than the current gtk+ one.

Regards,
John Ralls



More information about the gnucash-devel mailing list