*I have a weird issue on an application I am developing*
*The application is fully tabbed and runs loops to transcode video files,
and I would like to be able to run the main transcoding loop fully in
parellel, ie: the process running in one tab is totally separate to that
running in another tab*
Mihai Draghicioiu wrote:
I have found the way. Here is my code. Any idea where I can post it as a
tutorial?
Gtk Forums? they have a section specifically for Gtk example code:
http://www.gtkforums.com/forum-15.html
http://www.gtkforums.com/
Carlos
#include stdlib.h
#include glib.h
#include
Not sure where on the wiki to post... any hints?
On Wed, Aug 12, 2009 at 8:52 AM, Emmanuel Rodriguez
emmanuel.rodrig...@gmail.com wrote:
You can submit your code to be included with the examples of gtkglarea or
use the GNOME wiki (http://live.gnome.org/).
--
Emmanuel Rodriguez
I have found the way. Here is my code. Any idea where I can post it as a
tutorial?
#include stdlib.h
#include glib.h
#include gdk/gdk.h
#include gdk/gdkgl.h
#include GL/gl.h
GdkGLWindow *glwin = NULL;
GdkGLContext *glcontext = NULL;
GMainLoop *mainloop;
static void event_func(GdkEvent *ev,
On Wed, Aug 12, 2009 at 5:09 AM, Mihai Draghicioiu
mihai.draghici...@gmail.com wrote:
I have found the way. Here is my code. Any idea where I can post it as a
tutorial?
You can submit your code to be included with the examples of gtkglarea or
use the GNOME wiki (http://live.gnome.org/).
--
main loop. I have looked at the GLib main loop reference page, but I have no
idea how to make the this work. So I need some hints here.
And for the GDK_EXPOSE event thing, I even set the all events mask, and
there was still no expose event. I went around this by drawing outside the
event switch
main loop. I have looked at the GLib main loop reference page, but I have no
idea how to make the this work. So I need some hints here.
And for the GDK_EXPOSE event thing, I even set the all events mask, and
there was still no expose event. I went around this by drawing outside the
event switch
the window does not receive an Expose event.
I was told that for blocking until an event arrives, I'd have to use GLib
main loop. I have looked at the GLib main loop reference page, but I have
no
idea how to make the this work. So I need some hints here.
And for the GDK_EXPOSE event thing, I
On Thu, Jul 23, 2009 at 5:33 AM, Mihai Draghicioiu
mihai.draghici...@gmail.com wrote:
Hi all! I'm making an OpenGL application based on GDK + GtkGLArea. My code
so far works, but it has two issues:
Do you really need to have your application based on GDK? Can't you use GTK
instead?
By using
I'd rather avoid the overhead of GTK+. My other choices were SDL and glut
(and maybe others), but none of those offer the features of GDK (and GLib!).
I have thought about using GTK+, and it's just pointless overhead, because
I'm going to use my own (OpenGL-based) UI library. Besides, it's more
On Thu, Jul 23, 2009 at 7:34 AM, Mihai Draghicioiu
mihai.draghici...@gmail.com wrote:
I'd rather avoid the overhead of GTK+. My other choices were SDL and glut
(and maybe others), but none of those offer the features of GDK (and
GLib!).
I have thought about using GTK+, and it's just
Thomas Stover wrote:
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
Alexander Semenov wrote:
Thomas Stover wrote:
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
On Wed, 2008-11-12 at 15:20 -0600, Thomas Stover wrote:
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?
only if you use GObject and the rest of the type system - in which case
you'll
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
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
in glib to run blocking code outside the glib main loop
to prevent locking the gtk+ GUI?
Do you guys know an easy solution like SwingWorker for glib?
You can do non-blocking reads and writes with GIOChannel without having
to start any new threads and it is not much more difficult than
Do you guys think a simple API like SwingWorker could be integrated in glib?
Show us how the GLib API would look, and then if nobody opposes
violently, volunteer to write the code and maintain it at least for
one release cycle. Pointing at the Wikipedia page describing the Java
API of
You can do the open with
http://library.gnome.org/devel/glib/stable/glib-IO-Channels.html#g-io-channel-new-file
and you can do that async with the
http://library.gnome.org/devel/glib/stable/glib-IO-Channels.html#g-io-channel-set-flags
as Chris mentioned.
- John
On Tue, Sep 9, 2008 at 9:42 AM,
On Tue, 9 Sep 2008 16:38:16 +0200 (MEST)
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
[snip]
I would like to have a extremely simple API in glib for doing this
kind of blocking calls as easily as possible.
Do you guys think a simple API like SwingWorker could be integrated
in glib?
There
man, 08 09 2008 kl. 23:16 +0200, skrev [EMAIL PROTECTED]:
I just saw Havoc's blog entry SYNCHRONOUS IO NEVER OK:
http://log.ometer.com/2008-09.html#7
and I wondered if there is a
http://en.wikipedia.org/wiki/SwingWorker
like interface in glib to run blocking code outside the glib main loop
John Hobbs wrote:
You can do the open with
http://library.gnome.org/devel/glib/stable/glib-IO-Channels.html#g-io-channel-new-file
and you can do that async with the
http://library.gnome.org/devel/glib/stable/glib-IO-Channels.html#g-io-channel-set-flags
as Chris mentioned.
I think you did not
I just saw Havoc's blog entry SYNCHRONOUS IO NEVER OK:
http://log.ometer.com/2008-09.html#7
and I wondered if there is a
http://en.wikipedia.org/wiki/SwingWorker
like interface in glib to run blocking code outside the glib main loop
to prevent locking the gtk+ GUI?
Do you guys know an easy
outside the glib main loop
to prevent locking the gtk+ GUI?
Do you guys know an easy solution like SwingWorker for glib?
You can do non-blocking reads and writes with GIOChannel without having
to start any new threads and it is not much more difficult than
blocking reads - you set it non
Tristan Van Berkom wrote:
On Thu, 2007-10-04 at 00:12 +0200, Christian Buennig wrote:
[...]
However, that does not matter any more. As suggested by you and jcupitt
I'll avoid to autonomously run a main loop within the library.
Note that in some contexts it makes sense to run a nested
Poor place to use the term context in casual parlance ;)
On 10/4/07, Tristan Van Berkom [EMAIL PROTECTED] wrote:
Note that in some contexts it makes sense to run a nested mainloop from
a library if its safe to assume the app is already running a mainloop,
an example of this is
Hi,
thanks for the hints, however, some more questions below..
Donny Viszneki wrote:
I'm a bit of a newb to this, so others should feel free to correct me.
On 10/2/07, Christian Buennig [EMAIL PROTECTED] wrote:
Hi,
I have a general question about the concepts of GLib main loops.
I've
On 10/2/07, Christian Buennig [EMAIL PROTECTED] wrote:
* Do main loops exist per process or per thread?
If I start a main loop in one thread (A) and add an IO watch in
another thread (B), does this watch get added to the main loop of the
thread A or B ?
Each process can have one or more
Thanks a lot! This makes things a bit more clear.
One final question:
Is it possible to detect if the default context currently has an active
main loop?
I want to add IO watches to the default context in a library. Apps using
the library may decide to start a main loop themselves (in the default
On 10/3/07, Christian Buennig [EMAIL PROTECTED] wrote:
I want to add IO watches to the default context in a library. Apps using
the library may decide to start a main loop themselves (in the default
context) or to let the library do this. Of course they could tell the
library somehow if there
not interact with the main loop from your library,
let the application do that.
If you want events such as your IO watches to reach into libraries
you've loaded, have the libraries connect to the appropriate signals,
and the glib main loop will do the rest.
--
http://www.socsurveys.org/
http
Oh, I forgot this part:
On 10/3/07, Christian Buennig [EMAIL PROTECTED] wrote:
Of course they could tell the
library somehow if there already is a running main loop in the default
context, but it would be nice if the library could detect this itself.
Donny Viszneki wrote:
Oh, I forgot this part:
On 10/3/07, Christian Buennig [EMAIL PROTECTED] wrote:
Of course they could tell the
library somehow if there already is a running main loop in the default
context, but it would be nice if the library could detect this itself.
On Thu, 2007-10-04 at 00:12 +0200, Christian Buennig wrote:
[...]
However, that does not matter any more. As suggested by you and jcupitt
I'll avoid to autonomously run a main loop within the library.
Note that in some contexts it makes sense to run a nested mainloop from
a library if its safe
Hi,
I have a general question about the concepts of GLib main loops.
I've read the GLib reference several times but still I don't get how
main loops internally work. To be precisely, the following questions occur:
* Do main loops exist per process or per thread?
If I start a main loop in one
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Wed, Jan 03, 2007 at 01:02:39PM -0200, Leandro A. F. Pereira wrote:
Greetings!
[idle_free]
Cute. But as Iago points out, you'll have to make sure that your app
doesn't go into idle until the object is used. Tough call. I'd think
it's more
On Thu, Jan 04, 2007 at 02:00:14PM +, [EMAIL PROTECTED] wrote:
Try alloca() if you are into that sort of thing. It's frowned upon,
because it is a BSD extension...
g_newa() should work on all platforms GLib works on.
Yeti
--
http://physics.muni.cz/~yeti/pf2007.png
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Thu, Jan 04, 2007 at 03:15:10PM +0100, David Nečas (Yeti) wrote:
On Thu, Jan 04, 2007 at 02:00:14PM +, [EMAIL PROTECTED] wrote:
Try alloca() if you are into that sort of thing. It's frowned upon,
because it is a BSD extension...
);
gchar *temp2 = g_strdup_printf(%s - %f, temp, G_PI);
g_free(temp);
return temp2;
}
Much better: temp won't leak anymore, but we had to use another
variable. I propose a simpler solution, but it requires that your
program runs in the GLib main loop. It should be used only on callback
.
You can just do:
gchar *func(void) {
return g_strdup_printf(i am a temporary string - %f, G_PI);
}
Much better: temp won't leak anymore, but we had to use another
variable. I propose a simpler solution, but it requires that your
program runs in the GLib main loop. It should be used only
I'm not understanding something about the glib main loop and reference
counting.
I've got this trivial program that does nothing:
- begin -
#include signal.h
#include stdio.h
#include glib.h
GMainLoop* main_loop = NULL;
void signal_handler(int signo
Sebastian Kuzminsky wrote:
[...]
The way I read this, g_main_loop_new() is allocating memory and not
freeing it, even though I quit the loop and unref it. Clue in a helpless
noob, what's going on here?
The way I'm reading that trace, the g_main_loop_new() function when called
the first
Hello All, I have one quey about the function g_main_context_add_poll function. Once we add a file descriptor to be polled and if file descriptor is ready, how do we call a callback function for it. What i mean to say is if we use g_main_context_add_poll, where and how do we set the
On Thu, 29.08.02 01:09, Havoc Pennington ([EMAIL PROTECTED]) wrote:
I believe if you create a custom source type with a check function
that returns true if any of your other sources have run, such that
it's dispatched if cleanup is needed, and then attach that source at a
lower priority than
Lennart Poettering [EMAIL PROTECTED] writes:
An example: I have a main context with four or five distinct attached
sources. if any of these get triggered, some cleanup work is needed
after their execution. If three of them are dispatched in an iteration
i want to have my cleanup function
45 matches
Mail list logo