Re: Glib::OptionsContext



On Tue, 2006-09-26 at 08:53 -0500, Jonathon Jongsma wrote:

> I've been thinking about writing up a little tutorial about that for a
> while, but havent' gotten around to it yet.  Of course, I've only used
> it for very basic option parsing, so I'm sure I have more to learn as
> well.  In any case, if you want you can take a look at the
> 'src/main.cc' file from my agave app if it helps at all (see
> http://home.gna.org/colorscheme/).  if you need something more, you
> could also try trawling through some other application code (see
> http://gtkmm.org/extra.shtml for a list of applications that use
> gtkmm).

Your use is very like what I deduced, it is good to know I am not
completely off the rails.  The whole think seems a bit icky though.
Having to have a method call for every parameter for an option seems
wrong -- GTK+ use of GOptionEntry[] is arguably better.  Xfce Foundation
Classes also seems to have a better way of doing things on this front.

In another context, I have been looked at Boost.Program_options and that
has some seriously cool use of function overloads to make things even
nicer.  It strikes me that GTKmm could usefully lift ideas from there to
work with GOptions.  (cf.
boost::program_options::options_description::add_options)

Alternatively, optparse in Python or optparse in Ruby may provide
inspiration.

It strikes me that this options area of GTKmm is under-documented not
only in terms of tutorials and examples but also  in terms of reference
documentation and Google index hits!  Any material you put together
would be massively helpful.

> Hope that helps.

Certainly did, thanks muchly.

-- 
Russel.
====================================================
Dr Russel Winder                +44 20 7585 2200
41 Buckmaster Road              +44 7770 465 077
London SW11 1EN, UK             russel russel org uk

Attachment: signature.asc
Description: This is a digitally signed message part



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