pango or any other way to format text
Can anybody please take some time to show me simple way of implementing pango formatting to get greek letters, subscripts and superscripts in gtk2+? A minimal(complete with headers) example will be very appriciated. -- Rudra JRF; SNBNCBS http://www.bose.res.in/~rudra A bus station is where a bus stops. A train station is where a train stops. On my desk I have a work station. Please, if possible, don't send me MS Word or PowerPoint attachments Why?See: http://www.gnu.org/philosophy/no-word-attachments.html ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: pango or any other way to format text
On Mon, 2012-05-14 at 20:20 +0800, Rudra Banerjee wrote: Can anybody please take some time to show me simple way of implementing pango formatting to get greek letters, subscripts and superscripts in gtk2+? A minimal(complete with headers) example will be very appriciated. Greek is the same as English - just use the Unicode characters - even for polytonic Greek in most cases. For superscript and subscript you use sup and sub as in HTML. These are not needed for Greek accents such as rough breathing, of course. Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: pango or any other way to format text
On Mon, May 14, 2012 at 08:20:26PM +0800, Rudra Banerjee wrote: Can anybody please take some time to show me simple way of implementing pango formatting to get greek letters, subscripts and superscripts in gtk2+? What do you mean by ‘implementing Pango formatting'? I suppose you are not writing a Pango backend, i.e. you are not *implementing* any text rendering yourself. If you just want to use Pango to render Greek text, subscripts, superscripts, Cyrillic, math symbols or whatever, use UTF-8: GtkWidget *label = gtk_label_new(ἀπὸ τοῦ ἡλίου μετάστηθι); or GtkWidget *label = gtk_label_new(a² + b² = c²); That's it. Function gtk_label_set_markup() with Pango markup http://developer.gnome.org/pango/stable/PangoMarkupFormat.html can be used for more complex indexes and exponents and other stuff in labels. Yeti ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Event Mask Question
Well I have taken a different approach to my programming given how events changed. I just turn on all events and then my code will determine which event I'll inhibit or not depending on the widget I am building. Seems to be working fine, exception for key_press and key_release. Can't get these events any more. I am guessing I am going to be forced to use Cairo and I don't know where a good source for learning Cairo is. Chris Sparks ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: pango or any other way to format text
See http://developer.gnome.org/pango/stable/PangoMarkupFormat.html for the syntax for subscripts and superscripts. Regards, Dov On Mon, May 14, 2012 at 3:38 PM, David Nečas y...@physics.muni.cz wrote: On Mon, May 14, 2012 at 08:20:26PM +0800, Rudra Banerjee wrote: Can anybody please take some time to show me simple way of implementing pango formatting to get greek letters, subscripts and superscripts in gtk2+? What do you mean by ‘implementing Pango formatting'? I suppose you are not writing a Pango backend, i.e. you are not *implementing* any text rendering yourself. If you just want to use Pango to render Greek text, subscripts, superscripts, Cyrillic, math symbols or whatever, use UTF-8: GtkWidget *label = gtk_label_new(ἀπὸ τοῦ ἡλίου μετάστηθι); or GtkWidget *label = gtk_label_new(a² + b² = c²); That's it. Function gtk_label_set_markup() with Pango markup http://developer.gnome.org/pango/stable/PangoMarkupFormat.html can be used for more complex indexes and exponents and other stuff in labels. Yeti ___ 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
MSAA or UIA
Searches on the internet give me nothing. Who knows when/if gtk+ applications will be accessible using MSAA or UIA? What are the reasons we're not there yet? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: MSAA or UIA
Mike wrote: Searches on the internet give me nothing. Who knows when/if gtk+ applications will be accessible using MSAA or UIA? What are the reasons we're not there yet? Googling for uia gtk brought me this up in 30 seconds: http://comments.gmane.org/gmane.comp.gnome.gtk+.devel.general/22293 Ask Microsoft to fix their licenses. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: MSAA or UIA
Unfortunately I couldnt view the whole thread. Your web page ends in the middle of the conversation, strangely. The web site doesnt have links to view the whole thread; it's a horrible mailing list reader. It helped though. Thanks. :) I'll try asking M$. On 5/14/2012 1:14 PM, Michael Cronenworth wrote: Mike wrote: Searches on the internet give me nothing. Who knows when/if gtk+ applications will be accessible using MSAA or UIA? What are the reasons we're not there yet? Googling for uia gtk brought me this up in 30 seconds: http://comments.gmane.org/gmane.comp.gnome.gtk+.devel.general/22293 Ask Microsoft to fix their licenses. ___ 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: MSAA or UIA
Mike wrote: Unfortunately I couldnt view the whole thread. Your web page ends in the middle of the conversation, strangely. The web site doesnt have links to view the whole thread; it's a horrible mailing list reader. Your web browser must be busted. I can view the entire thread by clicking on the link I provided. Here's a link to the same thread from Gnome's mailing list viewer: http://mail.gnome.org/archives/gtk-devel-list/2012-April/msg00032.html The original poster was pointed to the Gnome legal list and he was going to pose a question there about UIA and GTK. I do not know if he did. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
GRegex regular expression failing to match
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 * match_info; g_regex_match (regex, path, 0, match_info); if (g_match_info_matches (match_info)) { gchar * word = g_match_info_fetch (match_info, 1); // ... } In my unit test, I pass in in the string /1, hoping to match and then pull out the number. A GError is not thrown (so my GRegex is compiling), but g_match_info_matches() is returning FALSE. Is there anything wrong with the regexp, or perhaps my g_regex_new() options, or anything else obvious? -- frigidcode.com indicium.us ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GRegex regular expression failing to match
On Mon, May 14, 2012 at 01:36:02PM -0800, Christopher Howard wrote: Is there anything wrong with the regexp, Sure. Two things. It should be ^/[0-9]+$ not ^/d+$ First, it lacks the backslash to make \d a digit atom. But, second, since \d matches a digit (possibly whatever Unicode may say is a digit), not 0-9, you should really use [0-9] to match ASCII digits. Yeti ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
GtkTable cells resizing
Hi, I have an application with a tabbed view. On two tabs I have a table, one is a 2x2 table, the other a 3x1 table (3 rows). In each cell is a canvas that has a gtk plot. I want to be able to click one of the plots in the 3x1 table and change the canvas size to 2/3 the original, with the other two canvases being 1/6 the original size. After redrawing and resizing and mucking about, I can't get the table rows to be different sizes, accommodating the different sized canvases properly, even though I have gtk_table_set_homogeneous (table, FALSE); Any clues how to do this? Regards, James. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkTable cells resizing
Are you using GTK+ 3 ? If so, use GtkGrid instead... possibly just that will fix things for you. Short of that, if I understand correctly, you have a target state/configuration of a GtkTable (or GtkGrid), if you construct the table in the target configuration from scratch, I take it things work as you want... but dont work properly after performing some kind of a transformation to reach your target state... ... perhaps it's worth trying an extra call to gtk_widget_queue_resize() after modifying your table. Regards, -Tristan On Mon, May 14, 2012 at 9:21 PM, James Steward jamesstew...@optusnet.com.au wrote: Hi, I have an application with a tabbed view. On two tabs I have a table, one is a 2x2 table, the other a 3x1 table (3 rows). In each cell is a canvas that has a gtk plot. I want to be able to click one of the plots in the 3x1 table and change the canvas size to 2/3 the original, with the other two canvases being 1/6 the original size. After redrawing and resizing and mucking about, I can't get the table rows to be different sizes, accommodating the different sized canvases properly, even though I have gtk_table_set_homogeneous (table, FALSE); Any clues how to do this? Regards, James. ___ 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: GtkTable cells resizing
On 15/05/12 11:56, Tristan Van Berkom wrote: Are you using GTK+ 3 ? Still on GTK+ 2.0. If so, use GtkGrid instead... possibly just that will fix things for you. Short of that, if I understand correctly, you have a target state/configuration of a GtkTable (or GtkGrid), if you construct the table in the target configuration from scratch, I take it things work as you want... but dont work properly after performing some kind of a transformation to reach your target state... That's about it. ... perhaps it's worth trying an extra call to gtk_widget_queue_resize() after modifying your table. I'm trying that. I have signals connected thus; g_signal_connect(G_OBJECT(p-canvas), expose-event, G_CALLBACK(plot_expose_event), p); g_signal_connect(G_OBJECT(p-canvas), select-item, G_CALLBACK(plot_select_event), p); and get the plot_select_event() routine to calculate and set new canvas sizes with gtk_plot_canvas_set_size(GTK_PLOT_CANVAS(p-canvas), width, height); then call gtk_widget_queue_resize(GTK_WIDGET(p-table)); This causes plot_expose_event() to get called, which calls gtk_plot_canvas_paint(GTK_PLOT_CANVAS(canvas)); But the table rows seem to expand to the largest canvas and don't seem to take on variable heights. Feel I've been around and around the mulberry bush on this ;-) Regards, James. On Mon, May 14, 2012 at 9:21 PM, James Steward jamesstew...@optusnet.com.au wrote: Hi, I have an application with a tabbed view. On two tabs I have a table, one is a 2x2 table, the other a 3x1 table (3 rows). In each cell is a canvas that has a gtk plot. I want to be able to click one of the plots in the 3x1 table and change the canvas size to 2/3 the original, with the other two canvases being 1/6 the original size. After redrawing and resizing and mucking about, I can't get the table rows to be different sizes, accommodating the different sized canvases properly, even though I have gtk_table_set_homogeneous (table, FALSE); Any clues how to do this? Regards, James. ___ 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: GtkTable cells resizing
On Mon, May 14, 2012 at 10:29 PM, James Steward jamesstew...@optusnet.com.au wrote: On 15/05/12 11:56, Tristan Van Berkom wrote: Are you using GTK+ 3 ? Still on GTK+ 2.0. If so, use GtkGrid instead... possibly just that will fix things for you. Short of that, if I understand correctly, you have a target state/configuration of a GtkTable (or GtkGrid), if you construct the table in the target configuration from scratch, I take it things work as you want... but dont work properly after performing some kind of a transformation to reach your target state... That's about it. ... perhaps it's worth trying an extra call to gtk_widget_queue_resize() after modifying your table. I'm trying that. I have signals connected thus; g_signal_connect(G_OBJECT(p-canvas), expose-event, G_CALLBACK(plot_expose_event), p); g_signal_connect(G_OBJECT(p-canvas), select-item, G_CALLBACK(plot_select_event), p); and get the plot_select_event() routine to calculate and set new canvas sizes with gtk_plot_canvas_set_size(GTK_PLOT_CANVAS(p-canvas), width, height); then call gtk_widget_queue_resize(GTK_WIDGET(p-table)); This causes plot_expose_event() to get called, which calls gtk_plot_canvas_paint(GTK_PLOT_CANVAS(canvas)); But the table rows seem to expand to the largest canvas and don't seem to take on variable heights. Feel I've been around and around the mulberry bush on this ;-) Hard to say whats going on here, I wonder who is responding to the size requests for these items which are getting drawn. It seems you connect to a signal to draw on a widget, which means the content is not the widget, so probably you need to also connect a signal to override the size request of the said widget you intend painting onto ? Perhaps you are using forced size requests to accomplish this (using gtk_widget_set_size_request() or such), and have somehow mixed up the size requests while swapping your content onto new rows/columns ? Other than that, child 'expand' properties will be considered by the GtkTable (if all children can expand, then it's quite possible that after reaching a large window size the content will be evenly spread). Cheers, -Tristan Regards, James. On Mon, May 14, 2012 at 9:21 PM, James Steward jamesstew...@optusnet.com.au wrote: Hi, I have an application with a tabbed view. On two tabs I have a table, one is a 2x2 table, the other a 3x1 table (3 rows). In each cell is a canvas that has a gtk plot. I want to be able to click one of the plots in the 3x1 table and change the canvas size to 2/3 the original, with the other two canvases being 1/6 the original size. After redrawing and resizing and mucking about, I can't get the table rows to be different sizes, accommodating the different sized canvases properly, even though I have gtk_table_set_homogeneous (table, FALSE); Any clues how to do this? Regards, James. ___ 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