Maemo icon

RT @http://thpinfo.com/2008/02/maemo-icon-sizes.html I had a hard time finding out which icon sizes one has to provide and where to install them for Maemo applications (I’m currently developing for OS2008 “chinook”, might be different for other releases). Here is what I found out by looking at the contents of other GUI packages: 26x26 icon goes to /usr/share/icons/26x26/hildon/appname.png 40x40 icon goes to /usr/share/icons/40x40/hilson/appname.png 64x64 icon goes to /usr/share/icons/scalable/hildon/appname.png The 64x64 icon will be used in the menu, so be sure to make it really 64x64, otherwise the icon will look out of place in the menu. Also, be sure to create an executable “postinst” file in the “debian/” subdirectory of your package source that has at least the following two commands: gtk-update-icon-cache -f /usr/share/icons/hicolor maemo-select-menu-location appname.desktop Where of course “appname” is the name of your application and how you named your icon and ....

2009-10-13 · wuan

gtk-update-icon-cache

GTK+ can use the cache files created by gtk-update-icon-cache to avoid a lot of system call and disk seek overhead when the application starts. Since the format of the cache files allows them to be mmap()ed shared between multiple applications, the overall memory consumption is reduced as well.

2008-02-28 · wuan

Get ascii code from GdkEventKey-Keyval

FROM: http://mail.gnome.org/archives/gtk-app-devel-list/2003-December/msg00352.html gdk_keyval_name() which converts a key value to a symbolic name, or gdk_keyval_from_name(), which converts a key name to an actual keyvalue.

2007-08-12 · wuan

Load a background image in a Gtk Window

FROM: http://www.gtkforums.com/about446.html For completeness heres a copy of the routine I used to create windows with a background image… You probably need to customise it a little, Im working on an embedded device that supports only 640x480. GtkWidget *SetupWindow(gchar *data,gboolean Transient) { GdkPixmap *background; GdkPixbuf *pixbuf; GdkScreen *ourscreen; GdkColormap *colormap; GtkStyle *style; GdkColor fg; GdkColor bg; GError *error = NULL; GdkRectangle *rect; GtkWidget *window; pixbuf = gdk_pixbuf_new_from_file ("pics/fb.png",&error); if (error != NULL) { if (error->domain == GDK_PIXBUF_ERROR) { g_print ("Pixbuf Related Error:\n"); } if (error->domain == G_FILE_ERROR) { g_print ("File Error: Check file permissions and state:\n"); } g_printerr ("%s\n", error[0].message); exit(1); } gdk_pixbuf_render_pixmap_and_mask (pixbuf, &background, NULL, 0); style = gtk_style_new (); style->bg_pixmap[0] = background; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), data); // gtk_window_maximize(GTK_WINDOW(window)); gtk_window_set_modal (GTK_WINDOW (window),TRUE); gtk_window_set_default_size(GTK_WINDOW(window),640,480); gtk_widget_set_style (GTK_WIDGET(window), GTK_STYLE(style)); gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER_ALWAYS); gtk_container_set_border_width(GTK_CONTAINER(window), 14); if(Transient==TRUE) gtk_window_set_transient_for(GTK_WINDOW (window),GTK_WINDOW(mainwindow)); gtk_widget_show (window); return(window); }

2007-07-19 · wuan

ii undefined symbol cairo_xlib_surface_create

第二次遇到这样的错误: [/sun/home]% firefox /usr/lib/firefox/firefox-bin: symbol lookup error: /usr/lib/libgdk-x11-2.0.so.0: undefined symbol: cairo_xlib_surface_create 上次是因为 ld.so.conf 的设置问题,这次是因为我编译 cairo-1.2.4 的问题。我在编译时忘记指定 prefix,它把 libcairo.so 默认安装到 /lib 目录,导致 gtk 程序启动时加载了错误的 libcairo.so 库 解决办法是,重新编译 cairo-1.2.4,同样不要指定 prefix,然后安装,最后再反安装。 1% ./configure [...

2007-03-06 · wuan