Re: Abiword Bonobo Control fonts

From: <msevior_at_physics.unimelb.edu.au>
Date: Wed Sep 28 2005 - 15:54:11 CEST

>
> Hi,
>
> I am using the abiword bonobo control embedded in a gtk application. I
> was wondering if it is possible to change the font style and size of the
> text while using the control. In was also wondering how to load a second
> or third file after i have loaded an initial file as it seems the
> control prevents the user from doing this. Any help is appreciated.
>
> Thank you,
> Stephen Asherson.
>

Hi Stephen,
           You're the first person to ask about the bonobo control in a
log time.

Have you got the AbiWord-SDK? Get it if you haven't and jump into the
AbiBonobo directory.

Look at the file:

test-abi2Container.c

It show how to send command to the AbiWord component. You do it via the
bonobo_pbclient_set_string(prop_bag,
                                            "AbiWidget--load-file",
                                            (gchar *) ptr[1], &ev);
and

bonobo_pbclient_set_boolean(prop_bag,
                                    s_command,
                                    TRUE, &ev);

functions.

We have defined a whole slew of properties to control AbiWord. You can
find them in the

abi/src/wp/ap/abiwidget.cpp

file in lines: 1684 -2333

The one to toggle italics is defined with this code:

 g_object_class_install_property(gobject_class,TOGGLEITALIC,
                g_param_spec_boolean("AbiWidget--toggleitalic",
                                   NULL,
                                NULL,
                                FALSE,
                                (GParamFlags) G_PARAM_READWRITE));

To invoke from your program you would call the function:

bonobo_pbclient_set_boolean(prop_bag,
                                    "AbiWidget--toggleitalic",
                                    TRUE, &ev);

Regarding loading a second file, I think you would first have to delete
the old abiword control and then create a new one in it's place, then load
the file into the new control.

Look at the "on_destroy(..)" function in test-abi2Container.c

Good Luck and feel free to keep asking questions! I'm delighted that
someone is finally playing with the bonobo control.

Cheers

Martin
Received on Wed Sep 28 15:54:26 2005

This archive was generated by hypermail 2.1.8 : Wed Sep 28 2005 - 15:54:26 CEST