- From: Tor Lillqvist <tml sgic fi>
- To: gtk-devel-list redhat com
- Subject: argument types?
- Date: Wed, 8 Sep 1999 20:33:56 +0300 (FLE Daylight Time)
A person, whose name I won't reveal for now as I didn't ask permission
to forward this message, writes:
> I'm just working to compile "simple.c" with my preliminary port of GTK+
> to WIN16.
> window = gtk_widget_new (gtk_window_get_type (),
> "GtkObject::user_data", NULL,
> "GtkWindow::type", GTK_WINDOW_TOPLEVEL,
> "GtkWindow::title", "hello world",
> "GtkWindow::allow_grow", FALSE,
> "GtkWindow::allow_shrink", FALSE,
> "GtkContainer::border_width", 10,
> gtk_object_add_arg_type ("GtkContainer::border_width", GTK_TYPE_ULONG,
> GTK_ARG_READWRITE, ARG_BORDER_WIDTH);
> Is defined as being GTK_TYPE_ULING, thus 32-Bit, while "10" for a
> 16-Bit-Compiler means an int, thus 16-Bit. This causes the application
> to crash.
> In my opinion the right thing to do would be to change the type of
> GtkContainer::border_width and everything else related to
> pixel-coordinares to be of type int.
(Or "unsigned", in this case, I guess)
> In 32-Bit Systems this would still mean 32-Bit.
> What would other programmers think about that?
This would indeed seem logical to me, too. One would think the same
problem occurs on machines where integer literals are 32 bits and
GTK_TYPE_ULONG is 64 bits? Are there some other issues involved I
I guess porting GTk+ to Win16 does seem a little insane at first, but
apparently it isn't that hard (most difficulties are in GDK, where one
cannot simply reuse the Win32 code), and apparently this person does
have a good reason to do it... So, if relatively small (?) clean
changes like this are needed, I think they could be included in the
main sources. They probably will help when porting GTk+ to other, more
"politically correct" non-Unix environments, too.
] [Thread Prev