Re: App exits with extra param - bug or feature?



Thanks a lot, it works.
However, I mildly hope that whoever envisioned this sophisticated, weird, punishing (by exiting your app) and over-engineered solution for a non-problem (argument access) needs to get itself together and do something about it cause this type of approaches are exactly what app developers don't need nor like.

(sorry for the personal post, it's gmail's default behavior).


On Mon, Nov 19, 2012 at 4:30 PM, Kjell Ahlstedt <kjell ahlstedt bredband net> wrote:
2012-11-19 03:45, Jiergir Ogoerg skrev:
Hi, this is a reply to
https://mail.gnome.org/archives/gtkmm-list/2012-October/msg00047.html

Thanks, but can you please post a /working/ example that handles an argument from the command line?
I think gtkmm is (still) broken on this one, I followed your instruction and it still failed.

Using Ubuntu 12.10 which ships with gtkmm 3.5.13


The attached example works, i.e. it shows the window. I had to read some of glib's source code in order to understand that the signal_command_line() handler is called only if it is run before the default signal handler. I can't find that peculiarity mentioned in the glib documentation, and if it's not mentioned there, it's understandable that it's not mentioned in the documentation of Gio::Application.

An alternative way to handle command line parameters would be to handle them in main(), adjust argc and argv[] accordingly before they are given to Gtk::Application::create() (i.e. remove the handled parameters), and call Gtk::Application::create() without the Gio::APPLICATION_HANDLES_COMMAND_LINE flag.

Kjell



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