glib: modular test fixtures?

2012-05-30 Thread Christopher Howard
Maybe I've just been up too late and am not thinking straight, but I suppose it doesn't hurt to ask... is there some way to use the Glib testing framework so as to have modular fixtures that could be combined or separated on a per-test basis? I'm staring at the API, but not seeing it. What I mean

GRegex regular expression failing to match

2012-05-14 Thread Christopher Howard
I'm trying glib's GRegex functionality for the first time, and apparently I am doing something wrong. I have some code like so: code: GError * error = NULL; GRegex * regex = g_regex_new (^/(d+)$, 0, 0, error); if (error != NULL) { // ... } GMatchInfo *

clarification: GErrors and GQuarks

2012-05-10 Thread Christopher Howard
Quick glib question here: I've been getting into glib's error reporting system and trying to integrate it into some code. (My code is using glib, but not GTK+ itself.) Overall it seems rather straightforward, but there was one point I was hoping for clarification on: In the g_set_error()

Crediting beta testers?

2012-04-13 Thread Christopher Howard
I've really appreciated how convenient the GtkAboutDialog class is and especially the gtk_show_about_dialog() function. The only thing that seems to be missing: There is a property for every basic kind of credit that could be given (authors, translators, artists, etc.) but no property for (beta)

desktop integration: program launcher entry and icon

2012-04-05 Thread Christopher Howard
This is not strictly speaking a gtk+ question, but I was hoping someone might help me out anyway: how do I go about integrating my application properly with the desktop, i.e., so that my program shows up with an entry and an icon in the application menu of Gnome, Xfce4, and all other compatible

glib: standard GLib types

2012-04-01 Thread Christopher Howard
Stupid noobish question here, but inquiring minds were wondering: is there any benefit to doing gint increment (gint) instead of int increment (int) It seems like the two are exactly identical, except that in the former case, you have permanently tied you function to glib. I can see

learning gtk+ well: Which book to buy?

2012-03-27 Thread Christopher Howard
Hi. I want to have a thorough and well-formed understanding of how to use gtk+, which I'm not quite getting from the API. What would be the best book I can buy right now? The most up-to-date book I see is Foundations of GTK+ Development (2007) but not having a lot of money to experiment with, I

Re: key press events holding keys down

2012-03-19 Thread Christopher Howard
On 03/19/2012 03:34 AM, Chris Vine wrote: Since GtkWidget objects have key-press-event and a key-release-event signals that you can connect to (and from your explanation, clearly you have connected to), you will probably need to explain why these don't do what you want in order to get a

Re: key press events holding keys down

2012-03-19 Thread Christopher Howard
On 03/19/2012 11:02 AM, Chris Vine wrote: On Mon, 19 Mar 2012 09:21:27 -0800 Christopher Howard christopher.how...@frigidcode.com wrote: On 03/19/2012 03:34 AM, Chris Vine wrote: Since GtkWidget objects have key-press-event and a key-release-event signals that you can connect to (and from

Re: key press events holding keys down

2012-03-19 Thread Christopher Howard
On 03/19/2012 12:49 PM, Chris Vine wrote: On Mon, 19 Mar 2012 20:35:33 +0100 David Nečas y...@physics.muni.cz wrote: On Mon, Mar 19, 2012 at 07:25:22PM +, Chris Vine wrote: Are you saying that on your hardware, holding one key down blocks press and release events for all other keys? I am

Re: key press events holding keys down

2012-03-18 Thread Christopher Howard
On 03/16/2012 04:29 PM, Christopher Howard wrote: I control the spacecraft with the arrow keys, which I do by grabbing the GdkEventKey and then checking it against GDK_KEY_Left, GDK_KEY_Right, and so forth. Strictly speaking what I am concerned with is whether or not the key is held down

key press events holding keys down

2012-03-16 Thread Christopher Howard
Hey guys -- thanks again for the help I received recently regarding several noobie issues. I'm still working on my space combat game, and came across this little problem: I control the spacecraft with the arrow keys, which I do by grabbing the GdkEventKey and then checking it against

cairo: multiple sprites images in one PNG

2012-03-15 Thread Christopher Howard
Question for the veterans: I'm coding a simple space combat game with GTK+. For the sprites, I know I can do this to draw: code: -- ship_surf = cairo_image_surface_create_from_png(ship.png); // ... cairo_set_source_surface (cr, ship_surf, x, y); cairo_paint (cr); -- But what if

Re: GtkDrawingArea size

2012-03-08 Thread Christopher Howard
On 03/08/2012 01:54 AM, Tadej Borovšak wrote: Hello. 2012/3/7 Christopher Howard christopher.how...@frigidcode.com: Hello again. So, I recently started a project to create a certain board game (in C) using gtk+, and I just started learning gtk+. I was planning to draw the board graphics

Re: GtkDrawingArea size

2012-03-07 Thread Christopher Howard
On 03/06/2012 02:08 PM, Christopher Howard wrote: Hello again. So, I recently started a project to create a certain board game (in C) using gtk+, and I just started learning gtk+. I was planning to draw the board graphics, pieces, etc. all into one GtkDrawingArea. So, how do I fix the size

Re: GtkDrawingArea size

2012-03-07 Thread Christopher Howard
On 03/07/2012 11:37 AM, Bernhard Schuster wrote: If you did not yet start implementing it, goocanvas might be another option to the bare stuff. goocanvas allows you to set a fixed paper size. I think the halign and valign properties are what I was looking for. It seems that, if I do an

noob question: g_signal_connect()

2012-03-06 Thread Christopher Howard
Hi. I've installed the api documentation from the source code for both gtk+ and glib, but I can't seem to find an api description of g_signal_connect(). The examples I usually see are along the lines of code -- g_signal_connect (G_OBJECT (button[0]), draw, G_CALLBACK