[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtkmm
Subject:    Re: Command line arguments
From:       Kjell Ahlstedt <kjell.ahlstedt () bredband ! net>
Date:       2013-11-24 12:42:44
Message-ID: 5291F444.9000401 () bredband ! net
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


2013-11-24 08:07, a skrev:
> Hi, I am trying to parse some command line arguments within my 
> program. This is what I have:
> 
> Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, 
> argv, "Math.Calculator.Fractions");
> 
> Math::Gui::MainWindow mw(argc, argv);
> 
> return app->run(mw);
> 
> when I run the program I get the error message:
> 
> "GLib-GIO-CRITICAL **: This application can not open files."
> 
> The only information I can find about command line arguments is using 
> Gio::APPLICATION_HANDLES_COMMAND_LINE flag and connect to 
> Gio::Application::signal_command_line().
> 
> Is there a simpler way?
> 
> Thank you.
> 
> 
The gtkmm tutorial shows two ways of handling command line arguments, 
but it's described in a place where you probably don't think of 
searching for it (I'm to blame for that):
https://developer.gnome.org/gtkmm-tutorial/stable/sec-multi-item-containers.html.en#boxes-command-line-options
 Look also at main.cc in the example after the description.

Gtk::Application ought to have a chapter of its own in the tutorial, but 
so far no one has taken the time to write that chapter. Much more than 
handling command line arguments ought to be described in such a chapter.

Kjell


[Attachment #5 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">2013-11-24 08:07, a skrev:<br>
    </div>
    <blockquote cite="mid:5291A59B.3010603@gmail.com" type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      Hi, I am trying to parse some command line arguments within my
      program. This is what I have:<br>
      <br>
      Glib::RefPtr&lt;Gtk::Application&gt; app =
      Gtk::Application::create(argc, argv, "Math.Calculator.Fractions");<br>
      <br>
      &nbsp;&nbsp;&nbsp; Math::Gui::MainWindow mw(argc, argv);<br>
      &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; return app-&gt;run(mw);<br>
      <br>
      when I run the program I get the error message:<br>
      <br>
      "GLib-GIO-CRITICAL **: This application can not open files."<br>
      <br>
      The only information I can find about command line arguments is
      using Gio::APPLICATION_HANDLES_COMMAND_LINE flag and <font
        color="#000000">connect to
        Gio::Application::signal_command_line().<br>
        <br>
        Is there a simpler way?<br>
        <br>
        Thank you.<br>
      </font> <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    The gtkmm tutorial shows two ways of handling command line
    arguments, but it's described in a place where you probably don't
    think of searching for it (I'm to blame for that):<br>
<a class="moz-txt-link-freetext" \
href="https://developer.gnome.org/gtkmm-tutorial/stable/sec-multi-item-containers.html \
.en#boxes-command-line-options">https://developer.gnome.org/gtkmm-tutorial/stable/sec-multi-item-containers.html.en#boxes-command-line-options</a><br>
  Look also at main.cc in the example after the description.<br>
    <br>
    Gtk::Application ought to have a chapter of its own in the tutorial,
    but so far no one has taken the time to write that chapter. Much
    more than handling command line arguments ought to be described in
    such a chapter.<br>
    <br>
    Kjell<br>
    <br>
  </body>
</html>



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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic