Re: serial ports
On Tue, May 15, 2007 at 02:46:22AM +0300, Tor Lillqvist wrote: > John Coppens writes: > > If I'm not mistaken (I don't use windows), look at the g_io functions, I > > believe they are portable to Windows too. There may be a problem with the > > names of the devices (COM1: vs /dev/ttyS0) or so, but that is relatively > > easy to solve, I'd say. > > You are too optimistic. How well the g_io functions work with serial > port devices is quite unclear. Windows is not Unix. Typically you have > to use specialized API to talk to each kind of device or IPC channel. Yes! I Agree. A good start to understand serial ports are to read chapter 18 in "Advanced programming int the Unix Environment", Richard Stevens, ISBN 0-201-56317-7. -- Göran Hasse Göran Hasseemail: [EMAIL PROTECTED] Tel: 08-6949270 Raditex AB http://www.raditex.se Planiavägen 15, 1tr Mob: 070-5530148 131 34 NACKA, SWEDEN OrgNr: 556240-0589 VAT: SE556240058901 -- ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Pango-1.17.0 released [unstable]
Pango-1.17.0 is now available for download at: http://download.gnome.org/sources/pango/1.17/ or ftp://ftp.gtk.org/pub/pango/1.17 c1b9b2e236a0d5fe208b532a4a792e7a pango-1.17.0.tar.bz2 7326429bb60bf02685aeee4b3ffbf64a pango-1.17.0.tar.gz This is the first development release in what seems to be a exciting cycle in Pango development, leading to Pango-1.18.0, which will be released just in time for GNOME-2.20. Notes: * This is unstable development release. While it has had fairly extensive testing, there are likely bugs remaining to be found. This release should not be used in production. * Installing this version will overwrite your existing copy of Pango. If you have problems, you'll need to reinstall Pango-1.16.x * Bugs should be reported to http://bugzilla.gnome.org. About Pango === Pango is a library for layout and rendering of text, with an emphasis on internationalization. Pango can be used anywhere that text layout is needed, though most of the work on Pango so far has been done in the context of the GTK+ widget toolkit. Pango forms the core of text and font handling for GTK+-2.x. Pango is designed to be modular; the core Pango layout engine can be used with different font backends. There are three basic backends, with multiple options for rendering with each. - Client side fonts using the FreeType and fontconfig libraries. Rendering can be with with Cairo or Xft libraries, or directly to an in-memory buffer with no additional libraries. - Native fonts on Microsoft Windows using Uniscribe for complex-text handling. Rendering can be done via Cairo or directly using the native Win32 API. - Native fonts on MacOS X, rendering via Cairo. The integration of Pango with Cairo (http://cairographics.org) provides a complete solution with high quality text handling and graphics rendering. Dynamically loaded modules then handle text layout for particular combinations of script and font backend. Pango ships with a wide selection of modules, including modules for Hebrew, Arabic, Hangul, Thai, and a number of Indic scripts. Virtually all of the world's major scripts are supported. As well as the low level layout rendering routines, Pango includes PangoLayout, a high level driver for laying out entire blocks of text, and routines to assist in editing internationalized text. More information about Pango is available from http://www.pango.org/. Bugs should be reported to http://bugzilla.gnome.org. Pango 1.17 depends on version 2.12.0 or newer of the GLib library and version 1.2.6 or newer of the cairo library (if the cairo backend is desired); more information about GLib and cairo can be found at http://www.gtk.org/ and http://cairographics.org/ respectively. Overview of changes between 1.16.4 and 1.17.0 == General: - Text justification. A simple justification algorithm is implemented that tries to justify by expanding spaces in the line, and if none found, by adjust letter spacing. [Based on patch by Mathias Hasselmann] - The pango_script_get_sample_language() function is modified to use the value of environment variables PANGO_LANGUAGE or LANGUAGE (checked in that order) to make guess better languages for scripts. The env var should be a list of language tags, like "en:fa" for example where in effect makes Pango choose Persian (fa) fonts instead of Arabic (ar) fonts when a run of text in the Arabic script is found in an otherwise non-Arabic layout. This trick is also useful for East Asian languages. For example a Japanese user that cannot set her primary language to Japanese can still set PANGO_LANGUAGE="ja" and Pango will map CJK characters to Japanese. The LANGUAGE env var is a standard gettext variable listing languages the user wants to receive UI translated messages in. However, since most packages don't provide separate English translations, setting LANGUAGE="en:ja" doesn't have the intended effect and UI messages will be shown in Japanese. For these situations one can use LANGUAGE="en:C:ja". Pango skips the special language tag 'C'. - Simplified embedded-shape rendering with pangocairo backends do. [Richard Hult] - New header file: Moved PangoLanguage APIs into its own header pango-language.h, which is included from pango-types.h. - ATSUI backend now lists synthesized italic faces like other - Misc optimizations and fixes. OpenType Layout Engine Improvements: - Vertical glyph variants are not selected in vertical text if the font supports them. - Instead of hardcoded OpenType script tag in each module, and using Default Language System unconditionally, Pango will now find and use the script/lang-sys pair that best matches the detected script and language of a run of text. Moreover, it also applies the OpenType 'locl' feature. These, plus the PANGO_LANGUAGE env var, give font designers and users lots of options to provide/cho
Re: serial ports
John Coppens writes: > If I'm not mistaken (I don't use windows), look at the g_io functions, I > believe they are portable to Windows too. There may be a problem with the > names of the devices (COM1: vs /dev/ttyS0) or so, but that is relatively > easy to solve, I'd say. You are too optimistic. How well the g_io functions work with serial port devices is quite unclear. Windows is not Unix. Typically you have to use specialized API to talk to each kind of device or IPC channel. --tml ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: serial ports
On Mon, 14 May 2007 18:49:02 - "Pavel A. da Mek" <[EMAIL PROTECTED]> wrote: > When I want to use serial ports, shall I write separate code for > Windows and for Linux, or is there some library function which would > allow to do it in the platform independent way? If I'm not mistaken (I don't use windows), look at the g_io functions, I believe they are portable to Windows too. There may be a problem with the names of the devices (COM1: vs /dev/ttyS0) or so, but that is relatively easy to solve, I'd say. John ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Gtk+ and multithreating
On Mon, 2007-05-14 at 19:53 +0200, Michelle Konzack wrote: > Hello *, > > I am new on this list, but have already codes some VERY simple admin > GUI's... Now I have a bigger problem/Application which need definitiv > multithreading since it must poll several servers and update several > TreeView and ListView. I have no experience with it, since I am one > of those > >console-singel-task-no-one-bother-me > > programmers (Debian GNU/Linux)... :-) > > OK, for now my GUI is running and then I use a loop like > > 8< > window_main=create_window_main(); > > while ( TRUE ) > { > while ( gtk_events_pending() ) > gtk_main_iteration(); > > > } > 8< > > where are several functions which are > executed one after one. Problem FOR NOW is that each function need > ages to get the data and my GUI is dead while running the functions... Pass the callbacks representing the events concerned to the main program loop using g_idle_add(). Make sure the callbacks return FALSE. g_idle_add() is thread safe, provided that you have initialised glib with g_thread_init(). Chris ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: serial ports
On Mon, 2007-05-14 at 18:49 +, Pavel A. da Mek wrote: > When I want to use serial ports, shall I write separate code for Windows and > for Linux, or is there some library function which would allow to do it in > the platform independent way? There's definitely no GTK library calls to support this type of thing, so you can either maintain separate code for win32 and linux (ifdefs or something) or find a reliable, third-party library that fits your technical and licensing requirements. I have heard that doing any kind of serial port programming on Windows is very very painful. On Linux it's easy. > > ___ > 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: Gtk+ and multithreating
Le lundi 14 mai 2007 20:20, Michael Ekstrand a écrit : > On Mon, 2007-05-14 at 19:53 +0200, Michelle Konzack wrote: > > So, can anyone provide me with a Tutorial HOW TO MULTITHREAD those > > functions ? > > > > And maybe some other tips... > > Can you do everything asynchronously? Initiate your connections, and > set up some GIOChannels to watch for data availability? That will let > you set up callbacks so the GLib main loop will notify your program as > bits of data are available from each server. You don't block on > communication, your GUI stays responsive, and you don't have to worry > about the complexities of multithreading. > > - Michael Michael is probably right, but to answer your question there's a good documentation about that in the GLib manual. See the sections 'Threads', 'Thread Pools' and 'Asynchronous Queues' under 'Glib Core Application Support'. If you want to know more, there's a tutorial here (about pthread but with a general introduction) : http://www.llnl.gov/computing/tutorials/pthreads -- Cédric Lucantis ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How to create a simple multilingual GUI
On Mon, May 14, 2007 at 08:04:09PM +0200, Michelle Konzack wrote: > > Does > setlocale("LC_ALL", "de_DE"); > > not work? It works. Future locale-dependent calls will use the new locale. So if you do this while your application is already running, you can watch it trasmuting slowly to German, with some parts probably never getting there. Yeti -- http://gwyddion.net/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
serial ports
When I want to use serial ports, shall I write separate code for Windows and for Linux, or is there some library function which would allow to do it in the platform independent way? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Gtk+ and multithreating
On Mon, 2007-05-14 at 19:53 +0200, Michelle Konzack wrote: > So, can anyone provide me with a Tutorial HOW TO MULTITHREAD those > functions ? > > And maybe some other tips... Can you do everything asynchronously? Initiate your connections, and set up some GIOChannels to watch for data availability? That will let you set up callbacks so the GLib main loop will notify your program as bits of data are available from each server. You don't block on communication, your GUI stays responsive, and you don't have to worry about the complexities of multithreading. - Michael -- Michael Ekstrand Research Assistant, Scalable Computing Laboratory Goanna, compute cluster and InfiniBand network monitor tool: http://www.scl.ameslab.gov/Projects/Monitor/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How to create a simple multilingual GUI
Am 2007-05-13 02:19:39, schrieb David Ne?as (Yeti): > On Fri, May 11, 2007 at 02:52:06PM +0200, John Zoidberg wrote: > > I would like to create a GUI with GTK where the language can be chosen > > interactively in a "settings" menu. > > I would like this to be independant of the machines local language settings. > > Each user (not machine) has separate language preferences > and even individual applications can be run with different > settings, e.g. > > LC_ALL=cs_CZ myapp > > > How can I do that? > > If you want your application to disobey for whatever reason, > set appropriate LC_* variables yourself -- either in > a wrapper script or with g_setenv() before initializing > Gtk+. The selector can be GUI or not, this does not matter. Does setlocale("LC_ALL", "de_DE"); not work? Thanks, Greetings and nice Day Michelle Konzack Systemadministrator Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSN LinuxMichi 0033/6/6192519367100 Strasbourg/France IRC #Debian (irc.icq.com) ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Gtk+ and multithreating
Hello *, I am new on this list, but have already codes some VERY simple admin GUI's... Now I have a bigger problem/Application which need definitiv multithreading since it must poll several servers and update several TreeView and ListView. I have no experience with it, since I am one of those console-singel-task-no-one-bother-me programmers (Debian GNU/Linux)... :-) OK, for now my GUI is running and then I use a loop like 8< window_main=create_window_main(); while ( TRUE ) { while ( gtk_events_pending() ) gtk_main_iteration(); } 8< where are several functions which are executed one after one. Problem FOR NOW is that each function need ages to get the data and my GUI is dead while running the functions... If there is nothing to do, the CPU load is 100% while running the loop. Oops! Not realy what I want! So, can anyone provide me with a Tutorial HOW TO MULTITHREAD those functions ? And maybe some other tips... Thanks, Greetings and nice Day Michelle Konzack Systemadministrator Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSN LinuxMichi 0033/6/6192519367100 Strasbourg/France IRC #Debian (irc.icq.com) ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
"drag-leave" signal
Hi! I have a question regarding the dnd drag-leave signal. In my application are multiple drag targets nested into each other (the drag targets derive from GtkContainer). However, if I try to drag the target on the widget inside of the other widget I don't get a drag-leave signal but a drag-motion signal for the outside widget. But I need to know exactly on which widget the drop happens thus knowing which widget the mouse pointer is currently on. Is there a way to handle this? Thanks and regards, Johannes ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()
On Mon, May 14, 2007 at 04:41:26AM -0700, beginner.c wrote: > > I'm doing the following and get the above error (of course with the funny > characters). What am I doing wrong? Beside using sprintf() (instead of at least g_snprintf()) which is always wrong, you are not posting selfcontained, i.e. compilable and runable, code that actually exhibits your problem. > int a = 0; > char *x; > char Text[500]; > > sprintf (Text,"Blah %i",a); > x = Text; > > gtk_label_set_text (GTK_LABEL(label1),x); This works: #include int main(int argc, char *argv[]) { GtkWidget *window, *label; int a = 0; char *x; char text[500]; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL); label = gtk_label_new(NULL); sprintf(text, "Blah %i", a); x = text; gtk_label_set_text(GTK_LABEL(label), x); gtk_container_add(GTK_CONTAINER(window), label); gtk_widget_show_all(window); gtk_main(); return 0; } So you must do something differently. I guess variable text goes out of scope and the stack space is reused for something else before gtk_label_set_text() is called in the actual code, but who knows... Yeti -- http://gwyddion.net/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Alternative GTK widgets
On Mon, 2007-05-14 at 05:39 -0700, beginner.c wrote: > I've noticed libegg gets used a lot. Does it have a web page? It seems the > most obvious thing for widgets but are there some screen shots somewhere > showing off the widgets? libegg is a "copy-and-paste" library: you have to copy the files inside your own project. some of the modules inside libegg are deprecated and should not be used anymore; some of them are highly experimental and are not meant for widespread consumption (they are inside libegg because the author wants the code under revision control but at the same time it's not worth of a repository). there is no web page for libegg, nor screenshot for the widgets it exports - in theory it shouldn't even be used. in practise, the turn-over for new functionalities can be quite long. you can see the contents of libegg by checking it out of GNOME's SVN. ciao, Emmanuele. -- Emmanuele Bassi, E: [EMAIL PROTECTED] W: http://www.emmanuelebassi.net B: http://log.emmanuelebassi.net ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Alternative GTK widgets
I've noticed libegg gets used a lot. Does it have a web page? It seems the most obvious thing for widgets but are there some screen shots somewhere showing off the widgets? jcupitt wrote: > > On 5/12/07, Shoq <[EMAIL PROTECTED]> wrote: >> Pardon my noobness, but I am new to GTK. I had assumed there would be a >> wealth of open source widgets that descend from the toolkit. I am >> starting >> to think this was a very poor assumption on my part. I've not be able to >> find anything but a few aborted attempts at variations by other parties. >> Am >> I missing something? Is there are directory of other efforts to add value >> to >> the base classes? > > There are a few I know of: > >libegg > > This is part of gnome, but you can use it separately (I think). It's a > set of gtk widgets that people have written that seem useful but which > haven't settled enough to go into the main gtk distribution yet. I > think the name is supposed to suggest incubation: if a libegg widget > becomes popular and useful enough, it will eventually get into gtk. > For example, the recent files stuff started out in libegg, I think. > > libsexy > > A library of extra widgets, seems nice, widely used. > > gtk-extra > > Sheet, plot and other widgets. This is now becoming a little > old-fashioned (in my opinion), most of their widgets now have > equivalents in the main gtk tree. > > In addition, most gtk applications include a set of their own widgets > which you can usually just cut out and keep (license permitting). > > John > ___ > gtk-app-devel-list mailing list > gtk-app-devel-list@gnome.org > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list > > -- View this message in context: http://www.nabble.com/Alternative-GTK-widgets-tf3730474.html#a10602860 Sent from the Gtk+ - Apps Dev mailing list archive at Nabble.com. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Alternative GTK widgets
Their is also libview, which is the widgets that vmware created. You can search on freshmeat for it. Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. http://mobile.yahoo.com/go?refer=1GNXIC ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
GtkCellRenderer for different cells in a same column
Hello, I want to develop a window where I can edit the attributes of an object. I will have a first, non-editable column with the name of the attribute, and a second one, editable, with the value. The values have different types, so I want to have different "widget" types (or behaviours or editing methods) for these value types. Example: I would like to have "text" type cells to edit numerical and text type attributes, "check button" type cells for bool type attributes and "combo box" cells for multiple choice type attributes, all this in a same column. In order to use all the nice features of the GtkTreeView (grouping of attributes ...), I would like to use it for this purpose. Does anybody know existing functionality that I can use to render these different types of cells in a same column of a GtkTreeView? Or do I have to write my own "multi"-GtkCellRenderer? Thank you in advance, Christoph ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()
Hi, I'm doing the following and get the above error (of course with the funny characters). What am I doing wrong? int a = 0; char *x; char Text[500]; sprintf (Text,"Blah %i",a); x = Text; gtk_label_set_text (GTK_LABEL(label1),x); -- View this message in context: http://www.nabble.com/Pango-WARNING-**%3A-Invalid-UTF-8-string-passed-to-pango_layout_set_text%28%29-tf3751858.html#a10602235 Sent from the Gtk+ - Apps Dev mailing list archive at Nabble.com. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How to create a simple multilingual GUI
On 5/14/07, Gabriel Schulhof <[EMAIL PROTECTED]> wrote: > > Hi! > > On Sun, 2007-05-13 at 02:19 +0200, David Nečas (Yeti) wrote: > > Run-time switching of languages is not > > possible http://bugzilla.gnome.org/show_bug.cgi?id=313736 > > Oh, it's possible, just very difficult. You have to keep all your > user-string-displaying widgets in a list, and set the label/text for > each of them every time the language changes, and after notifying > gettext of the change. > > This can quickly turn into a nightmare, because the width of labels > tends to change from language to language, and non-resizable windows > will not re-shrink after a "verbose" language. I seem to remember that Ubuntu's installer Ubiquity has dynamically switches the language on the first page of installation (with a list of languages on the left, and clicking on one of these languages changes the UI translations at runtime). You might want to check the Ubiquity code to see how they do this? Samuel Gabriel > > ___ > 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: Alternative GTK widgets
On 5/12/07, Shoq <[EMAIL PROTECTED]> wrote: > Pardon my noobness, but I am new to GTK. I had assumed there would be a > wealth of open source widgets that descend from the toolkit. I am starting > to think this was a very poor assumption on my part. I've not be able to > find anything but a few aborted attempts at variations by other parties. Am > I missing something? Is there are directory of other efforts to add value to > the base classes? There are a few I know of: libegg This is part of gnome, but you can use it separately (I think). It's a set of gtk widgets that people have written that seem useful but which haven't settled enough to go into the main gtk distribution yet. I think the name is supposed to suggest incubation: if a libegg widget becomes popular and useful enough, it will eventually get into gtk. For example, the recent files stuff started out in libegg, I think. libsexy A library of extra widgets, seems nice, widely used. gtk-extra Sheet, plot and other widgets. This is now becoming a little old-fashioned (in my opinion), most of their widgets now have equivalents in the main gtk tree. In addition, most gtk applications include a set of their own widgets which you can usually just cut out and keep (license permitting). John ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Alternative GTK widgets
On 5/12/07, Shoq <[EMAIL PROTECTED]> wrote: > > Pardon my noobness, but I am new to GTK. I had assumed there would be a > wealth of open source widgets that descend from the toolkit. I am starting > to think this was a very poor assumption on my part. I've not be able to > find anything but a few aborted attempts at variations by other parties. Am > I missing something? Is there are directory of other efforts to add value to > the base classes? What kind of widgets are you missing? Depending on you needs, there are lots of widgets out there, but they are simply not integrated into Gtk+. Vivien ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list