Re: [PATCH] Gtk2.xs (gtk_init): do gtk_init_check in PL_minus_c mode

On May 24, 2009, at 2:49 PM, Torsten Schoenfeld wrote:

[CC'ing the mailing list for input.]

Alexey Tourbin wrote:
I'm not sure if this patch can be applied as is, but there is a problem
with gtk_init.
gtk_init will terminate the program if the GUI cannot be initialized.
This can make syntax check impossible, which is too bad a consequence.
Hack gtk_init to invoke gtk_init_check in syntax check mode.

I'm ambivalent about this. It fixes a real issue, but it does so by altering behavior in a way that doesn't seem completely safe. On the other hand, I can't think of any case where this change would cause undesired effects. Can you, gtk-perl-list?

If we're in check mode, no code is supposed to execute. Since it behaves this way currently, it's broken and unusable. So, making the change would enable new stuff. Good.

If we're not in check mode, which is how all existing code currently works, this should change nothing. Good.

You could make the change explicit and give a special case for "-c":

        if (ix == 2) {
                RETVAL = gtk_init_check (...);

        } else if (PL_minus_c) {
/* And here's a nice place to comment on the rationale... */ warn ("In syntax check mode, calling gtk_init_check() instead of gtk_init()";
                RETVAL = gtk_init_check (...);

        } else {
                gtk_init (...);

The stereo, playing the Beastie Boys' "Rhymin' and Stealin'": "I'll steal your girlie like I stole your bike!"

Elysse:  "You mean, take off the chain and ride away?"

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