Re: [gtk-list] Re: adding new signal in new class



Yasushi Shoji wrote:
> 
> From: Matt Goodall <mgg@isotek.co.uk>
> Subject: [gtk-list] Re: adding new signal in new class
> Date: Fri, 26 Nov 1999 10:09:39 +0000
> 
> > Yasushi Shoji wrote:
> > >
> > > hi all,
> > >
> > > Is there any Object Oriented Programming Language binding for Gtk+
> > > that allows programmer to add new signal in newly created class?
> > >
> > > e.g. create new subclass of HBox and add new signal called "new_sig".
> > >
> > > if not, is it possible to do so?  Just a quick search in gtk-list
> > > archive gave me an idea that gtk_object_class_add_signals() is the
> > > one. but that function needs GtkObjectClass* as first argument...
> >
> > Have a look at a program called "gob". You can find it at
> > www.freshmeat.net.
> >
> > It helps create new GTK+ objects easily by writing a .gob file and
> > running gob on it to produce the .c and .h files.
> 
> Thank you for the info.  but it seems to me that gob is a tool for C.
> 
> What I'm looking for is a OOP language binding for Gtk+ which allows
> programmer to create a sub class with language feature.
> 
> Does Ada95, C++, perl, or other OO language binding on the list of
> gtk.org allow programmer to to do that?  or first you have to create a
> sub class with C?

Sorry - I didn't quite grasp what you meant the first time. Let me have
another go...

You should be able to do this with Gtk-- (C++ langauge bindings). It
uses a signal framework called libsigc++ so it should be possible to add
a new signal to your derived class. "Clients" of your class can then
connect methods of 'C' functions to the signal.

I would recommend using the development release of Gtk-- available from
http://lazy.ton.tut.fi/terop/iki/gtk/development.html.

Is that any better? :-).

-- 
Matt Goodall             |  Isotek Electronics Ltd
email: mgg@isotek.co.uk  |  Claro House, Servia Road
Tel: +44 113 2343202     |  Leeds, LS7 1NL
Fax: +44 113 2342918     |  England



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