Re: gtktreeview - hide some rows
Hi, HuamiSoft Hubert Sokolowski wrote: Hi! I have a treeview which is a list. is it possible to hide some particular rows? I want to implement some filter on my treeview, so the user could find quicker some rows. regards have look at http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeModelFilter.html esies would be to add a boolean entry to you model and set this to true for columns to hide. The filter hook could then just look at this entry to filter. Stefan ___ 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 use pixmaps in GTK+ applications?
My question is, how to use pixmaps in GTK+? Can I make them resouces as in Win32? (As already was said, it's more GTKish (and 100% portable) to convert them into constant C data using gdk-pixbuf-csource. If you really want to use Win32 resources, sure, that should work too. If I use them as ordinary files, how can I know the path after users' installation? What should I do in the configure.ac and Makefile.am? You should install them in a known location I'd suggest just defining a simple directory under $datadir. These replies forgot that the original poster asked about Win32. It is not typical at all to use fixed compile-time pathnames on Win32. (I would go so far as taying it isn't even possible, in general, as there is no drive letter that would be guaranteed to exist on all Win32 installations. My previous home machine had no C: drive, for instance!) Instead, you need to have your app look up its installation location at run-time. Use something like this: wchar_t buf[1000]; gchar *exename; GetModuleFileNameW(NULL, wbuf, G_N_ELEMENTS(wbuf)); exename = g_utf16_to_utf8 (wbuf, -1, NULL, NULL, NULL); to get the path to the .exe file, and then construct the path to the image file(s) from that (assuming your installed installs the image files in a fixed location relative to where the .exe gets installed). (There is also g_win32_get_package_installation_directory(NULL, NULL) which does more or less the same. Read the documentation.) --tml ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Usage of g_str_strip
Hey all, There is a function g_strstrip defined to strip-off the leading and trailing spaces from a string. However, the working of this function is a bit confusing. I have the following code-snippet : name = g_strstrip ( g_strdup (gtk_entry_get_text(GTK_ENTRY (name_entry; g_free (name); Is this leaking memory? I dont understand clearly how g_strstrip works. Do I need to store the g_strdup in a pointer and free it instead of the name? The Devhelp doesnt clearly specify anything about it. Please clarify. Thanks, Sankar P P.S. Since I am not subscribed to this list. Include my address in your reply. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Invisible/missing cursor in editable
Hey list, Has anyone here experienced (and solved) a case of missing cursors when inline editing a string in a GtkTreeView?? If so, I would sure like to see the solution. Everything else works, it's just a bit confusing not knowing where in the string the next character will appear. I have searched the list archives but to no avail. br Nikolaj Thygesen ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Usage of g_str_strip
On Mon, 2005-10-17 at 14:11 +0530, Sankar P wrote: Hey all, There is a function g_strstrip defined to strip-off the leading and trailing spaces from a string. However, the working of this function is a bit confusing. I have the following code-snippet : name = g_strstrip ( g_strdup (gtk_entry_get_text(GTK_ENTRY (name_entry; g_free (name); Is this leaking memory? No. I dont understand clearly how g_strstrip works. Do I need to store the g_strdup in a pointer and free it instead of the name? No, you are freeing the memory allocated in g_strdup. g_strstrip does not allocate memory. The Devhelp doesnt clearly specify anything about it. Please clarify. #define g_strstrip( string )g_strchomp (g_strchug (string)) Both g_strchung and g_strchomp works with the string you passed to it and does not allocate memory. The first moves the text to the start of the buffer with g_memmove and the second just places a null character in each space character from the end of the buffer to the first non-space character. http://cvs.gnome.org/viewcvs/glib/glib/gstrfuncs.c? rev=1.116.2.2view=markup -- Iago Rubio ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Gtk Xara
Since the Cairo rendering engine is *SLOW* and the Xara Extreme is being ported to linux, with the full API, i think that´s a good idia to port the Gtk engine to use Xara´s System since they are the fastest avaliable. i have *NO* idia how to do this... but since i´m new to software writting, i don´t think that´s unusual O_o' yey. \o\ =D Tomaz Canabrava -- Um Computador sem Windows é como um Navio sem dançarinas de Can-Can ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
gtk window size/position on win32?
Quoting the reference on gtk_window_position: If you are saving and restoring your application's window positions, you should know that it's impossible for applications to do this without getting it somewhat wrong because applications do not have sufficient knowledge of window manager state. The Correct Mechanism is to support the session management protocol (see the GnomeClient object in the GNOME libraries for example) and allow the window manager to save your window sizes and positions. Can anyone tell me how one would do this on win32? I've tried manually remembering window position and size (keying off the window's configure-event), but just as the gtk docs say, this does not work quite right. -- Allin Cottrell Department of Economics Wake Forest University, NC ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Multithreading and GTK widgets
On Sun, 2005-10-16 at 15:59, Michael Matthews wrote: Hi! I am converting my program to use multiple threads: the primary thread for the GTK stuff, and the worker threads for all the time-consuming work that will be performed in the background. The GUI thread takes input from the user and copies it to a global, shared, synchronized data pool which the worker threads monitor. The workers, in turn, invoke GTK functions to write the results to some list/tree views. The problem I have run into is that the list/tree views are not updating properly. They only show a portion of the data which has been written to their models. If I minimize the app window and then restore it, the missing data appears. What am I doing wrong, and what should I do to resolve it? Are you wrapping all your setters in calls to gdk_threads_enter/leave? For example: gdk_threads_enter(); GtkTreeIter iter; gtk_list_store_append(model,iter); gtk_list_store_set(model,iter,MY_COLUMN,my_data,-1); gdk_threads_leave(); I would have the GUI thread update the list/tree models, but the GUI thread spends most of its time sitting in gtk_main. You will, of course, need to be sure you've done the right thing in your main thread as well: gdk_threads_init(); gdk_threads_enter(); gtk_main(); gdk_threads_leave(); -AME ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Multithreading and GTK widgets
Alan M. Evans wrote: [...] I would have the GUI thread update the list/tree models, but the GUI thread spends most of its time sitting in gtk_main. Ofcourse it does, Anything that a GTK+ gui does is inside gtk_main(), you can get the gui thread to do the updating by passing the appropriate data to g_idle_add() (the idle handler should run in the thread thats running gtk_main; i.e. the gui thread). But essentially; what you might have to do is: gtk_widget_queue_draw (treeview); I seem to remember that treeview updates arent always automatic. Cheers, -Tristan ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
stop on Gtk-WARNING
When a GTK app gets Gtk-WARNINGs without actually stopping, it can be hard to determine exactly where they're coming from. Is there a way to tell GTK to stop immediately on such a warning? This would allow using a debugger to localize the first warning much more easily. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
RE: stop on Gtk-WARNING
The same for GLib-GObject-WARNINGs and other similar ones. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Boncek, John Sent: Monday, October 17, 2005 11:33 AM To: gtk-app-devel-list@gnome.org Subject: stop on Gtk-WARNING When a GTK app gets Gtk-WARNINGs without actually stopping, it can be hard to determine exactly where they're coming from. Is there a way to tell GTK to stop immediately on such a warning? This would allow using a debugger to localize the first warning much more easily. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Gtk Xara
On Mon, 2005-10-17 at 13:59 -0700, Colossus wrote: Tomaz Canabrava wrote: Since the Cairo rendering engine is *SLOW* and the Xara Extreme is being ported to linux, with the full API, i think that´s a good idia to port the Gtk engine to use Xara´s System since Who told you Cairo is slow in comparison to Xara Extreme ? Xara Extreme is not GPL so no port is possible. I don't know anything about Xara Extreme, but they are indeed planning to license it under the GPL: http://www.xaraxtreme.org/news/11-10-05.html I'm sure that Cairo will benefit from some of their algorithms and ideas for sure. Perhaps Xara would even be best ported to run on top of Cairo, since it is illustration software. -- Michael Torrie [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: stop on Gtk-WARNING
there is an argument you can pass in to the application at invocation that does this. i think it is --g-fatal-warnings (eg ./foo --g-fatal-warnings). -tim ** http://mail.gnome.org/archives/gtk-devel-list/1998-August/msg00088.htmlBoncek, John wrote: http://mail.gnome.org/archives/gtk-devel-list/1998-August/msg00088.html The same for GLib-GObject-WARNINGs and other similar ones. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Boncek, John Sent: Monday, October 17, 2005 11:33 AM To: gtk-app-devel-list@gnome.org Subject: stop on Gtk-WARNING When a GTK app gets Gtk-WARNINGs without actually stopping, it can be hard to determine exactly where they're coming from. Is there a way to tell GTK to stop immediately on such a warning? This would allow using a debugger to localize the first warning much more easily. ___ 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: stop on Gtk-WARNING
On 10/17/05, Boncek, John [EMAIL PROTECTED] wrote: When a GTK app gets Gtk-WARNINGs without actually stopping, it can be hard to determine exactly where they're coming from. Is there a way to tell GTK to stop immediately on such a warning? This would allow using a debugger to localize the first warning much more easily. I have something like this near the start of my main(): #ifdef DEBUG g_log_set_always_fatal( G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL | G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING ); #endif /*DEBUG*/ Alternatively, you can pass --g-fatal-warnings as a command-line argument to any gtk program. Either technique will cause your program to abort() on the first warning, so you can get a stack trace if you run in a debugger. See http://developer.gnome.org/doc/API/2.0/glib/glib-Message-Logging.html J ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Gtk Xara
On 10/17/05, Michael Torrie [EMAIL PROTECTED] wrote: On Mon, 2005-10-17 at 13:59 -0700, Colossus wrote: Tomaz Canabrava wrote: Since the Cairo rendering engine is *SLOW* and the Xara Extreme is being ported to linux, with the full API, i think that´s a good idia to port the Gtk engine to use Xara´s System since Who told you Cairo is slow in comparison to Xara Extreme ? Xara Extreme is not GPL so no port is possible. I don't know anything about Xara Extreme, but they are indeed planning to license it under the GPL: http://www.xaraxtreme.org/news/11-10-05.html I'm sure that Cairo will benefit from some of their algorithms and ideas for sure. Perhaps Xara would even be best ported to run on top of Cairo, since it is illustration software. That's interesting. They have some simple speed charts here: http://www.xaraxtreme.org/about/ which seems to show xara's software renderer is 5 - 10x faster than cairo's. Though it's not clear what cairo backend or platform they did the timings on. I guess windows? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
data acqusition, display and control
I am using gtk to develop a control interface. Am a bit new to this. BAsically I am acquiring data using some library functions and dispalying them in 6 text boxes . When i click on the bacq function this acquistion starts. gtk_signal_connect(GTK_OBJECT(bacq),clicked,GTK_SIGNAL_FUNC(button_funcacq),NULL); My problem is that when this happend the dispaly window goes blank and am unable to control it. I need to be able to access another button when this acqusition is occuring and it id part of the same window. How do I do that ? Is there some other signal event I can use. Thanks Prem ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Implementing cpio -tv file.cpio with glib routines
Colossus wrote: - Messaggio originale Da: Olivier Sessink [EMAIL PROTECTED] 1) spawn 'cpio -tv' with a pipe in and a pipe out 2) create non-blocking g_io_channels from these pipes 3) register callbacks with g_io_add_watch() for the io channels, one of these functions should write, the other one read Thank you, but about the cat command ? cpio -tv alone doesn't work because it needs the input from a piped command. if you have the data in memory: use g_spawn to pipe the data to cpio regards, Olivier ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
RE: compiling g_module plugin on (cygwin) win32
Tor, Can you point me to the docs for g_module_xxx functions. I checked for g_module_find on version 2.6.7 (which is what I'm working with) and I couldn't find it. Is it new on 2.8.x? Thanks Jorge Monsalvo -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de Tor Lillqvist Enviado el: Saturday, 15 October, 2005 18:54 Para: Olivier Sessink CC: gtk-app-devel-list@gnome.org Asunto: Re: compiling g_module plugin on (cygwin) win32 Olivier Sessink writes: How can I fix the linking stage on cygwin/win32 ?? First, mark the functions in the sources for the main .exe that are to be used by other modules with G_MODULE_EXPORT. Then you must decide whether you want to 1) restrict your plugins to work only with an executable with the *exact* name you specify, or whether you want it to be 2) more flexible and work even if you happen to rename the main executable. In case 1), create an import library for the .exe using dlltool, and link the plugin against that import library. In case 2), use g_module_open(NULL, 0) to get a GModule handle for the main executable, and the g_module_find() the function from it, and call it. --tml ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.12.2/137 - Release Date: 16-Oct-05 ___ 1GB gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo http://correo.yahoo.com.ar ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
RE: compiling g_module plugin on (cygwin) win32
Jorge Monsalvo writes: Can you point me to the docs for g_module_xxx functions. http://developer.gnome.org/doc/API/2.0/glib/glib-Dynamic-Loading-of-Modules.html I checked for g_module_find A typo, I meant g_module_symbol. --tml ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list