Gtk+ 3 Quartz

2012-08-07 Thread Thomas Stover
Is anyone on this list using the quartz back end for 3.x? I'm experimenting with osx for the first time years, and I forgot what a nightmare that platform is. Anyway, trying to stay constructive, what exactly are you using? As in os version number - regular jhbuild? mac ports? other? The X11 back

Re: Formatting dates according to the region

2012-04-17 Thread Thomas Stover
> On Mon, Apr 16, 2012 at 12:13 PM, Michael Cronenworth > wrote: > > Look at the documentation for g_date_time_format(). You will find > > the other format specifiers that you want. %a, %A, %b, %B, and %c > > look helpful for you. > > Thanks for your suggestion, but the trouble I have with those

threads, idle sources, python

2011-05-23 Thread Thomas Stover
It appears I've run up against a deficiency in pyglib. Maybe there is a work around? Take the case of trying to schedule an idle callback to run in another thread's main loop. An illustration in C... #include #include GMainContext *gmain_context; GMainLoop *main_loop; gboolean idle_callback(

Re: GSource object lifetime

2011-05-03 Thread Thomas Stover
On Tue, 3 May 2011 22:50:38 +0200, Tadej Borovšak wrote: > All that being said, maybe you could "cook up" a patch for API docs > with this info? I'm sure people would find it useful. > Is there a starting place to read how to go about doing that? -- www.thomasstover.com FLYNN LIVES!

Re: GSource object lifetime

2011-05-03 Thread Thomas Stover
On Tue, 3 May 2011 22:06:02 +0200, Tadej Borovšak wrote: > Hi. > >> I'm repetitively calling g_idle_source_new(), g_source_set_callback(), >> g_source_attach() to get an idle callback to run in a separate thread. >> The >> callback in question always exits with FALSE. > > Do you call g_source_un

GSource object lifetime

2011-05-03 Thread Thomas Stover
trying to stop a memory leak (2.24.1 x86_64)... I'm repetitively calling g_idle_source_new(), g_source_set_callback(), g_source_attach() to get an idle callback to run in a separate thread. The callback in question always exits with FALSE. The docs for GSourceFunc() state: ... Returns :

g_atomic_int_compare_and_exchange

2010-09-07 Thread Thomas Stover
I was just looking at gatomic.c to see if g_atomic_int_compare_and_exchange() would work on an integer inside memory obtained by mmap(MAP_SHARED) safely between processes. With my limited understanding it looks like it probably would except for the cases when it has to fall back to g_mutex_()* ops

Gtk+3 xcb asynchronous X11

2010-08-26 Thread Thomas Stover
The talk of gtk 3 coming down the line reminded me a an old question I once had. I remember reading a paper analyzing X11 performance problems that concluded drawing operations were slowed because the synchronous nature of xlib required steps to wait for round trip traffic completion notifications

win32 & win64 Gtk+ apt repo?

2010-06-23 Thread Thomas Stover
We are moving to the deb packaged win32 & win64 mingw cross compilers that are available in the ubuntu 10.4 apt repositories, instead of home-built ones. This btw is awesome! With almost all of our windows development now completely ubuntu hosted, the notion of using .deb packaged win32/64 developm

Re: 1-Bit Bitmap

2010-06-01 Thread Thomas Stover
..."Any library that you can think of that offers bit by bit access without me needing to write a separate function to shift the bits out one by one from a 32-Bit int? Kind of like a bitarray?" Are you using something other than C? -- www.thomasstover.com _

Re: gthreads and file operations

2010-04-12 Thread Thomas Stover
On Tue, 13 Apr 2010 01:01:15 +0530, Nischal Rao wrote: >> Is the >> threads part of the code I had sent earlier correct? I haven't seen the code yet. It could be me, but the mailing list software probably scrubs attachments. Most folks just post as inline text. -- www.thomasstover.com __

Re: gthreads and file operations

2010-04-12 Thread Thomas Stover
On Mon, 12 Apr 2010 21:25:44 +0530, Nischal Rao wrote: > the files are coming empty. I suspect this is happening because of thread > lock problems... > > Have you tried a "flush" operation. ie fflush() or g_io_channel_flush()? Beyond that we would need to see some sort of code example. -- ww

Re: gthreads and file operations

2010-04-12 Thread Thomas Stover
1) you mean glib threads right? (maybe there is a gnome thread?) 2) you're going to want to use glib based functions like io channels instead of stdio (for regular files at least) 3) "don't seem to work" is not enough information for anyone to help you 4) you also need a real reason to be using thr

g_io_channel_write_*() & GMainLoop logic

