init Gtk; doesn't handle switches understood by Gtk and Gdk correctly



 Hi,

 There is another problem with the latest GtkPerl - after calling
         init Gtk; 

 the @ARGV will be severely corrupted if some options handled by gtk (e.g.
--display, --name, --class, etc) are NOT BEFORE all other options.) The reason
is the last statements in the given fragment in Gtk.xs:

----------------------------
                        i = argc;
#if GTK_HVER >= 0x010110
                        if ( ix == 1 && !gtk_init_check(&argc, &argv) ) {
                                XPUSHs(sv_2mortal(newSVsv(&PL_sv_undef)));
                                if (argv)
                                        free(argv);
                                GtkInit_internal();
                                XSRETURN_UNDEF;
                        } else if ( ix == 0 ) {
                                gtk_init(&argc, &argv);
                        }
#else
                        gtk_init(&argc, &argv);
#endif
                        XPUSHs(sv_2mortal(newSViv(1)));

                        pgtk_did_we_init_gtk = 1;
                        pgtk_did_we_init_gdk = 1;

                        while(argc<i--)
                                av_shift(ARGV);
-------------------------
 - the code silently assumes that all g[dt]k-specific commandline options are
before all others..

 This should be at least noted in the FAQ IMHO, or better fixed.

 Best regards,
  -Vlad




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