Re: [gtk-list] gtk-- wrappers



Havoc Pennington <rhpennin@midway.uchicago.edu> writes:
> Hi Gtk-- guys,
> 
> For some code we're writing at work we're interested in having C++
> wrappers for some of Gnome and Gdk. Probably not the entire things but the
> parts we need anyway. I was playing with it today and had some questions:
> 
> - Just to check, has anyone already started this?

Not yet. Problem is that gensig needs changes and didnt have time yet to
do it :(

> - The constructors often need to do what the _new function would do 
>   but they can't call _new, sometimes resulting in a hideous
>   cut-and-paste. I noticed that some Gtk widgets have a _construct
>   method for this reason, e.g. CList. Is this considered a good solution, 
>   i.e. would it be reasonable to add _construct functions to gnome-libs
>   when appropriate?

It would be nice if gnome widgets used this too where the _new function
have much code.

> - What happens if a Gtk C object gets destroyed out from under the wrapper
>   class? e.g., say I click a GnomeDialog which causes it to be destroyed
>   in C. What will the C++ wrapper do in response, if anything? How does
>   Gtk-- solve this problem?	 

We dont allow this situation by increasing reference count at constructor.
and then deccreasing it at destructor. Only problem in gtk is the
delete_event signal - if people return wrong thing from that, it'll
break gtk--. :(

(this is one of the bugs in todo list - testme.cc example does show the bug...
=> result shows as black file selection dialog the 2nd time you create
fileselectiondialog...)

> - A TODO item is "Gnome widget support to gensig" - what does this involve
>   exactly? I can't see what would break on Gnome widgets glancing at 
>   it quickly, other than some hardcoded references to gtk-- directories.

Its basically changing gensig to handle naming convention used in gnome.
(gensig needs to call gtk functions and handle class structures and it
depends on quite many places that class structure name prefixes use Gtk...)

that should be made a command-line switch... shouldnt be too difficult to do
(cept that gensig code is completely horrible :)

> - Where would this go in CVS so it could use gensig and build nicely?

gensig is installed to your system when you install gtk--. 

Maybe we should create a directory under gtk-- module called gnome_widgets?

-- 
-- Tero Pulkkinen -- terop@modeemi.cs.tut.fi --



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