Re: Getting type/arg info without running a GUI?

On Tue, 12 Sep 2000, John Margaglione wrote:

> I am writing a command-line utility to parse glade
> files and write C header/source files.  I want to use
> the wonderful type and arg system built into
> GtkObject.  I have everything working great, except
> that I have to create a top-level window in order for
> calls to gtk_type_whatever to work.  Since my program
> is meant to be a utility that just creates output
> files from an input file, I really don't want a
> dependency on X.  

First of all, make sure you don't call gtk_init() or any other function
that calls gtk_init.  Instead, run gtk_type_init() to initialise the type
system.  You will probably also need to initialise the signal system
with gtk_signal_init().  You should then be able to call the 
gtk_xxxx_get_type() macros to get the type codes for the objects.  You may
need to call gtk_type_class() for the typecode of a widget before being
able to access its arguments (I am not sure about this one).

> I can get everything to work by just creating the
> top-level window but not showing it, but that still
> isn't ideal.  Is there are way to bypass creating a
> window to get type/arg information?
> Thanks in advance,
> John


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]