2010-03-30 Thread Thomas Stover
I'm looking for some tips on understanding how to make socket writes work in a main loop. In my past non-glib socket programs, I have had to do some write logic similar to: 1) attempt to write n bytes 2) if all n bytes were written, great 3) if some or all bytes were non written, that must mean OS

Re: g_main_context_push_thread_default() & g_io_*()

2010-03-30 Thread Thomas Stover
On Mon, 29 Mar 2010 20:26:03 -0400, "A. Walton" wrote: > On Mon, Mar 29, 2010 at 6:58 PM, Thomas Stover > wrote: >> In the documentation for g_main_context_push_thread_default(), the >> following sentence appears: >> >> "This will cause certain as

g_main_context_push_thread_default() & g_ io_*()

2010-03-29 Thread Thomas Stover
In the documentation for g_main_context_push_thread_default(), the following sentence appears: "This will cause certain asynchronous operations (such as most gio-based I/O) which are started in this thread to run under context and deliver their results to its main loop, rather than running under t

Re: glib & *nix signals

2010-02-08 Thread Thomas Stover
> From: "Brian J. Tarricone" > To: gtk-app-devel-list@gnome.org > Subject: Re: glib & *nix signals > Message-ID: <4b6dcb57.6080...@cornell.edu> > Content-Type: text/plain; charset=ISO-8859-1 > > > I usually create a pipe (see pipe(2)), wrap the read side in a > GIOChannel, and watch it via g_io

glib & *nix signals

2010-02-04 Thread Thomas Stover
I'm looking for some notes / advise on catching SIGTERM in a glib main loop based program. Mainly on linux, but other kernels would be nice. This article: http://www.linuxjournal.com/article/2121 for instance, recommends masking all signals all the time and creating a dedicated thread siting aro

Re: main loop & asynchronous queues

2009-09-24 Thread Thomas Stover
Chris Vine wrote: In your code you didn't create a GMainContext object for each of your threads, which is the key point. Each thread in which you want a main loop should call g_main_context_new() which will create a GMainContext object for the calling thread, then use that to create a GMainLoop o

Re: main loop & asynchronous queues

2009-09-23 Thread Thomas Stover
Chris Vine wrote: In the case of callbacks to execute in the default program loop/context (the "main" main loop) a worker thread can use g_idle_add()/ g_idle_add_full(). To execute a callback in other threads' main loops you will have to do it in long-hand, making a GSource object with g_idle_so

main loop & asynchronous queues

2009-09-22 Thread Thomas Stover
Does glib allow for things like a two threaded program with inter-thread communication via async queues while each thread has a separate main loop waiting for both external stimulus and new queue messages to arrive? In other words, a) can a main loop be made to run a callback when a queue messa

Re: why do constructors return GtkWidget?

2009-09-10 Thread Thomas Stover
Emmanuel Touzery wrote: It startles me that it doesn't seem to bother people much that all the widget variables are declared as GtkWidget*. Well, if you want you can use variables of type GtkWidgetOfTypeX * and type cast on the call of constructor. You have to type cast back to GtkWidget * allo

Re: why do constructors return GtkWidget?

2009-09-10 Thread Thomas Stover
Tristan Van Berkom wrote: On Thu, Sep 10, 2009 at 3:24 PM, Thomas Stover wrote: [...] Well that's pretty much how I see it, but creating new derived widgets is not always the same thing as dynamic interface manipulation. The issue that grabbed my attention more was the notion of a

Re: why do constructors return GtkWidget?

2009-09-10 Thread Thomas Stover
Tristan Van Berkom wrote: Im not exactly sure what your trying to say, my understanding is that in the modern world you create widget subclasses when you need composite/dynamic widgets, all widgets are generally layed out in some kind of form, or multiple forms. Thats my understanding of the bl

Re: why do constructors return GtkWidget?

2009-09-10 Thread Thomas Stover
Tristan Van Berkom wrote: On Wed, Sep 9, 2009 at 2:53 AM, Emmanuel Touzery wrote: Hi, [...] You know what I'm thinking... I think that this is from times where people used to build GUIs in the code... When they were writing all the container embedding and all,

Re: custom tree model, iters, and memory management

2009-07-31 Thread Thomas Stover
Kristian Rietveld wrote: Hi, On Sun, Jul 26, 2009 at 8:22 PM, Thomas Stover wrote: While working on a custom tree model (thanks to Tim-Philipp Müller for the tutorial), I needed more pointers in my iter structure than the user_data, user_data2, and user_data3. So I defined a new structure

custom tree model, iters, and memory management

