Fundamental question about main parameters...

View: New views
3 Messages — Rating Filter:   Alert me  

Re: Fundamental question about main parameters...

by Christopher Harvey-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Murray Cumming wrote:

> On Tue, 2009-06-30 at 16:10 +0200, Sever P A wrote:
>  
>> Hello,
>>
>> In my app. main.cc, there is something like...
>>
>> ---
>> int main(int argc, char *argv[])
>> {
>>    Gtk::Main kit(argc, argv);
>>    Class object;
>>    Gtk::Main::run (object);
>>    return 0;
>> }
>> ---
>>
>> It would seems a fundamental C++ programming question but, I'd like to
>> ask you for the best way  to transfer the main parameters values to
>> "Class" member vars...
>>    
>
> Glib::OptionContext makes this quite easy:
> http://git.gnome.org/cgit/glibmm/tree/examples/options/main.cc
>
>  

The boost program options library is also good, if you're ever not in a
gnome environment.
_______________________________________________
gtkmm-list mailing list
gtkmm-list@...
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Fundamental question about main parameters...

by Sever P A :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

In my app. main.cc, there is something like...

---
int main(int argc, char *argv[])
{
   Gtk::Main kit(argc, argv);
   Class object;
   Gtk::Main::run (object);
   return 0;
}
---

It would seems a fundamental C++ programming question but, I'd like to
ask you for the best way  to transfer the main parameters values to
"Class" member vars...

Could help ?

S.
_______________________________________________
gtkmm-list mailing list
gtkmm-list@...
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Re: Fundamental question about main parameters...

by Murray Cumming :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 2009-06-30 at 16:10 +0200, Sever P A wrote:

> Hello,
>
> In my app. main.cc, there is something like...
>
> ---
> int main(int argc, char *argv[])
> {
>    Gtk::Main kit(argc, argv);
>    Class object;
>    Gtk::Main::run (object);
>    return 0;
> }
> ---
>
> It would seems a fundamental C++ programming question but, I'd like to
> ask you for the best way  to transfer the main parameters values to
> "Class" member vars...

Glib::OptionContext makes this quite easy:
http://git.gnome.org/cgit/glibmm/tree/examples/options/main.cc

--
murrayc@...
www.murrayc.com
www.openismus.com

_______________________________________________
gtkmm-list mailing list
gtkmm-list@...
http://mail.gnome.org/mailman/listinfo/gtkmm-list