Re: g_thread_init question

2005-06-01 Thread Alan M. Evans
On Wed, 2005-06-01 at 12:25, Tristan Van Berkom wrote: Alan M. Evans wrote: If I make a class that internally uses threads and mutexes, how do I protect myself against another class (not necessarily mine) created in another thread (not necessarily under my control) also calling

Re: g_thread_init question

2005-06-01 Thread Alan M. Evans
On Wed, 2005-06-01 at 14:28, Tristan Van Berkom wrote: Alan M. Evans wrote: (Class in the C++ sense, not the GObject sense.) I am tempted to argue that class in the c++ sence *is* the same as a class in the GObject sence; but that is a little off-topic :) I knew you would be, and so would

trouble subclassing GtkScrolledWindow

2005-06-08 Thread Alan M. Evans
Hiya! See: http://mail.gnome.org/archives/gtk-app-devel-list/2003-June/msg00146.html and http://mail.gnome.org/archives/gtk-app-devel-list/2004-March/msg00279.html There's really not much more to say inasmuch as my problem is precisely what they describe. But nobody responded on the list to

Re: trouble subclassing GtkScrolledWindow

2005-06-10 Thread Alan M. Evans
*sigh* On Wed, 2005-06-08 at 11:30, Alan M. Evans wrote: Hiya! See: http://mail.gnome.org/archives/gtk-app-devel-list/2003-June/msg00146.html and http://mail.gnome.org/archives/gtk-app-devel-list/2004-March/msg00279.html There's really not much more to say inasmuch as my problem

Re: g_strsplit

