Archive for the ‘gtk’ Category

gtk project directory structure

December 9, 2008

every project share something in common. That something in common save us lazy programmer a lot of time. Here is a nice article about this

common project directory structure
project with i18n

gnome applet tutorial

November 18, 2008

Here is a very interesting tutorial on how to create your own applet.

gnome applet tutorial

GtkDataBox – plotting data

November 5, 2008

GtkDatabox is a widget for the Gtk+-library designed to display large amounts of numerical data fast and easy. One or more data sets of thousands of data points (X and Y coordinate) may be displayed and updated in split seconds.

gtkdatabox homepage
simple tutorial on gtkdatabox

glibcurl

October 30, 2008

very interesting curl library binding using glib. It make life easier to use http in gtk program

more info
Official libcurl website

how to change label font color

October 16, 2008

by using gtk_label_set_markup()

or

GdkColor color;
gdk_color_parse("red", &color);
gtk_widget_modify_fg(widget, GTK_STATE_NORMAL, &color);

more about pango markup format

new gtkimageviewer

October 10, 2008

From Dov Grobgeld

a major rewrite (using gob2 actually) where the image annotation model has been changed so that the image is provided to the user of the widget before it is drawn to the screen.

gtkimageviewer tutorial

how to display busy cursor

October 8, 2008

interesting post on gtk-app-devel-list@gnome.org mailing list

void busy_stuff ()
{
GdkDisplay *display;
GdkCursor *cursor;
GdkWindow *window;
gint x, y;

cursor = gdk_cursor_new(GDK_WATCH);

display = gdk_display_get_default();
window = gdk_display_get_window_at_pointer(disp, &x, &y);

gdk_window_set_cursor(window, cursor);
gdk_display_sync(display);
gdk_cursor_unref(cursor);

/* do time-consuming stuff here */

gdk_window_set_cursor(window, NULL);
}

gdk_cursor_unref() prevent memory leak

Mailing list archive

gtk tutorial

October 6, 2008

Gtk is a very powerful GUI programming toolkits. Here is a few interesting website to look at

gtk forums
Gtk Summary by Michael Foerster

Using g_value_get_*

October 4, 2008

using GValue related function is quite tricky. It is not working if you do

GdaDataModel *dm;
gint i;
i = g_value_get_int ( gda_data_model_get_value_at (dm, 0, 0));

For upcomming Version 4.0 (the main difference is at GdaDataModel API)

GdaDataModel *model;
const GValue *integer;
GError *error = NULL;

integer = gda_value_new (G_TYPE_INT);
integer = gda_data_model_get_value_at (model, 0, 0, &error);

/* All values in a Data Model must be unmodificable then use const GValue, this
will avoid compilation warnings */

Or can use (gda_value_new makes this for you :-)
integer = g_new0 (GValue. 1);
g_value_init (inteteger, G_TYPE_INT);

thank to Daniel Espinosa

Undefine reference to

October 2, 2008

Header file and function on separate file should not have the static function declaration.

static void loan_new_record (gpointer data);
static void loan_display_reset ( GtkWidget *data);

to

void loan_new_record (gpointer data);
void loan_display_reset ( GtkWidget *data);

read more