Keeping a dictionary of treerowreferences is the way to go. It makes keeping track of rows a breeze. You don’t have to worry about row locations changing over time as the treerowref keeps track of that automatically.
When you add a parent row to a treestore you get an iterator returned. …
If you want to set a cell to a pixmap, ok no problem, but what about setting individual liststore values to a pixmap? You can’t do it directly unless you’re using a gtk.STOCK_ image. Here’s a way around that little problem.
If you like the standard window decorations and dont need/want to create your own buttons to handle custom events, closing a dialog without destroying it is a simple one-liner in pygtk. This is helpful when you have logic that replaces individual widgets inside a dialog and you don’t want to recreate the whole dialog.
If you need this, you’re probably doing it wrong. But if you really must check to see if a variable has been assigned yet, there’s nothing really stopping you. Here’s one way of implementing it.
So you want to kill a thread… Dangerous. How about asking a thread to die instead? Of course it’s unsafe to just kill a thread dead in its tracks. What if the thread has some resource acquired or is controlling other threads itself? It’s much better to communicate with a thread and tell it to stop, then just wait for it to kill itself.
ou may have noticed gtk has stopped showing images for buttons by default. Many apps have not bothered to check the default settings and just assumed that defining an image for a button meant it would show. Too bad the gtk devs decided to change the default value. But never fear, for there is a way to make sure the image shows without modifying the system or user preferences outside of your application!
Using boost to convert one type to another. Take int8_t integer for example. Will this even work? No, because int8_t is a char. You will get a bad_lexical_cast exception. You must static cast to an integer type first:
With python 3 you can override the print function’s delimiter value to make it null or whatever else you want. But if you’re stuck with 2.5 or 2.6 like the rest of us, try this on for size. The only problem with this is when you want to use it like a progress bar. If you do this in a loop over time, you will get the expected output, but over time it won’t be the way you expected.
It doesn’t get much easier than this. However, you must add routes for static files such as style sheets and images. These are things that you may take for granted if you’re used to relying on standalone web servers.
You don’t need calculators or other languages and compilers to do math. You can do a lot in bash (GNU Bourne-Again SHell), and it’s really easy!