2005-10-05 Thread Alan M. Evans
On Wed, 2005-10-05 at 09:10, Alan M. Evans wrote: /* throw away GLib array bookkeeping - keep only array data */ sarray = (gchar**)parray-pdata; g_ptr_array_free(parray,FALSE); Come to think of it, g_ptr_array_free returns the pdata pointer. sarray = g_ptr_array_free(parray,FALSE

Re: Multithreading and GTK widgets

2005-10-17 Thread Alan M. Evans
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

Re: Programming style

2005-10-24 Thread Alan M. Evans
On Sat, 2005-10-22 at 11:49, César Leonardo Blum Silveira wrote: Hello all, I have a few doubts about the way I code my GTK applications. One of them is: Is it ok to use many global variables for the widgets? For example, in a glade app where callbacks are of the form void

Re: Problem sending data to gtk_button on clicked event

2005-11-09 Thread Alan M. Evans
-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list -- Alan M. Evans [EMAIL PROTECTED] ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app

Re: Valgrind and glib

2006-01-03 Thread Alan M. Evans
On Tue, 2006-01-03 at 05:31, Ricardo Biloti wrote: There is a simple gslist test program which yields a non clean report when valgrind is employed. The problem seems to be in glib. Below I quote the program and the valgrind output: [...] ==6578== 20 bytes in 1 blocks are still reachable in

Re: GTK and threads

2006-02-06 Thread Alan M. Evans
On Mon, 2006-02-06 at 11:22, Michael Torrie wrote: I have attached a sample file that uses threads in the way you described in your last post. I generally like to make code examples compile without warning. Did you even try to compile this?

Re: Some scientific widgets that I have done.

2006-02-20 Thread Alan M. Evans
On Mon, 2006-02-20 at 12:06, Alexandre wrote: Hi, I've written this mail to show some widgets for gtk that I have done. This widgets are for technical / scientific uses. It's the first version (0.1), there may be bugs, but I want to correct them, and in the future, release it as a

Re: GtkSelectionMode

2006-02-21 Thread Alan M. Evans
On Tue, 2006-02-21 at 12:16, Wallace Owen wrote: On Tue, 2006-02-21 at 12:03 -0800, Alan M. Evans wrote: Is there a way to allow the user to select *any* number of elements from a treeview, including zero? GTK_SELECTION_MULTIPLE almost does, but if there's a way to unselect the last

dealing with utf8 filenames

2006-02-21 Thread Alan M. Evans
Suppose I have a filename returned from g_dir_read_name(). It's UTF-8, at least on Win32. I would like to determine if it has a particular extension (case insensitive) and display it without the extension. I can't believe that this manipulation is that uncommon, but the only solutions I've been

Re: dealing with utf8 filenames

2006-02-22 Thread Alan M. Evans
On Tue, 2006-02-21 at 16:25, Tor Lillqvist wrote: Also, I don't think the string returned from g_utf8_casefold() is guaranteed to be the same length as the original, so my calculation for string length is incorrect. Umm, no? You look at the casefolded string and calculate the length of

Re: dealing with utf8 filenames

2006-02-22 Thread Alan M. Evans
On Wed, 2006-02-22 at 07:59, Christian Neumair wrote: Am Mittwoch, den 22.02.2006, 07:09 -0800 schrieb Alan M. Evans: On Tue, 2006-02-21 at 16:25, Tor Lillqvist wrote: Also, I don't think the string returned from g_utf8_casefold() is guaranteed to be the same length as the original

Re: dealing with utf8 filenames

2006-02-22 Thread Alan M. Evans
On Wed, 2006-02-22 at 10:47, Christian Neumair wrote: For the sake of readability, I'd rather use the following code: char **str; /* str[0]: basename str[1]: extension */ str = g_strsplit (filename, ., 2); g_strfreev(str) Surely that won't work if there is

Re: Sockets in GTK+?

2006-08-21 Thread Alan M. Evans
On Mon, 2006-08-21 at 06:18, Chris Sparks wrote: I went looking fo rGNet and what is odd is that it says this: It is written in C, object-oriented, and built upon GLib. C isn't object-oriented.. Object-oriented is a philosophy, not an attribute of a language. C++ supports objects

where is xmlparse.dll?

2006-09-22 Thread Alan M. Evans
Trying to compile a simple gtk app for the first time under Windows using stuff linked from TML's webpage. I've managed to produce my app, complete with little boxes where the fonts should be rendered. In an attempt to put something a little more intuitive on the screen, I've come to the point of

Re: where is xmlparse.dll?

2006-09-22 Thread Alan M. Evans
Found it. I had missed the expat requirement mentioned on Tor's page. Sorry to bother the list about it. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Command Window with MSVC++ GTK apps

2006-10-03 Thread Alan M. Evans
On Tue, 2006-10-03 at 09:12, Tor Lillqvist wrote: add /subsystem:windows to the linking options. (If using gcc, it would be -mwindows.) Or run editbin /subsystem:windows on the .exe file any time after linking. I find that doing the former doesn't actually work. In that case it fails to link

Re: Command Window with MSVC++ GTK apps

2006-10-03 Thread Alan M. Evans
On Tue, 2006-10-03 at 14:52, Reed Hedges wrote: Are you using cygwin or mingw? Nope. Just took my prog developed on my Linux workstation and created a VC++ project by adding the source files and specifying the Win32 glib/gtk+ libs and DLLs. ___

Re: Command Window with MSVC++ GTK apps

2006-10-04 Thread Alan M. Evans
On Tue, 2006-10-03 at 16:19, Christopher Backhouse wrote: Lots of my code has this at the top of it #pragma comment(linker, /subsystem:\windows\ /entry:\mainCRTStartup\) //Kill console window I got it off the internet somewhere. I assume the unrecognised pragma will be ignored by every

g_spawn_async_with_pipes and WIN32

2007-06-21 Thread Alan M. Evans
Hello! I'm having trouble reading the stdout pipe from g_spawn_async_with_pipes() when compiled for WIN32. The docs on developer.gnome.org mention some differences in Windows behavior but nothing mentions what I'm supposed to read the pipe with. I've googled endlessly and so far failed to produce

Re: g_spawn_async_with_pipes and WIN32

2007-06-22 Thread Alan M. Evans
On Fri, 2007-06-22 at 11:37 +0300, Tor Lillqvist wrote: Alan M. Evans writes: The process being called simply prints a short message and returns. I see the message if I execute the program from a command prompt under Windows. The linux version works, In the Windows version, _read

Re: g_spawn_async_with_pipes and WIN32

2007-06-23 Thread Alan M. Evans
On Fri, 2007-06-22 at 18:54 +0300, Tor Lillqvist wrote: Alan M. Evans writes: This is being compiled with VC6, and does depend (indirectly) on msvcrt.dll. OK, good. Are you saying that my method should work in this circumstance? In principle, yes. In practice, if it doesn't, file

Re: g_spawn_async_with_pipes and WIN32

2007-06-25 Thread Alan M. Evans
On Sat, 2007-06-23 at 12:35 +0300, Tor Lillqvist wrote: Alan M. Evans writes: I created the minimal sample program, and it works! The working example is virtually copy/pasted out of the non-working code. That's so typical;) Could your problem then simply be caused by some dynamic memory

Re: Newbie Question: How i can use glib-2.0 in my c-programm ?

2007-06-27 Thread Alan M. Evans
On Tue, 2007-06-26 at 23:27 +0200, Kai Szymanski wrote: Sorry, german text. It say's: test.c:6: Error: »gstring« not declared This is because C is case sensitive. Try GString instead of gstring. ___ gtk-app-devel-list mailing list

type-punning warnings with optimizations turned on?

2007-07-05 Thread Alan M. Evans
I have the following snippit: #include glib.h struct MyMutex { GStaticMutex mutex; }; MyMutex * MyMutex_new() { MyMutex *result = g_new(MyMutex,1); g_static_mutex_init(result-mutex); return result;

Re: type-punning warnings with optimizations turned on?

2007-07-06 Thread Alan M. Evans
On Fri, 2007-07-06 at 08:22 -0700, [EMAIL PROTECTED] wrote: On Fri, 2007-07-06 at 08:00 -0700, Alan M. Evans wrote: On Fri, 2007-07-06 at 09:27 +0200, Jonathan Winterflood wrote: Wouldn't that be typedef struct MyMutex MyMutex; rather? Or for short : typedex struct _MyMutex

Re: A little compiler issue

2007-11-09 Thread Alan M. Evans
On Fri, 2007-11-09 at 00:04 +0100, Rafał Mużyło wrote: It's not quite gtk related, but do any of you know how to fix a problem with G_LOCK/G_UNLOCK producing strict aliasing warnings with -O2 ? I'm looking for a real solution, not something to silence warnings, like -fno-strict-aliasing ? It

Re: How to scroll my gtk application window programmically

2007-11-15 Thread Alan M. Evans
On Sat, 2007-11-10 at 20:48 -0600, ying lcs wrote: I would like to know how can I scroll my gtk application window programmically? I have tried this, but the scroll bar does not make and the content of the window did not get refresh? GtkWidget* topLevelWindow; GdkWindow* win =