2009-07-26 Thread Thomas Stover
While working on a custom tree model (thanks to Tim-Philipp Müller for the tutorial), I needed more pointers in my iter structure than the user_data, user_data2, and user_data3. So I defined a new structure and stored that in user_data. For the model's _get_iter(), _iter_children(), _iter_paren

Re: g_spawn_async_with_pipes() & ssh based IPC

2009-07-09 Thread Thomas Stover
Michael Cronenworth wrote: You could have a TLS session without x509 auth and just use PAM or LDAP for user auth. Something like that is not provided by a single function call though. In a perfect world a password, another private key, or what ever wouldn't ever enter the picture. ssh-agen

Re: g_spawn_async_with_pipes() & ssh based IPC

2009-07-09 Thread Thomas Stover
Michael Cronenworth wrote: Thomas Stover on 07/09/2009 02:37 PM wrote: Is all this in anyway better than a maybe a custom tls/ssl server or something? I know this is slightly off topic, but I know everybody has had to ask themselves this same question. It's simple to write a G

g_spawn_async_with_pipes() & ssh based IPC

2009-07-09 Thread Thomas Stover
So as much as I wish there were real (open source) ssh client and server C libraries for the ssh infrastructure, the general approach seems to to be child process with redirected IO on the client (with ssh on *nix and plink.exe on windows). On the server side connecting to a long running "serve

Re: GTK+ 2.16.4 released

2009-07-02 Thread Thomas Stover
From: Gabriele Greco Subject: Re: GTK+ 2.16.4 released To: gtk-app-devel-list@gnome.org On Thu, Jul 2, 2009 at 12:58 AM, Matthias Clasen wrote: GTK+ 2.16.4 is now available for download at: About 2.16 releases: There is some official (like Tor Win32 bundles) or unofficial OSX f

Re: "portable" applications

2009-06-24 Thread Thomas Stover
Date: Wed, 24 Jun 2009 08:41:50 -0400 From: John Zavgren Subject: "portable" applications To: gtk-app-devel-list@gnome.org Message-ID: <8bea388a0906240541p1bc747c7x174a9b35828b5...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Greetings: I wrote a Glade-3/GTK2/G++ applic

re: gtk & gis

2009-06-12 Thread Thomas Stover
Date: Thu, 11 Jun 2009 15:36:31 +0200 From: Andrea Zagli Subject: gtk & gis To: gtk-app Message-ID: <20090611153631.146644e2qf6bk...@saetta.homelinux.org> Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" do you know some widget that can display maps (from shp or postgis)

Re: g_io_channel_win32_new_messages() & WaitForSingleObject()

