Re: [gtk-list] Re: Perl/Gtk CVS 19990914



Paolo Molaro wrote:
> 
> On Mon, Sep 20, 1999 at 03:35:23PM +0000, Dermot Musgrove wrote:
> > > You guessed it: it's 'Open' :-)
> > > Consult the gnome-stock.h header. I may write a script that gets
> > > the strings from there and adds another chapter to the documentation.
> > Is there any chance of generating a module like Gtk::Keysyms?
> > Perhaps it is not easy or desirable but the conversion of 
> > [GTK|GDK|GNOME]_ CONSTANTs to 'string values' has tripped me up so many 
> > times .
> 
> There is no point in adding a module for stock names: you have
> to lookup them in the documentation or in the header files.
> Keysyms are different in that you want to relate keysym and keyval.
My problem is that I am converting from the C constants (eg 
'GNOME_STOCK_BUTTON_OK'  to "Button_Ok") on the fly. I can't see an easy
and reliable way to do the conversion without a lookup, especially when
sometimes underlines translate to spaces and 'OK' translates to 'Ok'.

The GTK constants are simpler because they are (mostly) lower case versions
of the unique part of the constant name (eg 'GTK_WIN_POS_CENTER' converts 
to 'center')

I have cut-and-pasted the header #defines into my module but I will have the
same problems as Perl/Gtk when they change. This was why I asked about a
Gtk::Enums and Gnome::Enums package that could be generated from the header
files when Perl/Gtk was built. 

My apologies if I have misunderstood what you were saying above.

Regards, Dermot




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