Closing an application
Sir, I am trying to ascertain the "exit" method from an application.In the following application, I have defined an event for the button and connected it with signal gtk_main_quit. I have not defined this function, separately. I am relying on the system_provided function for this. I have two questions. 1) Is it a proper method of exiting an application? 2) Which function call should I use in the button event, out of the two choices avilable, namely "gtk_exit" and "gtk_main_quit"? Here is the code, that I am using. #include int main(int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); button = gtk_button_new_with_label("Quit"); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC (gtk_main_quit), NULL); gtk_container_add (GTK_CONTAINER(window), button); gtk_widget_show(button); gtk_widget_show(window); gtk_main(); return 0; } bye shiraz __ Do you Yahoo!? Yahoo! Tax Center - File online, calculators, forms, and more http://tax.yahoo.com ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
GtkRange and adjust_bounds
Hi, I'm looking for a way to automatically grow a pixmap in a GtkScrolledWindow if the user tries to scroll farther to the right or bottom when the scroll thumb is already at the edge. I've tried a bunch of things and there doesn't seem to be a documented way of finding out if someone attempts to scroll when the thumb is at the edge. GtkScrolledWindow's GtkAdjustment emits value_changed if the value has changed, but in this case it won't have changed. I dug through the GTK 2.2 source and the adjust_bounds signal in GtkRange seems to do exactly what I want: it's emitted whenever someone clicks the scroll buttons or drags the thumb. My question is, since the signal isn't documented anywhere, can I rely on it still being there in a later release? :) Thanks, Mike ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
GtkTextBuffer + integers?
Hey everyone, I am trying to output an integer to a gtktextbuffer, the widget only seems to take a gchar as data and when i try to cast the integer to a char it compiles but then segfaults when gtk_buffer_set_text() calls strlen(). Does anyone have any idea how I can get an integer value to the buffer? thanks! Ben LeMasurier uidzer0.org _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
problems with gtk-demo
i've got real problems with gtk2.2.i've compiled any sources mentioned in installations guide but it is still doesn't work.i use debian woody with xfree version 4.1 so that's why i needed to compile fontconfig,xft directly from sources. i 've built and install all depended libraries in order given in installation guide and still have a problems. I am able to compile gkt2.2 without problems but when i try to run gtk-demo there is an warning : WARNING **: Cannot open font file for font Nimbus Sans L, 10 and that's all i can get. I am asking for a help or suggestions milus ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: UTF8 guarantees for GdkEntryKey
On Sun, 2003-04-06 at 11:10, Dave Malcolm wrote: > Is the "string" field of a GdkEventKey guaranteed to be valid UTF-8? Am I > correct in thinking that I ought to be able to write (regardless of > language/input method): > g_return_if_fail(g_utf8_validate(event->string, -1, NULL)); > > I'm having problems with Cyrillic key entry in a custom XML editor widget I'm > writing (www.conglomerate.org, a free-as-in-GPL user-friendly XML editor). > > Thanks in advance The value of event->string is guaranteed to be completely useless; you need to use GtkIMContext. Quoting: http://developer.gnome.org/doc/API/2.2/gdk/gdk-Event-Structures.html#GdkEventKey gchar *string a string containing the an approximation of the text that would result from this keypress. The only correct way to handle text input of text is using input methods (see GtkIMContext), so this field is deprecated and should never be used. (gdk_unicode_to_keyval() provides a non-deprecated way of getting an approximate translation for a key.) The string is encoded in the encoding of the current locale (Note: this for backwards compatibility: strings in GTK+ and GDK are typically in UTF-8.) and NUL-terminated. In some cases, the translation of the key code will be a single NUL byte, in which case looking at length is necessary to distinguish it from the an empty translation. Regards, Owen ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
problems with gtk-demo
i've got real problems with gtk2.2.i've compiled any sources mentioned in installations guide but it is still doesn't work.i use debian woody with xfree version 4.1 so that's why i needed to compile fontconfig,xft directly from sources. i 've built and install all depended libraries in order given in installation guide and still have a problems. I am able to compile gkt2.2 without problems but when i try to run gtk-demo there is an warning : WARNING **: Cannot open font file for font Nimbus Sans L, 10 and that's all i can get. I am asking for a help or suggestions ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Signals - newbie
Hello, I'm afraid that I'm a bit confused regarding gtk_object_class_user_signal_new. Has it been deprecated? I noticed that it is documented in 1.2's API (with no mention of future deprecation), but that there is little mention of it in the 2.0 API reference short of a brief paragraph in the signals section. Also, running cat * | grep gtk_object_class_user_signal_new in the gtk directory is returning nothing. I would really rather avoid rewriting all of the widgets to support the signals that I need them to, not only because of time issues, but also because it seems like a very very bad idea. Is there some other way to that I'm (quite likely) missing? Thanks for any help Brooke ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Bug in GtkCurve?
The following code, results in a straight line: gfloat points[] = {0, 0, 25, 25, 50, 50, 75, 50, 85, 55, 100, 100}; gtk_curve_set_range (GTK_CURVE(curve) 0, 100, 0, 100); gtk_curve_set_vector (GTK_CURVE(curve), 6, points); gtk_curve_set_curve_type(GTK_CURVE(curve), GTK_CURVE_TYPE_SPLINE; Which one would not expect (unless I am missing something). I cannot seem to initialize a curve to anything different to a straight line. Points in the middle seem to be ignored. I am running GTK 1.2.10 on a RH 7.3. A person running 1.2.8 reported it works there. Here is the code that reproduces the problem on my platform: #include gint delete_event( GtkWidget *widget, GdkEvent *event, gpointer data ) { gtk_main_quit(); } int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *curve; gfloat points[] = {0, 0, 25, 25, 50, 50, 75, 50, 85, 55, 100, 100}; gtk_init(&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); curve = gtk_curve_new (); gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (delete_event), NULL); gtk_container_set_border_width (GTK_CONTAINER (window), 10); gtk_container_add (GTK_CONTAINER (window), curve); gtk_widget_show (curve); gtk_widget_show (window); gtk_curve_set_range (GTK_CURVE(curve), 0, 100, 0, 100); gtk_curve_set_vector (GTK_CURVE(curve), 6, points); gtk_curve_set_curve_type(GTK_CURVE(curve), GTK_CURVE_TYPE_SPLINE); gtk_main (); return(0); } Regards -- Elena Shejn <[EMAIL PROTECTED]> ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: failed to load "./stock_add_16.png":
Did you ever figure this out? I'm running into the same problem. acrolein:stock-icons:445$ make GDK_PIXBUF_MODULE_FILE=../../gdk-pixbuf/gdk-pixbuf.loaders ../../gdk-pixbuf/gdk-pixbuf-csource \ --raw --build-list stock_add_16 ./stock_add_16.png stock_add_24 ./stock_add_24.png stock_align_center_16 ./stock_align_center_16.png stock_align_center_24 ./stock_align_center_24.png stock_align_justify_16 ./stock_align_justify_16.png stock_align_justify_24 ./stock_align_justify_24.png stock_align_left_16 ./stock_align_left_16.png stock_align_left_24 ./stock_align_left_24.png stock_align_right_16 ./stock_align_right_16.png stock_align_right_24 ./stock_align_right_24.png stock_apply_20 ./stock_apply_20.png stock_cancel_20./stock_cancel_20.png stock_dnd_multiple_32 ./stock_dnd_multiple_32.png stock_bottom_16 ./stock_bottom_16.png stock_bottom_24 ./stock_bottom_24.png stock_cdrom_16 ./stock_cdrom_16.png stock_cdrom_24 ./stock_cdrom_24.png stock_clear_24 ./stock_clear_24.png stock_close_20 ./stock_close_20.png stock_close_24 ./stock_close_24.png stock_colorselector_24 ./stock_colorselector_24.png stock_color_picker_25 ./stock_color_picker_25.png > ./gtkstockpixbufs.h || \ ( rm -f ./gtkstockpixbufs.h && false ) failed to load "./stock_add_16.png": Couldn't recognize the image file format for file './stock_add_16.png' *** Error code 1 make: Fatal error: Command failed for target `gtkstockpixbufs.h' -- Michael Prentice - Software Engineer IBM Software Group - Rational Software Configuration Management - Clearcase Web Lexington, MA 781-676-2754 617-650-4556 mailto:[EMAIL PROTECTED] ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
colors change.
Hello, I'm using gtk to make a design of lines, rectangles and other polygons. My question is why when I draw the objects, for example, lines and after that I draw the rectangles, the first line I was drawed changes its color to the rectangle's color? And so on with the other objects. See here some code to how I draw any, for example the rectangle: ... gdk_colormap_alloc_color(a->gdkcolormap, &vr[i].rcolor, TRUE, TRUE); gdk_gc_set_foreground(a->gdkgc, &vr[i].rcolor); gdk_gc_set_line_attributes(a->gdkgc, vr[i].rgrosor, GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER); gdk_draw_rectangle(a->drawingarea->window, a->gdkgc, TRUE, vr[i].rx, vr[i].ry, vr[i].ranchura, vr[i].raltura); ... thanks in advance, ana. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Compile problem with gdk-pixbuf-io.c
Figures after a day of looking at this, I figure it out right as I send email to the list The problem was using -I/usr/include along with gcc. Removing that from the CPPFLAGS fixed it. Mike -- Michael Prentice - Software Engineer IBM Software Group - Rational Software Configuration Management - Clearcase Web Lexington, MA 781-676-2754 617-650-4556 mailto:[EMAIL PROTECTED] ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Compile error in gdk-pixbuf-io.c, __builtin_va_alist and __builtin_va_arg_incr
I'm trying to build Mozilla on Solaris 8. But I can't seem to get gtk to build. I have built pango, glib, and atk so far successfully, with numerous difficulties. acrolein:gdk-pixbuf:82$ make Making all in pixops /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -DG_LOG_DOMAIN=\"GdkPixbuf\" -I.. -I -I../gdk-pixbuf -I/gdk-pixbuf -DGTK_SYSCONFDIR=\"/net/acrolein/export/home/mprentic/etc\" -DGTK_VERSION=\"2.2.1\" -DGTK_BINARY_VERSION=\"2.2.0\" -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DPREFIX=\"/net/acrolein/export/home/mprentic\" -DG_DISABLE_CAST_CHECKS -threads -I//net/acrolein/export/home/mprentic/glib-2.2.1/. -I//net/acrolein/export/home/mprentic/glib-2.2.1 -I//net/acrolein/export/home/mprentic/glib-2.2.1/./glib -I//net/acrolein/export/home/mprentic/glib-2.2.1/./gmodule -DGDK_PIXBUF_ENABLE_BACKEND "-DPIXBUF_LIBDIR=\"/net/acrolein/export/home/mprentic/lib/gtk-2.0/2.2.0/loaders\"" "-DBUILT_MODULES_DIR=\"./.libs\"" -I/net/acrolein/export/home/mprentic/include/freetype2/freetype -I/net/acrolein/export/home/mprentic/include -I/usr/include -I/usr/local/include -threads -g -O2 -Wall -c gdk-pixbuf-io.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -DG_LOG_DOMAIN=\"GdkPixbuf\" -I.. -I -I../gdk-pixbuf -I/gdk-pixbuf -DGTK_SYSCONFDIR=\"/net/acrolein/export/home/mprentic/etc\" -DGTK_VERSION=\"2.2.1\" -DGTK_BINARY_VERSION=\"2.2.0\" -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DPREFIX=\"/net/acrolein/export/home/mprentic\" -DG_DISABLE_CAST_CHECKS -threads -I//net/acrolein/export/home/mprentic/glib-2.2.1/. -I//net/acrolein/export/home/mprentic/glib-2.2.1 -I//net/acrolein/export/home/mprentic/glib-2.2.1/./glib -I//net/acrolein/export/home/mprentic/glib-2.2.1/./gmodule -DGDK_PIXBUF_ENABLE_BACKEND -DPIXBUF_LIBDIR=\"/net/acrolein/export/home/mprentic/lib/gtk-2.0/2.2.0/loaders\" -DBUILT_MODULES_DIR=\"./.libs\" -I/net/acrolein/export/home/mprentic/include/freetype2/freetype -I/net/acrolein/export/home/mprentic/include -I/usr/include -I/usr/local/include -threads -g -O2 -Wall -c gdk-pixbuf-io.c -fPIC -DPIC -o gdk-pixbuf-io.lo gdk-pixbuf-io.c: In function `collect_save_options': gdk-pixbuf-io.c:854: warning: implicit declaration of function `__builtin_va_arg_incr' gdk-pixbuf-io.c: In function `gdk_pixbuf_save': gdk-pixbuf-io.c:951: `__builtin_va_alist' undeclared (first use in this function) gdk-pixbuf-io.c:951: (Each undeclared identifier is reported only once gdk-pixbuf-io.c:951: for each function it appears in.) gdk-pixbuf-io.c:948: warning: `args' might be used uninitialized in this function *** Error code 1 make: Fatal error: Command failed for target `gdk-pixbuf-io.lo' Current working directory /net/acrolein/export/home/mprentic/gtk+-2.2.1/gdk-pixbuf *** Error code 1 make: Fatal error: Command failed for target `all-recursive' It seems like I'm somehow missing some includes or something, but I can't figure out what could be missing. This occurs with a normal: ./configure --prefix=/net/acrolein/export/home/mprentic/ make After I clean up all of the Makefiles to not stick top_builddir onto the front of all my include and lib global directories (ie: -I../..//net/acrolein/export/home/mprentic). Which creates a useless broken path. Thanks ahead of time for any help that you can provide. Mike -- Michael Prentice - Software Engineer IBM Software Group - Rational Software Configuration Management - Clearcase Web Lexington, MA 781-676-2754 617-650-4556 mailto:[EMAIL PROTECTED] ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
UTF8 guarantees for GdkEntryKey
Is the "string" field of a GdkEventKey guaranteed to be valid UTF-8? Am I correct in thinking that I ought to be able to write (regardless of language/input method): g_return_if_fail(g_utf8_validate(event->string, -1, NULL)); I'm having problems with Cyrillic key entry in a custom XML editor widget I'm writing (www.conglomerate.org, a free-as-in-GPL user-friendly XML editor). Thanks in advance! Dave Malcolm ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
GtkTreeView sorting...please help
Hi people I have 2 questions: 1)How can I create a sorted Treeview? I know how to create a treeview , i don\'t know what else is required for the rows to be inserted sorted(after a column of type string) 2) If I want to change the sorting type after that (for ex for ASCENDING to DESCENDING) or with a custom sorting type what should i do? I want the treeview to be updated after i change the sorting type. I\'ve searched on the mailing list but i haven\'t found something useful. Thanks very much -- RUK; #!/bin/ssh #The Unix Guru's View of Sex unzip ; strip ; touch ; grep ; finger ; mount ; fsck; more ; yes ; umount ; sleep Acest email a fost trimis din interfata web http://www.bumerang.ro ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
GtkTreeView sorting... please help
Hi people I have 2 questions: 1)How can I create a sorted Treeview? I know how to create a treeview , i don\'t know what else is required for the rows to be inserted sorted(after a column of type string) 2) If I want to change the sorting type after that (for ex for ASCENDING to DESCENDING) or with a custom sorting type what should i do? I want the treeview to be updated after i change the sorting type. I\'ve searched on the mailing list but i haven\'t found something useful. Thanks very much -- RUK; #!/bin/ssh #The Unix Guru's View of Sex unzip ; strip ; touch ; grep ; finger ; mount ; fsck; more ; yes ; umount ; sleep Acest email a fost trimis din interfata web http://www.bumerang.ro ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list