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 =

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 ? I

Re: type-punning warnings with optimizations turned on?

2007-07-06 Thread Alan M. Evans
On Fri, 2007-07-06 at 16:47 +0100, [EMAIL PROTECTED] wrote: > I think this is a gcc 4.1 issue. I found I couldn't cast from a Thing > *x[] to a void ** in one step without triggering a warning like this. > If I cast to void* and then to void **, all was well. > > Anyway, insert a mysterious extra

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; > &g

Re: type-punning warnings with optimizations turned on?

2007-07-06 Thread Alan M. Evans
[Resending, sorry. Screwed up and sent my last reply from the wrong account.] [EMAIL PROTECTED]&*! mail program! Did it again...]] 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 _My

type-punning warnings with optimizations turned on?

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

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 gtk-app-de

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 the

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 p

Re: g_spawn_async_with_pipes and WIN32

2007-06-22 Thread Alan M. Evans
[Sorry, my last reply was sent *from* the wrong place. This is a duplicate...] 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. > > Ar

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 W

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: 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 ignor

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. ___ gtk-a

Re: Command Window with MSVC++ GTK apps

2006-10-03 Thread Alan M. Evans
On Tue, 2006-10-03 at 11:06, Tor Lillqvist wrote: > If the linker insists on it, add a WinMain() then? Of course. But I resist this for aesthetic reasons. Thanks largely to the cross-platform nature of GLib and GTK+, my application currently has no #ifdef for platform-specific code. The thing is,

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 t

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

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: 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 obj

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

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 > > > > g

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 le

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 ab

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

GtkSelectionMode

2006-02-21 Thread Alan M. Evans
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 selected element, I can't figure out what it is. ___ gtk-app-devel-list ma

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: 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: 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

Re: Problem sending data to gtk_button on "clicked" event

2005-11-09 Thread Alan M. Evans
m2: 080491F5 > (gpointer)m1: 080491EC > (gpointer)m2: 080491F5 > Hello again - 0002 was pressed > Hello again - 0002 was pressed > Check it - 080491EC was pressed > > Naturally, if I use %s to try and output the data from

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 callback(

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 a

Re: Losing GtkTextBuffer when threading

2005-10-11 Thread Alan M. Evans
init( NULL ); > gdk_threads_init(); > gdk_threads_enter(); > net_init( &net, txtoutput_buffer); > pthread_create( &net->thread, NULL, net_thread, &net ); > What's going on here? Is there anywhere a call to gtk_text_buffer_new() ? -- Alan M. Evans <[EMAIL

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(

Re: g_strsplit

2005-10-05 Thread Alan M. Evans
On Wed, 2005-10-05 at 08:56, Alan M. Evans wrote: > /* append terminating nulls to string arrays */ > g_ptr_array_add(attributes,0); Sorry, neglected to change the variable name in that copy/pasted example. Should have been: g_ptr_array_add(parray,0); > /* throw away GLib array bo

Re: g_strsplit

2005-10-05 Thread Alan M. Evans
hen I'm done manipulating the array, I get the string array back: /* append terminating nulls to string arrays */ g_ptr_array_add(attributes,0); /* throw away GLib array bookkeeping - keep only array data */ sarray = (gchar**)parray->pdata; g_ptr_array_free(parra

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

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 eithe

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 th

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

g_thread_init question

2005-06-01 Thread Alan M. Evans
Hello all! The docs on developer.gnome.org state that g_thread_init() will abort if called twice and suggest the following construct to avoid multiple calls: if (!g_thread_supported ()) g_thread_init (NULL); Has nobody noticed that there's a race condition there? If I make a class that intern

Re: gtk_text_entry

2005-05-20 Thread Alan M. Evans
On Fri, 2005-05-20 at 10:30, Alan M. Evans wrote: > gboolean onEnter(GtkWidget *widget, gpointer *data) { > /* called when user presses Enter */ > const gchar *s = gtk_entry_get_text(data->entry); > /* Do something with the text here, >then to

Re: gtk_text_entry

2005-05-20 Thread Alan M. Evans
On Thu, 2005-05-19 at 23:17, srinivas wrote: > thanks for reply to my queries, still i am facing the same problem, > i can't get the text entered in to the gtk_text_entry widget. how can i > get the text entered in to the text_entry widget. is any event signal i > have to give to text_entry widge

Re: How to detect already running application...

2005-03-18 Thread Alan M. Evans
On Fri, 2005-03-18 at 06:05, Miroslav Rajcic wrote: > Is there any gtk-only way (not Gnome oriented) to do this ? > I am looking for the same answer for my app, and the code needs to be > working on Windows too. > > Windows-only code is pretty simple using named mutex to act as kind of > interproc