Re: Memory leaks

2011-02-09 Thread Jeff Clough
On Wed, 2011-02-09 at 17:22 -0500, Allin Cottrell wrote:

 I'm afraid you're talking through your hat here. Have your ever
 worked through the code for even a simple shared library that
 saves state?  Freeing all memory on exit can be useful as a
 debugging exercise (e.g. if you get a segfault that tells you
 something), but aside from that it's a pure waste of CPU cycles.

And the fact that so many shared library hackers have this view is the
reason modern desktops need to ship with four gigs of RAM minimum and
still can't stay up for more than a week.

Jeff

-- 
web:  http://www.chaosphere.com
Author of Genesys, a Free Universal Paper and Pencil RPG.
http://www.chaosphere.com/genesys/

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Notebooks and page numbers

2010-08-02 Thread Jeff Clough
Reading the docs, it looks like every page of a notebook has a
zero-based index number I can easily retrieve.  It also look like there
are ways to re-order the pages in a notebook which may, or may not,
change the indexes of these pages.

What are the rules as to how these pages are numbered and how those
numbers can be altered?  If I have four pages and the second one gets
removed, do I now have pages with indexes 0, 1 and 2?  Are there any
situations where the numbers of these pages would be changed out from
under me?  Any guidance here would be great.

Jeff


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Notebooks and page numbers

2010-08-02 Thread Jeff Clough
On Mon, 2010-08-02 at 20:22 +0800, Gregory Hosler wrote:

 a pages page number can and will change whenever it's position in the number
 sequence 0 to N-1 changes.

Are there situations where something internal to GTK will change this?
To be more specific, if I'm interested in page 2 (and have that page
number in a variable somewhere) and *I* don't make any changes to the
page order, delete or add any pages, is it safe to assume it will
*always* be page 2?

 It's not so hard a concept, and is the only way that makes any sense when you
 think about it from a development / implementation point of view.

I'm don't recall saying it's hard, but the docs don't answer my specific
questions.  As for this being the only way that makes any sense, we'll
see how hard I get shafted by it.

Does GTK perhaps have another way to represent what most people call
tabs in an application?

Jeff


-- 
web:  http://www.chaosphere.com
Author of Genesys, a Free Universal Paper and Pencil RPG.
http://www.chaosphere.com/genesys/


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Notebooks and page numbers

2010-08-02 Thread Jeff Clough
On Mon, 2010-08-02 at 15:11 +0200, David Nečas wrote:

 Anyway, if you need to maintain an association if the tabs do change you
 can use a widget name → widget map for page identification (easy with
 names set in Glade or simply using object-data on the notebook) and
 gtk_notebook_page_num() to look up the page number if you have the
 widget.

Do you have a handy link to where this would be documented or otherwise
further explained?  It sounds precisely like what I was looking for
earlier but couldn't find (library.gnome.org is not so much with the
working for me right now).

For what it's worth, I'm not using Glade.

Thanks!

Jeff

-- 
web:  http://www.chaosphere.com
Author of Genesys, a Free Universal Paper and Pencil RPG.
http://www.chaosphere.com/genesys/


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: problem with compiling different C files with a global structure

2010-05-11 Thread Jeff Clough
Debmalya Sinha sunnywiz...@gmail.com writes:

 Hello, 

 Though this might not be the place for this type of query, this problem I'm
 giving here is a simplest scale version of a problem when I am trying to split
 up a large gtk source code of mine.

First...

http://www.catb.org/~esr/faqs/smart-questions.html

Second...

Every piece of your code that wants to fondle that global needs two
things.  It needs to know the structure's definition and it needs to
know that the global exists.

Does every piece of your code have access to this information?

Are you getting compilation errors or linking errors?  Which you are
getting and where they are comming from will tell you precisely why your
build is failing.

Maybe you should hack out a minimal test-case with two .c files and one
common header and see if your assumptions about how this works are
correct.  It will be easier for you to debug the problem if you boil it
down.

This *is* a very basic C question you should already know the answer to
before you start playing with something like gtk.  If your understanding
of extern et al is sketchy, I can't imagine life being happier for you
once you start getting into the pointers, callbacks and signal/event
handling that forms the core of gtk.

For what it's worth.

Jeff
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list