Adding Entry into a MenuItem
Hi, I am working on streamlining my Gtk-Application for faster use. It is currently running inside a StatusIcon and showing up a Menu right clicking on it. Here the user shall enter a String for before starting an action, for example a Search-Pattern before searching. It seems not to be a problem to add a Entry into a MenuItem (since it's derived from Bin); but no keyboard events come to the Entry. Actually no key events come to the MenuItem itself. How can I make this Entryfield editable? Or is it impossible by design to add Entries to Menus? I am using Gtkmm. Thanks, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Utf8 strings manipulation
Hi all, I'm trying to transform an utf8 string. I have some problems with it because I don't know how to do it or where I can see an example (a tutorial, doc or application). I need transform this text (in utf8): gtk_source_completion to: GtkSourceCompletion. I don't know how replace a character or delete a character. Perhaps I need to allocate a gchar* array first and then use g_utf8_strncpy in all _, I don't know. In that case, I don't know how much memory I need to allocate. Can you help me? Regards, Perriman ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Transparent Draw Area
You can not make widgets transparent, other than to the other windows/desktop. Thus in your case, you need to create a new gtk.Window, and lay it over the rest of your app. You use the POPUP flag to remove the window-border and some set_colormap(self.get_screen().get_rgba_colormap()) If you read python, you can look in the beginning of: http://code.google.com/p/pychess/source/browse/trunk/lib/pychess/widgets/pydock/OverlayWindow.py fre, 26 09 2008 kl. 13:41 +0200, skrev michael: Hi all, I want to create a transparent draw area and using cairo to draw line with the window background. My backed is directfb and I don't know if it is supported. I want to start with an example working on X. Is there somenthing attribute or function to do this? Regards Michael ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list -- Best Regards, Med Venlig Hilsen, Thomas Bomb, Riksdagen, Regeringen, Död, Terror, Mord, Planer, Muslimska brödraskapet, Alluah akbar, Kärnkraft Stop the Swedish surveillance: stoppafralagen.nu ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Utf8 strings manipulation
Hello, what I would do (not necessarily the smartest thing;) is try to determine what strings I'll be operating on. If I'm operating on ANSI/iso8859-1 strings, I don't need to use uft8-specialized functions, since characters from those have the same codes in all encodings. That thing out of the way, we can go and convert our string. I would do it with glib's string manipulation functions like this (example only): CODE == #include glib.h #include string.h #include stdio.h int main( int argc, char **argv ) { gchar *string = gtk_source_completion; gchar *string_new; gchar **parts; gchar **parts_bk; printf( %s\n, string ); parts = g_strsplit( string, _, -1 ); parts_bk = parts; for( parts; parts; parts++ ) { gchar *tmp; tmp = g_utf8_strup( *parts, ( g_utf8_next_char( *parts ) - *parts ) * sizeof( gchar ) ); memcpy( *parts, tmp, strlen( tmp ) ); g_free( tmp ); } string_new = g_strjoinv( NULL, parts_bk ); g_strfreev( parts_bk ); printf( %s\n, string_new ); return( 0 ); } /CODE = Hope it's been helpfull. 2008/9/29 Perriman [EMAIL PROTECTED]: Hi all, I'm trying to transform an utf8 string. I have some problems with it because I don't know how to do it or where I can see an example (a tutorial, doc or application). I need transform this text (in utf8): gtk_source_completion to: GtkSourceCompletion. I don't know how replace a character or delete a character. Perhaps I need to allocate a gchar* array first and then use g_utf8_strncpy in all _, I don't know. In that case, I don't know how much memory I need to allocate. Can you help me? Regards, Perriman ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list -- Tadej Borovšak 00386 (0)40 613 131 [EMAIL PROTECTED] [EMAIL PROTECTED] ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Utf8 strings manipulation
Perriman wrote: Hi all, I'm trying to transform an utf8 string. I have some problems with it because I don't know how to do it or where I can see an example (a tutorial, doc or application). I need transform this text (in utf8): gtk_source_completion to: GtkSourceCompletion. I don't know how replace a character or delete a character. Perhaps I need to allocate a gchar* array first and then use g_utf8_strncpy in all _, I don't know. In that case, I don't know how much memory I need to allocate. Can you help me? Would not using the Glib regex routines[1] be the easiest? Hacking stuff with strncpy seems a bit problematic. In particular you can use g_regex_replace. From what I've read, all the glib regular expression routines work in UTF-8 natively. [1] http://library.gnome.org/devel/glib/stable/glib-Perl-compatible-regular-expressions.html ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Transparent Draw Area
Hi, for now I do it: Change the window expose event: static gboolean window_expose_event (GtkWidget *widget, GdkEventExpose *event) { GdkRegion *region; GtkWidget *child; cairo_t *cr; /* get our child (in this case, the draw area) */ child = gtk_bin_get_child (GTK_BIN (widget)); /* create a cairo context to draw to the window */ cr = gdk_cairo_create (widget-window); /* the source data is the (composited) event box */ gdk_cairo_set_source_pixmap (cr, child-window, child-allocation.x, child-allocation.y); /* draw no more than our expose event intersects our child */ region = gdk_region_rectangle (child-allocation); gdk_region_intersect (region, event-region); gdk_cairo_region (cr, region); cairo_clip (cr); /* composite, with a 50% opacity */ cairo_set_operator (cr, CAIRO_OPERATOR_OVER); cairo_paint_with_alpha (cr, 1); /* we're done */ cairo_destroy (cr); return FALSE; } To take the region of the child. And in the event of the draw area do it: static gboolean on_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer data) { struct GraphConf *conf = (struct GraphConf *)data; cairo_t *cr; cairo_pattern_t *pat1, *pat2, *pat3, *pat4; cr = gdk_cairo_create(widget-window); cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); gdk_cairo_region (cr, event-region); ... Then write what do you want... And initialize all like this: My window background is a castle. I can see the cairo graph over a castle. window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_set_style(GTK_WIDGET(window), GTK_STYLE(style)); darea = gtk_drawing_area_new(); screen = gtk_widget_get_screen(darea); rgba = gdk_screen_get_rgba_colormap(screen); gtk_widget_set_colormap(darea, rgba); gtk_widget_set_app_paintable (GTK_WIDGET (darea), TRUE); gtk_container_add(GTK_CONTAINER (window), darea); gtk_widget_show(darea); init_graph_conf(gconf); g_signal_connect(window, destroy, G_CALLBACK(gtk_main_quit), NULL); g_signal_connect(darea, expose-event, G_CALLBACK(on_expose_event), gconf); gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); gtk_window_set_default_size(GTK_WINDOW(window), 320, 400); gtk_window_set_title(GTK_WINDOW(window), Temperature); gtk_widget_show_all(window); gdk_window_set_composited (darea-window, TRUE); g_signal_connect_after(window, expose-event, G_CALLBACK(window_expose_event), NULL); Thomas Dybdahl Ahle wrote: You can not make widgets transparent, other than to the other windows/desktop. Thus in your case, you need to create a new gtk.Window, and lay it over the rest of your app. You use the POPUP flag to remove the window-border and some set_colormap(self.get_screen().get_rgba_colormap()) If you read python, you can look in the beginning of: http://code.google.com/p/pychess/source/browse/trunk/lib/pychess/widgets/pydock/OverlayWindow.py fre, 26 09 2008 kl. 13:41 +0200, skrev michael: Hi all, I want to create a transparent draw area and using cairo to draw line with the window background. My backed is directfb and I don't know if it is supported. I want to start with an example working on X. Is there somenthing attribute or function to do this? Regards Michael ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list I have a sample like this :) ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Utf8 strings manipulation
Thanks a lot Tadej!! I will try this to learn more about utf8 string manipulation but I will use regexp because I need to replace more characters (This is only an example) Thanks again!!! El Mon, 29 Sep 2008 16:18:50 +0200 Tadej Borovšak [EMAIL PROTECTED] escribió: Hello, what I would do (not necessarily the smartest thing;) is try to determine what strings I'll be operating on. If I'm operating on ANSI/iso8859-1 strings, I don't need to use uft8-specialized functions, since characters from those have the same codes in all encodings. That thing out of the way, we can go and convert our string. I would do it with glib's string manipulation functions like this (example only): CODE == #include glib.h #include string.h #include stdio.h int main( int argc, char **argv ) { gchar *string = gtk_source_completion; gchar *string_new; gchar **parts; gchar **parts_bk; printf( %s\n, string ); parts = g_strsplit( string, _, -1 ); parts_bk = parts; for( parts; parts; parts++ ) { gchar *tmp; tmp = g_utf8_strup( *parts, ( g_utf8_next_char( *parts ) - *parts ) * sizeof( gchar ) ); memcpy( *parts, tmp, strlen( tmp ) ); g_free( tmp ); } string_new = g_strjoinv( NULL, parts_bk ); g_strfreev( parts_bk ); printf( %s\n, string_new ); return( 0 ); } /CODE = Hope it's been helpfull. 2008/9/29 Perriman [EMAIL PROTECTED]: Hi all, I'm trying to transform an utf8 string. I have some problems with it because I don't know how to do it or where I can see an example (a tutorial, doc or application). I need transform this text (in utf8): gtk_source_completion to: GtkSourceCompletion. I don't know how replace a character or delete a character. Perhaps I need to allocate a gchar* array first and then use g_utf8_strncpy in all _, I don't know. In that case, I don't know how much memory I need to allocate. Can you help me? Regards, Perriman ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Utf8 strings manipulation
Hi Michael, Thanks a lot for the idea!! I will use regexp because it will be easier than doing by hand. Thanks all!! El Mon, 29 Sep 2008 08:25:02 -0600 Michael Torrie [EMAIL PROTECTED] escribió: Perriman wrote: Hi all, I'm trying to transform an utf8 string. I have some problems with it because I don't know how to do it or where I can see an example (a tutorial, doc or application). I need transform this text (in utf8): gtk_source_completion to: GtkSourceCompletion. I don't know how replace a character or delete a character. Perhaps I need to allocate a gchar* array first and then use g_utf8_strncpy in all _, I don't know. In that case, I don't know how much memory I need to allocate. Can you help me? Would not using the Glib regex routines[1] be the easiest? Hacking stuff with strncpy seems a bit problematic. In particular you can use g_regex_replace. From what I've read, all the glib regular expression routines work in UTF-8 natively. [1] http://library.gnome.org/devel/glib/stable/glib-Perl-compatible-regular-expressions.html ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Composite children
I surround the creation of a particular widget with widget_push_composite_child and widget_pop_composite_child. Afterward, I see that property composite-child is True for the new widget. However, when I run get_children on the parent, the widget appears in the list even though documentation says that get_children returns the container's non-internal children. Is this a bug, or is there something else I'm supposed to do to prevent a child from showing up as a child? -- Jeffrey Barish ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
gio-standalone fails to build 'G_GNUC_PRETTY_FUNCTION'
Hi I'm trying to build the svn version of gio-standalone (Rev 761) on a Ubuntu Hardy machine. I receive following error message: make[3]: Entering directory `/home/comic/zzz_unindexed/gio-standalone/trunk/gio' gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -DGIO_MODULE_DIR= \/usr/local/lib/gio/modules\ -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DG_LOG_DOMAIN=\GIO\ -DG_DISABLE_DEPRECATED -DDBUS_API_SUBJECT_TO_CHANGE-Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith-Wcast-align -Wsign-compare -g -O2 -Wno-strict-aliasing -Wno-sign-compare -MT test-streams.o -MD -MP -MF .deps/test-streams.Tpo -c -o test-streams.o test-streams.c test-streams.c: In function 'test_memory_input_stream': test-streams.c:74: error: 'G_GNUC_PRETTY_FUNCTION' undeclared (first use in this function) test-streams.c:74: error: (Each undeclared identifier is reported only once test-streams.c:74: error: for each function it appears in.) test-streams.c: In function 'test_memory_output_stream': test-streams.c:164: error: 'G_GNUC_PRETTY_FUNCTION' undeclared (first use in this function) test-streams.c: In function 'test_buffered_input_stream': test-streams.c:263: error: 'G_GNUC_PRETTY_FUNCTION' undeclared (first use in this function) test-streams.c: In function 'test_buffered_output_stream': test-streams.c:304: error: 'G_GNUC_PRETTY_FUNCTION' undeclared (first use in this function) test-streams.c: In function 'get_newline_stream': test-streams.c:364: error: 'G_GNUC_PRETTY_FUNCTION' undeclared (first use in this function) test-streams.c: In function 'verify_lines': test-streams.c:391: error: 'G_GNUC_PRETTY_FUNCTION' undeclared (first use in this function) make[3]: *** [test-streams.o] Error 1 make[3]: Leaving directory `/home/comic/zzz_unindexed/gio-standalone/trunk/gio' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/comic/zzz_unindexed/gio-standalone/trunk/gio' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/comic/zzz_unindexed/gio-standalone/trunk' make: *** [all] Error 2 What's wrong? Regards ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: gio-standalone fails to build 'G_GNUC_PRETTY_FUNCTION'
Hi, On Sat, 2008-09-27 at 11:27 +0200, comicinker wrote: I'm trying to build the svn version of gio-standalone (Rev 761) on a Ubuntu Hardy machine. I receive following error message: make[3]: Entering directory `/home/comic/zzz_unindexed/gio-standalone/trunk/gio' gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -DGIO_MODULE_DIR= \/usr/local/lib/gio/modules\ -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DG_LOG_DOMAIN=\GIO\ -DG_DISABLE_DEPRECATED -DDBUS_API_SUBJECT_TO_CHANGE-Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith-Wcast-align -Wsign-compare -g -Od.a2 -Wno-strict-aliasing -Wno-sign-compare -MT test-streams.o -MD -MP -MF .deps/test-streams.Tpo -c -o test-streams.o test-streams.c test-streams.c: In function 'test_memory_input_stream': test-streams.c:74: error: 'G_GNUC_PRETTY_FUNCTION' undeclared (first use in this function) G_GNUC_PRETTY_FUNCTION is deprecated since GLib 2.16 and you are compiling with G_DISABLE_DEPRECATED. The code should be changed to use G_STRFUNC instead. And the configure script should have a check for the GLib version and not use G_DISABLE_DEPRECATED for newer versions of GLib. Sven ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: gio-standalone fails to build 'G_GNUC_PRETTY_FUNCTION'
Hi, On Sat, 2008-09-27 at 11:27 +0200, comicinker wrote: Hi I'm trying to build the svn version of gio-standalone (Rev 761) on a Ubuntu Hardy machine. gio-standalone has been merged into glib in 2.15.x. You shouldn't use gio-standalone anymore. Jürg ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Patch biohazard report, Sep 29th
Hello Gtk+ people, time for another Bio Hazard! Low hanging fruits: - Bug 524203 – GtkRanges should send ::change-value even if not realized + Easy patch, removing a bogus if(realized) - Patch applies fine http://bugzilla.gnome.org/show_bug.cgi?id=524203 - Bug 307963 – GtkSpinButton clamps value with the wrong maximum. + Simple patch - Patch applies perfectly http://bugzilla.gnome.org/show_bug.cgi?id=307963 - Bug 311678 – Don't bother clearing the background for GDK_NO_BG windows + Simple two line patch http://bugzilla.gnome.org/show_bug.cgi?id=311678 To document or not to document: - Bug 339205 – Widget:popup-menu and show-help signals need docs for language bindings + Clarification needed, just say Yes or No basically http://bugzilla.gnome.org/show_bug.cgi?id=339205 - Bug 323904 – GtkEditable header is slightly incorrect + Easy patch, is it okay or invalid? - Patch would need to be fixed http://bugzilla.gnome.org/show_bug.cgi?id=323904 Some fruits that are harder to reach: Need some work or word from our beloved GTK+ hackers: - Bug 155071 – wrong colors in location bar history + Fixes entry completion theming - Patch applies partly http://bugzilla.gnome.org/show_bug.cgi?id=155071 Your opinion is asked for, dedust some oldies: - Bug 446738 – api to check lockedness + Straightforward patch, do we want it, yes or no? http://bugzilla.gnome.org/show_bug.cgi?id=446738 - Bug 324899 – No easy way to clear the contents of a text GtkComboBox + Adds a function to clear the text in the combobox. - Patch applies fine The patch is simple, but needs a decision/ opinion http://bugzilla.gnome.org/show_bug.cgi?id=324899 - Bug 319608 – Enhance the GtkProgressBar widget + Different short- and long-term suggestions - Patch applies partly Needs a decision how to proceed http://bugzilla.gnome.org/show_bug.cgi?id=319608 - Bug 322194 – Proposal: undo/redo in gtk + Advanced patch available, a judgement call is badly needed - Patch applies partly http://bugzilla.gnome.org/show_bug.cgi?id=322194 Go ahead, reject and accept patches, have fun. greetings PD: You can see the wiki page http://live.gnome.org/GtkLove/PatchTriaging if you want to check past issues, help or just check some bugs. ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: Patch biohazard report, Sep 29th
Am Montag, den 29.09.2008, 15:34 +0200 schrieb Christian Dywan: Low hanging fruits: Plus this one: http://bugzilla.gnome.org/show_bug.cgi?id=548666 Bug 548666 – [PATCH] Allow searching for a given item in a GSequence Patch attached; applies cleanly; documentation in there; even a test case Regards, Sven ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list