win32: FileChooserWidget + gtk_window_set_deletable

2007-12-05 Thread Felix Kater
Hi, could anyone please say if this should be considered a bug -- if so, I'd file an issue at bugzilla: * use win32 (not yet tested on linux) * create toplevel window * gtk_window_set_deletable(window,FALSE) [this is the critical part] * place a FileChooserWidget into window * show window * click

Re: gdk_threads_set_lock_functions

2007-06-29 Thread Felix Kater
> what does "temporarily" mean here: > > gdk_threads_set_lock_functions: "[...] When GTK+ unlocks the GTK+ lock > when entering a recursive main loop, the application must temporarily > release its lock as well." What ever that means... > my recursive locks ... had a bug. Thanks Felix ___

gdk_threads_set_lock_functions

2007-06-28 Thread Felix Kater
hi, what does "temporarily" mean here: gdk_threads_set_lock_functions: "[...] When GTK+ unlocks the GTK+ lock when entering a recursive main loop, the application must temporarily release its lock as well." Does that mean (A) that GTK+ sometimes simply tells me that it has done its tasks and I c

Re: linux vs. win32: gdk_threads_enter behaving different

2007-06-15 Thread Felix Kater
On Fri, 15 Jun 2007 22:33:24 +0300 Tor Lillqvist <[EMAIL PROTECTED]> wrote: > Then your > first problem might be that you don't call gdk_threads_enter before > calling gtk_init() and gtk_main()? One more on this aspect: What happens if gtk_main is quitted and then restarted? I assume gtk_init() s

Re: linux vs. win32: gdk_threads_enter behaving different