2009-04-02 Thread Thomas Stover
Chris Vine wrote: I may be missing your point (I would have to read through the back-posts to make sense of it), but if you want to create your own source object to hold its own protected/private data, it is just this: struct MySource { GSource source; /* my data, such as a gpointer but it cou

Re: g_io_channel_win32_new_messages() & WaitForSingleObject()

2009-04-02 Thread Thomas Stover
oll(g_source, &g_poll_fd); g_source_set_callback(g_source, my_source_callback, NULL, NULL); if(CreateThread(NULL, 0, thread_entry, NULL, 0, NULL) == NULL) { error_code = GetLastError(); error_string = g_win32_error_message(error_code); g_print("1) CreateThread() failed, \"%s\"\n", error_stri

Re: g_io_channel_win32_new_messages() & WaitForSingleObject()

2009-04-02 Thread Thomas Stover
Man, I'm almost there. First, just ignore everything having to do with win32 services. I was misreading the msdn service example. The WaitFor*() is really done on an "event". So here is a stripped down demo of the progress so far. It does what I want, but then crashes before ending the event lo

Re: g_io_channel_win32_new_messages() & WaitForSingleObject()

2009-03-31 Thread Thomas Stover
Tor Lillqvist wrote: I have never used that service control API, no idea what it is used for even... oh, just the needlessly complex, 75 step, windows' equivalent to daemon() But if MSDN says that the returned SERVICE_STATUS_HANDLE actually is a normal HANDLE and a waitable one even, that c

g_io_channel_win32_new_messages() & WaitForSingleObject()

2009-03-31 Thread Thomas Stover
Anyone know if you can use a win32 message io channel on arbitrary "handles" or just gdi windows or whatever the intended use of that is? I openly admit a don't "get" windows at all, so this maybe just really out there. Specifically, if I had "handle" returned from RegisterServiceCtrlHandler()

jpeg to bmp with pixbuf; gtk cairo imagemagick libcurl

2009-01-30 Thread Thomas Stover
I've used ImageMagick http://www.imagemagick.org/script/index.php to bring jpegs into cairo surfaces which is similar. They have an api that lets you decode a file to a memory buffer directly. Pay close attention to the different pixel formats. Here is some code that will embarrass me. I pulled

Re: utf-16 and glib

2009-01-30 Thread Thomas Stover
Please, please, please don't switch to UTF-16. To me gtk is about getting to use technologies that are "solid", "real", "fun", and "effective". Principally, that means C and *nix. UTF-8 is the greatest thing for one reason that kills all the others: solid compatibility with both of the above. I

qt vs gtk

2009-01-14 Thread Thomas Stover
With the recent news that Nokia will be releasing QT under LGPL, I'm seeing allot of knee-jerk anti-GTK comments out there. I know I'm preaching to the choir on this list, but for the sake of moral I thought I would post my 2 cents on the matter. -I can't think of single QT application I even

glib preprocessor strangeness

2008-12-30 Thread Thomas Stover
Ok so in the setup I've got, this works: $PKG_CONFIG_PATH=/opt/crosscompilers/gcc-4.0.1-glibc-2.3.5/arm-unknown-linux-gnu/lib/pkgconfig/ /opt/crosscompilers/gcc-4.0.1-glibc-2.3.5/bin/arm-unknown-linux-gnu-gcc `pkg-config --cflags glib-2.0` glibtest.c `pkg-config --libs glib-2.0` Which it is

Re: Running on Windows?

2008-12-22 Thread Thomas Stover
There is a certain ironic sadness to this truism. Date: Fri, 19 Dec 2008 04:55:07 -0800 (PST) From: lwhmellow ... Can be imaged my teacher must be mad if I ask him to install the runtime environment before clicking on my application. ... ___ gtk-

Re: glib main loop without gtk

2008-11-13 Thread Thomas Stover
First thanks to Alexander Semenov, and Emmanuele Bassi for your responses. It took some poking around, but I think get it now. Here is a concept demo for any future searches that find this thread. I'm not sure how to get out of the infinite loop though, since _iteration() returns both TRUE and

glib main loop without gtk

2008-11-12 Thread Thomas Stover
So if one wants to use g_io_channels with out gtk (console / server app), what exactly is the idea? Does glib need an initialization function called first? I see the g_main_loop_new() and friends functions, and that part make sense. The thing is g_io_add_watch_full() type functions don't have a

Re: postgresql & gtk

2008-07-23 Thread Thomas Stover
Iorio wrote: On Wed, 23 Jul 2008 09:31:33 -0500, Thomas Stover <[EMAIL PROTECTED]> wrote: -I would recommend using the native postgresql library, libpq. -The next thing to think about is what programming model to use - synchronous, threaded, or asynchronous for the database side. If

Re: gtk-app-devel-list Digest, Vol 51, Issue 31

2008-07-23 Thread Thomas Stover
Although I haven't written a postgresql app myself, it is something that I have almost had to do several times. Here are some thoughts to help you get started: -Since you didn't specify what language you are using, I'll start by saying use C, because you then get to work with gtk and postgresq

Re: How to draw a primitive with one color and fill it with, another? (Sergey Parhomenko)

2008-04-15 Thread Thomas Stover
I would suggest you look at doing your drawing with cairo if possible. Once I discovered that, I gave up on calling all those gdk functions. Read the documents on their site at, http://www.cairographics.org . It looks like most gtk drawing is going this way. I'm also fuzzy on what the role of t

Re: What's wrong with the docs?

2008-01-31 Thread Thomas Stover
I feel the same way. I can't think of an example off of the top of my head, but I swear there have been things that the only way I figured them out was by reading the python documentation and sort of guessing at the C API. Yes I look at the reference docs on gtk.org and gnome.org. > Date: Wed, 3

printing, cairo, & cups

2007-11-27 Thread Thomas Stover
I've been trying to get myself up to speed with state of printing support in Gtk, and I'm down to just a few conceptual questions. It looks like the general idea is to setup a callback to render with cairo one page at a time using a GtkPrintContext. From this I would speculate that on win32, a

Re: Don't understand valgrind output

2007-10-15 Thread Thomas Stover
> Date: Sun, 14 Oct 2007 10:24:14 -0400 (EDT) > From: Allin Cottrell <[EMAIL PROTECTED]> > Subject: Re: Don't understand valgrind output > To: Michael Lamothe <[EMAIL PROTECTED]> > Cc: gtk-app-devel-list@gnome.org > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: TEXT/PLAIN; charset=US-ASC