Re: GTK Widget assertion problem



On Thu, Jun 10, 2010 at 06:39:30PM +0200, Michael T. wrote:

Yes it does. I tried 10 other ways and they didn't work. This one
works perfectly (so far).
...

All initialization was shown in the previous examples. All my
initializations are taken directly from the GTK+ documentation and I
never had one problem. More people have been developing this very same
application and there was no problem until I needed to work with the
progress bar widget.
There is no static identifier used because it is not needed. The
extern identifier is used only, when the widget is accessed from other
files which is precisely what this identifier was designed for.
...

progressBarHack() does nothing with the layout. All it does is a
proper initialization of the global variable which should work without
the hack, but doesn't. 

To all this, I can only say: whatever.  There is very likely a bug in
your code.  Somewhere.  All information we have indicates this,
including the nonsensical `fix'.

Have you tried to run it under valgrind?

Why? I've personally read the first book on C called The C programming
language from 1978 written by the inventor of the language...

This book was written 11 years before the ISO C standard (and Gtk+ code
will not compile with a K&R C compiler so there's no point arguing that
you write in K&R C).  Please read something written in this millenium
about reasonable organisation of non-toy programs written in modern C.

I tried to do so in my first email (not the one you responded to). I
also mentioned that I use several widgets as global variables because
I need to access them from multiple functions. Hence, callbacks are
not sufficient, in my opinion.

I'm sorry, that was no more complete *compilable* and *runnable* example
than the excerpts with lots of ellipses in your other e-mails.  The bug
is not in the code you show us.  Some other broken code affects this
code or something else is broken on the global level.

There is also a tiny tiny tiny tiny tiny possibility that you discovered
a compiler bug.  Even if it is so we cannot tell from the information
you provide.

Because all we see is that you did an assignment and then the variable
contained something else than expected -- which probably has nothing to
do with Gtk+ specifically.

All the widgets are used as global variables due to reasons I have
explained.

Note that this is not how programs are structured nowadays but I will
not try to convince you any more, I will just wait untill your program
has 100k lines and collapses under its own weight...

Yeti




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