2007-06-15 Thread Felix Kater
On Fri, 15 Jun 2007 22:33:24 +0300 Tor Lillqvist <[EMAIL PROTECTED]> wrote: > Are you sure that it's gdk_threads_enter itself that blocks? Yes. > Then your > first problem might be that you don't call gdk_threads_enter before > calling gtk_init() and gtk_main()? Excellent. It was in between. (I

Re: linux vs. win32: gdk_threads_enter behaving different

2007-06-15 Thread Felix Kater
Kevin DeKorte <[EMAIL PROTECTED]> wrote: > - From my limited GTK experience I have found that g_idle_add always > seems to work better than using gtk_threads_enter/leave. Yes, the reason why idle functions work in any case is most probably because they are running in the same thread as where gtk

linux vs. win32: gdk_threads_enter behaving different

2007-06-15 Thread Felix Kater
Could anyone please explain this behaviour: Imagine a simple window with 1 box and 2 buttons in it. If you press the first button, the second is destroyed, and a newly created button packed into the box. This *works* on linux and win32 (gtk+-2.10.13). Now, let button 1 start a thread which does

Re: GtkTreeView: different renderes within one row?

2007-05-31 Thread Felix Kater
"Vivien Malerba" <[EMAIL PROTECTED]> wrote: > > I'd like to create a two column list with simple text display on the > > left but each row having a different renderer on the right (combo, > > spin, entry). > > I suggest you then create a custom cell renderer which will adapt > itself to the displ

Re: GtkTreeView: different renderes within one row?

2007-05-30 Thread Felix Kater
typo in subject line: GtkTreeView: different renderers within one COLUMN? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

GtkTreeView: different renderes within one row?

2007-05-30 Thread Felix Kater
hi, I am new to GtkTreeView: Are cell renderers bound to columns or can they change between rows of the same column? I'd like to create a two column list with simple text display on the left but each row having a different renderer on the right (combo, spin, entry). Thanks Felix __

g_signal_handler_block() for individual signals?

2007-05-25 Thread Felix Kater
Hi, is there a solution for this (please consider the toggle button as an example only for various cases like these I am interested in): For example: The "clicked" signal handler is connected to a toggle button. Now, different threads call gtk_toggle_button_set_active() to toggle it, however, for

Re: my summary on how to use gtk with threads

2007-05-25 Thread Felix Kater
On Thu, 24 May 2007 01:03:25 +1000 Andrew Cowie <[EMAIL PROTECTED]> wrote: > http://research.operationaldynamics.com/blogs/andrew/#gtk-thread-awareness Keep on. :-) > I didn't quite agree with this conclusion: > > > do not use gdk_threads_set_lock_functions() to facilitate (a) > > as that was

my summary on how to use gtk with threads

2007-05-20 Thread Felix Kater
Hi, here is my short summery of how to use gtk with threads, ordered by the main problems to be worked around. I aimed to find a small set of *general* rules to follow rather than solutions for individual cases. So this guides shall turn gtk's thread awareness into thread safety--for those who nee

gtk_scrolled_window_set_shadow_type

2007-05-07 Thread Felix Kater
Hi, gtk_scrolled_window_set_shadow_type() works correctly, however, probably not in the way the user expects: The function sets the shadow type of the (outer) window, and leaves the (inner) shadow type of the viewport as is. So, if not created manually, the user never gets the viewport in her han

Re: Theme writing guide/tutorial

2006-11-22 Thread Felix Kater
On Wed, 22 Nov 2006 10:38:31 +0100 Gabriele Greco <[EMAIL PROTECTED]> wrote: > There is a guide not aimed to programmers about theme writing for GTK > (I'm mostly intrested in pixbuf themes, but also a generic guide > could be useful)? > > I've to explain a graphic artist how to design a theme f

documentation: g_slist_remove*, g_slist_delete*

2006-09-18 Thread Felix Kater
Hi, here some remarks about the documentation of some g_slist* functions: g_slist_remove(): It is not explicitly said if the data which the element points to is freed as well. If you read g_slist_remove_link() below then you might understand that, however, indirectly only. g_slist_delete_link()

getting symbols from dynamic modules

2006-09-18 Thread Felix Kater
Hi, g_module_* is a great thing -- I just wonder if there is a way to not create function pointers for each single function I need but just import all of them at once? Felix ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gn

gtk+/gdk and multiple monitors

2006-07-19 Thread Felix Kater
Hi, I am looking for a solution to display gtk+/gdk and other X applications like firefox across 4 monitors connected to one computer. The task is to show different content (e.g. 4 different gtk + apps) on each screen but also perform text marquee effects across all of them (like one big frameless

gtk-2.8.17: combo box: width calculated incorrectly?

2006-05-15 Thread Felix Kater
Hi, I am using gtk-2.8.17/win32. I've made a combo box with about 30 entries, most just text, some lines like "**" (a string of asterisks). At runtime when I open the box I've noticed that the combo box adds more extra space to the right of all lines than actual

Re: table widget: expanding

2006-05-05 Thread Felix Kater
On Thu, 4 May 2006 23:33:18 +0200 David Nečas (Yeti) <[EMAIL PROTECTED]> wrote: > On Thu, May 04, 2006 at 11:12:32PM +0200, Felix Kater wrote: > > To achieve this I assume I need to do two things: tell the table to expand > > itself to the maximum, and tell it to expand the

table widget: expanding

2006-05-04 Thread Felix Kater
Hi, my table widget simply contains a label (first row) and a scrolled window (second row). I need the scrolled window (with a large drawing area inside) to expand. However, it doesn't. To achieve this I assume I need to do two things: tell the table to expand itself to the maximum, and tell i

gtk_widget_destroy(): destroys embedded widgets?

2006-05-04 Thread Felix Kater
Hi, if I destroy a container (in my case a gtk table widget), does it automagically remove all widgets which have been attached to it before--or do I have to destroy all embedded widgets before one by one? Felix ___ gtk-app-devel-list mailing list gtk

buffer locking for DMA?

2006-03-09 Thread Felix Kater
Hi, I use glib on windows to allocate memory for a camera. Its DLL then uses the memory and pass it to the kernel and fill it via DMA. I have to be sure that windows doesn't move my buffer(s) later since the kernel has built its allocation table using it. With windows there are functions to preve

Re: get current time / win32: got UTC instead of local time

2005-12-08 Thread Felix Kater
Hi, On 12/7/05, HuamiSoft Hubert Sokolowski <[EMAIL PROTECTED]> wrote: > did you try with > time_t t; [...] I assume I have to include time.h then? Where do I get a portable version of time.h from? Felix ___ gtk-app-devel-list mailing list gtk-app-

get current time / win32: got UTC instead of local time

2005-12-07 Thread Felix Kater
Hi, to sum up: With g_get_current_time() / win32 it seems that I get UTC instead of the local time. How can I get the local time? Long version: I use g_get_current_time() / win32 to set GTimeVal and calculate the current hour of the day (0-23) like this: hour_of_the_day= my_gtimeval.tv_sec %

get current time / win32: got UTC instead of local time

2005-12-06 Thread Felix Kater
Hi, I use g_get_current_time() / win32 to set GTimeVal and calculate the current hour of the day (0-23) like this: hour_of_the_day= my_gtimeval.tv_sec % (3600*24) / 3600 My windows timezone is set to UTC+1 == GMT+1 == CET, however, this is not respected. What ever I select as the windows timez

get current time / win32: got UTC instead of local time

2005-12-05 Thread Felix Kater
Hi, I use g_get_current_time() to set GTimeVal get the current hour of the day (0-23) like this: hour_of_the_day= my_gtimeval.tv_sec % (3600*24) / 3600 My windows timezone is set to UTC+1 == GMT+1 == CET, however, this is not respected. What ever I select as the windows timezone the above form

Re: widget's signal callback: inside gdk lock?

2005-09-19 Thread Felix Kater
On 9/19/05, Tristan Van Berkom <[EMAIL PROTECTED]> wrote: > Fe Kater wrote: > > Hi, > > > > I wonder if the callback function I connect to a widget's signal (like > > "toggled" signal of a checkbutton) is already inside the gdk lock--or if I > > have to take care of gdk_threads_enter/leave with any

Re: simple question: are const gchar* arguments hold as copies internally?

2005-09-07 Thread Felix Kater
Tristan Van Berkom <[EMAIL PROTECTED]> wrote: > Generally, > if a function takes `const gchar *' as an argument it just means > that the said function garauntees that your string will not be modified > by that function (whereas a `gchar *' argument is generally a return > location for a singl

simple question: are const gchar* arguments hold as copies internally?

2005-09-04 Thread Felix Kater
Hi, these two functions take const gchar pointers: void gtk_label_set_text([...] const gchar *str); void g_key_file_set_value([...] const gchar *group_name, [...]) Does that mean that the arguments are *not* hold as copies internally so that I have to care for the allocated memory -- or can I sa

Re: gdk threads enter/leave not enough?

2005-08-15 Thread Felix Kater
First, thanks again for your answer! Tristan Van Berkom <[EMAIL PROTECTED]> wrote: > >>>I never call gtk+ directly but have my own wrappers which take care of > >>>gdk_threads_enter/leave. So I am sure I haven't forgotton it somewhere. > >> > >>This could be dangerous, you'll deadlock if you ca

Re: gdk threads enter/leave not enough?

2005-08-13 Thread Felix Kater
Tristan Van Berkom <[EMAIL PROTECTED]> wrote: > > I never call gtk+ directly but have my own wrappers which take care of > > gdk_threads_enter/leave. So I am sure I haven't forgotton it somewhere. > > This could be dangerous, you'll deadlock if you call threads_enter from > a signal handler that

gdk_threads_enter/leave not enough?

2005-08-10 Thread Felix Kater
Hi, my applications crash if I wrap gtk/gdk function calls from threads into gdk_threads_enter/leave only. Additionally, I have to use "refresh flags" which are set by the threads and checked inside an idle function--which then calls the gtk/gdk functions (and resets the flags). Is that a known

widget destroy hangs

2005-08-04 Thread Felix Kater
Hi, I wrote a tool to edit config files: A widget table with rows of one label (the variable name) + one entry widget (the value) each. I've made a load_table() function which destroys and re-loads the widget table according to the rows of the config file: It does gtk_widget_destroy() and then ..

Re: nested gdk_threads_enter() hangs: linux/gcc vs. win32/mingw?

2005-05-14 Thread Felix Kater
Hi, first let me thank you! Juergen Dankoweit <[EMAIL PROTECTED]> wrote: > Funny. On FreeBSD I have no problems with nested calls of > gdk_threads_enter()/gdk_threads_leave(). [...] > This mutex-semaphore is gdk-wide. [...] > As you can see, you MUST not call them nested! If you don't hav

nested gdk_threads_enter() hangs: linux/gcc vs. win32/mingw?

2005-05-14 Thread Felix Kater
Hi, I am using the same code on win32/mingw and linux/gcc, however, when I execute the code on linux, the programm hangs at the second (nested) call of gdk_threads_enter(), see below. Am I doing something illegal to use nested calls of gdk_threads_enter()? If not, is there a flag to allow/disal

idle function + g_usleep = recursion?

2005-05-02 Thread Felix Kater
Hi, I wonder what g_usleep does if it is called from inside an idle function. Could that lead to recursion since the idle functions is called when the cpu has idle time? Felix ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail

change height of combo widget?

2005-03-30 Thread Felix Kater
Hi, how do I change the height of a combo widget? Felix ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: behaviour of combobox since 2.6...

2005-03-15 Thread Felix Kater
Antonio Gomes: > it's a bit hacker , but works fine on Linux ... but I've never tryied > something like that on Win32 thanks, I'd like to do that very much, however, I once spent too much time to compile that on a windows machine and create a suitable DLL... But one day I'll try that out. Hope t

behaviour of combobox since 2.6...

2005-03-15 Thread Felix Kater
Hi, I switched from gtk+2.4 to gtk+-2.6.4 (using fabulous win32 version by tor). There are at least 2 new things concerning combobox which make life a bit harder: * Having many entries and, a combox near to the screen's edge, the combobox first shows a half empty box, then is slowly scrollin

Re: button receives focus but can't be pressed in

2005-03-09 Thread Felix Kater
Felix Kater: > To sum up: > > If the mouse pointer on a button which was insensitive and gets > sensitive (by another thread), then the button is never highlighted > and doesn't receive the click signal when clicked. Me again. I found out that this issue is known as bug

Re: button receives focus but can't be pressed in

2005-03-07 Thread Felix Kater
Hubert Soko__owski: > do you synchronize these threads somehow? if it is possible to set > sensitive on this button by the main thread then try to do this. I don't get your point. I do it this way: With the button click event all concerned buttons are set insensitive, at the same time a timer is

Re: button receives focus but can't be pressed in

2005-03-07 Thread Felix Kater
Me again. Same problem with gtk-2.6.4/glib-2.6.3/win32. To sum up: If the mouse pointer on a button which was insensitive and gets sensitive (by another thread), then the button is never highlighted and doesn't receive the click signal when clicked. Nobody with a comment on this? Can't I some

button receives focus but can't be pressed in

2005-03-06 Thread Felix Kater
Hi, I am using gtk-2.4.13/win32: Imagine two buttons. When the first is clicked both are made insensitive until things are done, then both are made sensitive again. (To be precise: They are made sensitive again by an idle function and with a certain delay/timer. All this is because I need to eat

gdk_window_process_updates() blocks?

2005-03-06 Thread Felix Kater
Hi, gdk_window_process_update() freezes my application (gtk-2.4.13/win32) in case that it is performed on a gdk-window of a button which is created in a gtk-main-window which was never shown. In case that I show the window (and hide it) before gdk_window_process_update() there is no problem. Is

can I pass user data to a button callback?

2005-02-14 Thread Felix Kater
Hi, can I pass (a pointer to) user data to a button's callback? The compiler wants me to create button callbacks like void (*)(void) -- but what I need is void (*)(void*), at least for the "pressed" and "released" signals How could I do that? Felix ___

Re: intercept nervous button clicks...

2005-02-11 Thread Felix Kater
Freddie Unpenstein: > How about clearing the button blocked flag from an idler, started once > the action is complete? [...] > All I'd need to deal with your situation, would be to slip in > an idle timeout to call the restore function instead of calling the > restore function directly. That's

Re: intercept nervous button clicks...

2005-02-11 Thread Felix Kater
Iago Rubio: > Set the window insensitive - or the buttons - and use a wait cursor to > tell the user the program is working and should not be disturbed :) Thanks, this is, however, no solution. The problem is harder than it seems in the beginning: Whatever you do/block/change inside the button's

intercept nervous button clicks...

2005-02-09 Thread Felix Kater
Hi, in my app some actions behind buttons take time, so the button is released not before the action is done. This is ok. However, I need to prevent the user from clicking other buttons in the meantime. The problem seems to be harder than it looks since gtk can not empty the mouse click buffer (

Re: gtk + threads

2005-01-31 Thread Felix Kater
John K Luebs: > There is a single lock for GDK and GTK. It's documented in the > GDK manual on the chapter about threading. Thanks for that. Of course, I read this before once but beeing pointed to that article again having my problem in mind -- it's the first time I beleve to have understood it

Re: gtk + threads

2005-01-31 Thread Felix Kater
Hi Muthu, > X window system calls must be made from only > one thread. Making X calls from two threads > will cause a crash. > > I think you must set the gtk_* calls from the > idle_function alone. Thatis , it must be a > part of the main loop that works the GUI. May I ask you again what's the e

more general: strategy against errors with gtk + threads

2005-01-30 Thread Felix Kater
Hi, in my last program I use threads more extensivly than before. From time to time it crashes with gtk errors. Now I wonder if my strategy of avoiding gtk errors in a multi threaded environment is suitable: Up to now I tried to narrow all changes to gtk widgets (renaming labels, draw into drawab

Re: how to make a function thread safe?

2005-01-28 Thread Felix Kater
Forget about this. It's not easy to answer in general, I see. I found a way for my purposes. Thank You Felix ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: GtkTextBuffer: how to insert new line?

2005-01-27 Thread Felix Kater
Paolo Costabel: > You cannot use -1 for the length, at least according to the > documentation. [...] > Plus, why are you adding a NULL terminator? Thanks, that's it. I took the -1/NULL terminator thing from the function above in the doc where that is possible (gtk_text_buffer_insert). Felix __

Re: GtkTextBuffer: how to insert new line?

2005-01-27 Thread Felix Kater
Paolo Costabel: > I just tried this: > > gtk_text_buffer_insert_at_cursor(buffer, "\n\n\n\n", 4); > > and works fine here (gtk 2.4.10). > > What call are you using? Hm. a) First I used gtk_text_buffer_insert_at_cursor(buffer, "\n\0", -1); This didn't work (maybe the 0 termination is not

how to make a function thread safe?

2005-01-27 Thread Felix Kater
Hi, is a function thread save when all inside code is wrapped into a static mutex? What is with this function: Could a second thread influence the first thread while it is looping (because of the pointer argument)? void f(gint* my_gint){ static GStaticMutex my_mutex = G_STATIC_MUTEX_INIT;

GtkTextBuffer: how to insert new line?

2005-01-27 Thread Felix Kater
Hi, how do I insert a new line after I inserted text into a GtkTextBuffer? I am using gtk 2.4 (with win32/mingw) and got gtk errors when I tried to insert "\n" into the text (this fist approach is probably completely wrong, I suppose ...). I read that there are bugs in gtk -- could not find anyt