Re: The big UTF8 changeover... (my 2¢)



Sorry for intruding, but I would like to add my 2
cents to the undef -> NULL debate.  And, I'll say in
advance I cannot submit patches for this, I'm digging
around in other things right now.  UNDEF -> NULL needs
to be supported where ever NULL is an acceptable
option in C.  Having something like -1 to NULL is self
defeating.

Background, I'm trying to write an install program for
a GTK ap I'm writting in Pascal.  Catch is, the
installer also has to install GTK on most Windows
systems, so I can not write the installer in GTK ;) 
And, I do not want to use a professional installer
package, because it is all GPL'd.  And, I want
something that can install Perl GTK applications on
Windows later.  So, I'm actually trying to write an
installer in Pascal to use the Win32 GUI Toolkit.

This is quite a messy experience, no real
documentation even.  Microsoft will not publish any
real documentation of the API except for very wealthy
clients, and the FreePascal people refuse to even try.
 The FP people think I should somehow be using GTK
still....  Now, I did get Pascal GTK to run off of a
CD, just put GTK on the cd and has autorun.ini call a
batch file which set the path to include the GTK dir
and then call installer, but that isn't really
possible for online downloads, where you don't have a
controlled environment like you do on a CD.  (Anyone
ever tried to autorun Perl GTK on Windows from a CD on
a system without GTK?  Without Perl?  I keep meaning
to try.)

One problem I am running into, is that most Win32 GUI
functions and commands not only accept but expect NULL
in certain cituations.  For example, the
RedrawWindow(hWindow, r, 0, RDW_INTERNALPAINT or
RDW_INVALIDATE or RDW_UPDATENOW);  For the third
option (0, handle of update region), most people use
NULL in C to update the whole window.   And, I can not
find any Pascal examples, I am using the Borland C++
documentation.  So, here is a case where NULL is
expected, and NIL is not wrapped to it (in some other
places it is).  But, in the end I did not get
RedrawWindow working at all.  Instead, I am using
InvalidateRect(hWindow, NIL, TRUE);
              UpdateWindow(hWindow);
WHERE NIL IS TRANSLATED.

So, in Perl GTK, undef -> NULL needs to be supported
where ever NULL is possible in C GTK.  Nothing else
makes sense.  And, for the lesser documented
procedures, where the only documentation is for the C
code, UNDEF -> NULL is essential.

Feel free to see some of the code I am referring to at
http://www.geocities.com/critter_75075/ .  The Pascal
Win32 API code installer isn't there yet, doesn't work
right.  I'm fighting with file selection widgets
now....  The Pascal I'm using is at
http://www.freepascal.org/ .

Sincerely,
     Andrew Robertson

--- Guillaume Cottenceau <gc mandrakesoft com> wrote:
Christian Borup <borup borup com> writes:

The problem is that generally that no typemap have
been used until now.
And a lot of functions just take SV*'s rather than
gchar*'s, most I hope
with good reason. But it make it quite hard to
find all the spots that
need fixing.

Most of the times, I've used it when we want a gtk
function to be
potentially called with NULL as a gchar* argument.
Then, using
"undef" (testing for PL_sv_undef in the c file) is
far more
elegant/perlish than using 0, IMHO.

-- 
Guillaume Cottenceau -
http://people.mandrakesoft.com/~gc/
_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/



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