Re: Deleting random number of buttons...

2006-06-06 Thread Tristan Van Berkom
3saul wrote: I'm creating some buttons like this GtkWidget ** add_buttons( GtkWidget *parent, int n ) { GtkWidget **buttons = g_new( GtkWidget *, n ); for( i = 0; i n ; i++ ) { char label[256]; snprintf( label, 256, button %d, i ); buttons[i] = gtk_button_new_with_label( label

Re: Deleting random number of buttons...

2006-06-06 Thread Tristan Van Berkom
3saul wrote: Sorry I made a mistake...I'm actually attaching them to a table, no containers involved. I've tried destroying and recreating the table they're attached too but it doesn't seem to destroy the buttons! Well they should be destroyed (a table is a container by the way)... how are

Re: Memory allocation using g_malloc

2006-05-31 Thread Tristan Van Berkom
3saul wrote: Thanks for the response. Let me elaborate a little. I have a list of files in a dir (without knowing how many) a.txt b.txt c.txt I want to be able to put the names of the files into an array so that I can refer to them later like this array[0][0] = a.txt array[0][1] = b.txt If

Re: GObject and floating reference count

2006-05-31 Thread Tristan Van Berkom
Hannes Mayr wrote: Hello, I'm a little bit confused about the explanation of the floating reference count. The documentation says about GObject: The initial reference a GObject is created with is flagged as a floating reference. This means that it is not specifically claimed to be owned by

Re: is there any documentation for the signals?

2006-05-30 Thread Tristan Van Berkom
Yiannis wrote: Hi, is there any detailed documentaion for the signals? For example what is the difference between button clicked and button activated and when are they emitted? That was a simple example as I would like to know or have a reference of all of them... Cheers. Hand written

Re: Memory allocation using g_malloc

2006-05-30 Thread Tristan Van Berkom
3saul wrote: I need a little help with memory allocation. What I'm wanting to do is create a multi dimensional array that contains a list of file names from a specific directory. So it needs to be something like this int numfiles = 20; g_malloc (myArray [numfiles] [512]); Is this close to

Re: Simple Help Window

2006-05-18 Thread Tristan Van Berkom
Peter Robinson wrote: Hi folks, please forgive what is possible a stupid question, but I would appreciate any hints/tips about the best way to set up a simple help system with 4-5 relatively simple pages and howtos for an application I am working on (my first GTK prog...). Is there a way to

Re: GIOFunc called after a g_io_channel_shutdown

2006-05-16 Thread Tristan Van Berkom
Renaud Malaval wrote: Hello, I use g_io_channel_unix_new() in a custom dialog to check somes io events. I close my gioChannel in the foo_dialog_response_cb(), just before destroy the custom dialog. To close the gioChannel I Does : status = g_io_channel_shutdown(privP-gioChannelP, FALSE,

Re: Deactivate tabs in GtkNotebook

2006-05-12 Thread Tristan Van Berkom
Ken Siersma wrote: Hi list, I'd like to create a notebook that has 5 different pages in it, but the data to be displayed in the later pages depend on the first page. I want the tabs for all pages to be shown in the notebook, to indicate to the user that they need to step through the last 4

Re: gobject interface

2006-05-09 Thread Tristan Van Berkom
Morten O. Hansen wrote: Hi, I have created an interface with base_init and base_finalize, and I have derived on class from it. When i create the object, the base_init is run, but the base_finalize is never run.. is there something besides g_object_unref(object) i should run? do i have to unref

Re: gobject, dynamic loading of classes

2006-05-08 Thread Tristan Van Berkom
Morten O. Hansen wrote: Hi there, I have created some small classes with gobject (as a test), and now i want to do something abit more advanced. What I want is to create an interface (Say IFruit), and then load the subclasses as .so-files (apple.so, banana.so and so on) Does anyone have any

Re: GTK+- widget packing question

2006-04-26 Thread Tristan Van Berkom
BobS0327 wrote: I'm using gtk_vbox_new and gtk_hbox_new to pack widgets on a window. My problem is that the packing is too uniform. Every widget is assigned the same uniform box size. In other words, my first horizontal wdget would be a text box, the next widget would be a listview and the

Re: Gthreads again

2006-04-24 Thread Tristan Van Berkom
Fernando Apesteguía wrote: The main thread is the only one that is running inside the gtk_main loop. The secondary thread is only reading files. So if I do a gtk_main_quit() the secondary thread will be no longer running because I have not a gtk_main loop, right? Wrong, the main thread is not

Re: Gthreads again

2006-04-24 Thread Tristan Van Berkom
Fernando Apesteguía wrote: And how to kill the gthread if there is not something like pthread_cancel? (Thanks for your patience) Tell the thread it has to exit o through a variable mutex/condition o through any form of ipc (maybe simply a pipe()) call g_thread_join() from the main

Re: GThread + GTK+ on windows - problem

2006-04-17 Thread Tristan Van Berkom
Tomasz Jaknowski wrote: hello! I'm trying to compile this code under Windows using DevC++ and GTK+ stuff from http://gladewin32.sourceforge.net/ : My DevC++ is well configured because I can compile and run single thread GTK+ application or compile and run console program using GThread

Re: get position/coordinates of a widget

2006-04-17 Thread Tristan Van Berkom
chabayo wrote: Hello, i have a tree/listview and as i press a special button i emit the signal popup-menu. Done that i get the cell coordinates in the Treeview... gtk_tree_view_get_cell_area ( GTK_TREE_VIEW ( show_tables_treeview ) , gtk_tree_model_get_path ( GTK_TREE_MODEL (

Re: newbie trap

2006-04-12 Thread Tristan Van Berkom
Ross Clement wrote: Hi. I find myself writing a program that processes the gtk gui events itself. E.g. code vaguely similar to the pseudo-code: while( large_compute_bound_job_not_finished ) { process_next_block_of_data(); gtk_progress_bar_set_fraction( progressBar, fraction ); while (

Re: newbie trap

2006-04-12 Thread Tristan Van Berkom
Ross Clement wrote: Thanks Tristian and Jan for the answers. I'm not calling while ( gtk_events_pending ()) gtk_main_iteration (); from event handlers, they are being called from the main thread. I have several threads running in my program. Two are the threads created by

Re: Setting the Visual of a GtkWidget

2006-04-11 Thread Tristan Van Berkom
Taras Zakharko wrote: Hello everyone I am new to GTK+ and to mailing lists so I hope I didn't screw something up :-) I need a possibility of setting the visual for my widgets (for OpenGL rendering). Have you looked at GtkGLExt ? sounds to me like thats the wheel your trying to invent

Re: Differences between kinds of events

2006-04-11 Thread Tristan Van Berkom
Gnaural wrote: I ultimately just used g_signal_connect with the main window to catch keypresses. But it wasn't clear to me why I couldn't get g_signal_connect to handle keyboard events for a drawing area. Any explanation would be appreciated. You should use gtk_widget_add_events() instead (in

Re: Choosing a parent class

2006-04-11 Thread Tristan Van Berkom
Andreas Kotowicz wrote: [...] ok, I think I understand now. but somehow it seems that my class has some mistake in it (see attachment). I'm calling it like this in my code: . . window-priv-object = app_calendar_new (); gtk_box_pack_end (GTK_BOX (main_box),

Re: gdk_threads_leave in gtk callback ?

2006-04-03 Thread Tristan Van Berkom
Gus Koppel wrote: [...] BTW, can I use g_idle_add in non-main thread without locking ? I am not sure. The documentation is not clear about this and I havn't had the time to examine the sources of that yet. To be safe, you should wrap a simple GStaticMutex lock around the call. g_idle_add()

Re: 3000 toggle buttons in a table?

2006-04-03 Thread Tristan Van Berkom
Gus Koppel wrote: Sailaxmi korada wrote: My application has to display around 3000 toggle buttons, in 178 rows of a table. It is taking almost 12 seconds to do so. Can you help me out in reducing this time. Here are the two steps that are consuming maximum time gtk_button_set_label

Re: building OpenGL under GTK+ using gtkgl

2006-03-29 Thread Tristan Van Berkom
Dov B. Kruger wrote: I have a framework that is working well under GTK+, but there are a number of problems. Most critical, I need to know how to continuously busy-wait and force redrawing. I am currently using gtk_main() which sleeps and refreshes only when the screen is resized. Instead I

Re: building OpenGL under GTK+ using gtkgl

2006-03-29 Thread Tristan Van Berkom
Dov Kruger wrote: Tristan, Thanks for your response. I'm sorry, but I need a bit more concrete help with the blizzard of possible API calls. The original code was simply: gtk_main(); If I want to invalidate a rectangle, I saw a call, and thought I could do something like: while

Re: GThread and GCond

2006-03-22 Thread Tristan Van Berkom
Fernando Apesteguía wrote: Hi, I hope you can help me ;) I'm working with two threads. One of them is running in an infinite loop (well, it finishes under certain conditions) What I want to do is that the infinite loop pauses some times. So I create a GCond, but I think I didn't understand how

Re: GUI construction tips

2006-03-21 Thread Tristan Van Berkom
Daniel Pekelharing wrote: On Tue, 2006-03-21 at 14:10 +0100, Fernando Apesteguía wrote: One more thing: what about if my problem now is with vertical alignment? i.e. my labels are so close to the top border of the window. The padding sets a space all around the widget, so it should solve

Re: Handling Unix signals in a GTK+ application

2006-03-17 Thread Tristan Van Berkom
Freddie Unpenstein wrote: You are absolutely right; mutexes /are/ useless from signal handlers. It seems the only reasonable way is to use a pipe(). How about GAsyncQueue's? They're supposed to be thread safe without the need of locking... How about within a single

Re: Handling Unix signals in a GTK+ application

2006-03-16 Thread Tristan Van Berkom
Freddie Unpenstein wrote: That's well over 1548533 executions (I forgot to print the counter after the 10th second) of the idle callback, or 172059 calls to the idler function per second. Personally, I'd call that a busy wait. Its not a busy wait; your idle handler has never returned

Re: Handling Unix signals in a GTK+ application

2006-03-16 Thread Tristan Van Berkom
David Necas (Yeti) wrote: On Thu, Mar 16, 2006 at 03:40:08PM -0500, Tristan Van Berkom wrote: Yes sure, but why would you want to use a flag... when you can just call g_idle_add *from the signal hanlder* Is g_idle_add() really reentrant? It does not look so at the first sight

Re: Handling Unix signals in a GTK+ application

2006-03-16 Thread Tristan Van Berkom
David Necas (Yeti) wrote: On Thu, Mar 16, 2006 at 03:55:50PM -0500, Tristan Van Berkom wrote: Well, it locks a mutex before accessing the GMainContext; so if gtk+ is compiled with threads... it should work... unless I'm on crack and mutexes are useless from signal handlers... but I dont

Re: what's the best way to handle variables and objects?

2006-03-15 Thread Tristan Van Berkom
Andreas Kotowicz wrote: [...] but what should I do if I want to modify any other variables in this function as well? let's say that in the part where I created the g_signal_connect there are also some variables A and B which might be of interest in clear_timer_cb. should I create a struct

Re: what's the best way to handle variables and objects?

2006-03-15 Thread Tristan Van Berkom
Andreas Kotowicz wrote: Hi Tristan, [...] do you know maybe a relatively simple gnome app which uses this concept, so I could have a look at the source code and see how all the interaction works? Well, how about I just type away from memory... after writing that I notice that its

Re: Possible to use a gtk_timeout without a gtk_main loop

2006-03-13 Thread Tristan Van Berkom
Noonan, Michael (DCOI) wrote: Hi Folks, I was wondering would it be possible to have a gtk_timer running outside of the gtk_main loop. I have a separate process that needs to interact with a Gtk application every n seconds and I was wondering if I could set a gtk_timer using gtk_timeout_add()

Re: problems when using g_main_loop_quit from different thread

2006-03-09 Thread Tristan Van Berkom
Armin Bauer wrote: Hi everyone, i am experiencing random problems here if i use g_main_loop_quit from a different thread than where the GMainLoop runs. my program looks like this: 1. in main: create a new context and a new loop 2. spawn a thread 3. call g_main_loop_run in the thread on the

Re: problems when using g_main_loop_quit from different thread

2006-03-09 Thread Tristan Van Berkom
Tristan Van Berkom wrote: My guess is that it just doent make sence to remove the mainloop while the other thread is sleeping in poll(), sure the code will lock its mutex and everything; but when the other thread wakes up; how could it deal with a gone mainloop ? Scratch that; doesnt make any

Re: problems when using g_main_loop_quit from different thread

2006-03-09 Thread Tristan Van Berkom
Armin Bauer wrote: Is this a known problem or am i doing something wrong? Heh, I think I figured it out; I think that after calling g_main_loop_quit(); if the thread is sleeping, you'll have to call g_main_context_wakeup() on it for _run() to return; I wonder if that is a bug or should be

Re: box around a GtkLabel

2006-03-06 Thread Tristan Van Berkom
Wallace Owen wrote: On Fri, 2006-03-03 at 17:27 -0500, Zvi Sebrow wrote: Wally, I thought about using a frame, but i couldnt find a way change the width of the lines (of the framei), or the color of the lines. Is there a way to do that? If you want your stuff to deviate from the default

Re: Can a treeview do this?

2006-03-01 Thread Tristan Van Berkom
Gus Koppel wrote: kadil wrote: [...] (1) the first child to be in the column next to the parent. (2) subsequent children to be below the first child (3) parent cells are to vertically span the child rows (4) I need visible borders between the cells (5) Just to be difficult, I want to code in

Re: strstr for g_strrstr?

2006-02-22 Thread Tristan Van Berkom
Juan Pablo wrote: should i use g_strrstr to do strstr search? definitely not, g_strrstr will find the laste occurence, strstr will find the first ! should i take into account something about the utf8 stuff?? Well that depends; are you displaying the charachters in this string ? are they

Re: tooltips

2006-02-19 Thread Tristan Van Berkom
Paul Pogonyshev wrote: Tristan Van Berkom wrote: Paul Pogonyshev wrote: [...] But I have many areas, the widget is much like two-dimensional grid. There can easily be like 100 areas. Think of GtkTreeView with many columns. Besides, it seems that GtkTooltips works only with widgets

Re: Problem with GValue

2006-02-17 Thread Tristan Van Berkom
Maciej Piechotka wrote: On 2/17/06, Fernando Apesteguía [EMAIL PROTECTED] wrote: Sorry if this is so trivial... Did you try to g_free it? Best regards! Sorry. I didn't understand g_value_init function. Sorry. Wait... hold your horses ! ;-) If a GValue has been

Re: When do i have to use g_signal_stop_emission_by_name () ?

2006-02-17 Thread Tristan Van Berkom
Juan Pablo wrote: Just that. In short: Hope you never do :) I actually thought the description here makes sence: http://developer.gnome.org/doc/API/2.0/gobject/gobject-Signals.html#g-signal-stop-emission Umm, lets see... not to delve too far: o Many handlers may be connected to the

Re: Activate a row in GtkTreeView manually?

2006-02-15 Thread Tristan Van Berkom
Noonan, Michael (DCOI) wrote: Hey everyone, I was wondering if I could trouble you all for some help with a GtkTreeView. Is there a function to activate a row in a GtkTreeView manually. I have an application that updates on changed signals from user input. However I need to change the

Re: Threads and waits

2006-02-15 Thread Tristan Van Berkom
Fernando Apesteguía wrote: Hi, I have an app. that runs two threads, the main one and other thread that collects information from files. I launch the thread by calling pthread_create and here comes my first question ¿Should I use g_thread_create instead? Now I have no problems with these

Re: How to identify the idle state of the GTK+ application?

2006-02-15 Thread Tristan Van Berkom
Gus Koppel wrote: sadhees kumar wrote: In my GTK application, If no action(event) is taken place in the screen, I need to turn OFF the backlight of an TFT monitor. If any key pressed, or mouse movement occured, I need to turn ON the backlight. I have the API for toggling the

Re: Message dialog wont close

2006-02-15 Thread Tristan Van Berkom
Mathew Bielejeski wrote: [...] This code is run in its own thread and these are the only gtk calls that are made in the entire program. Do I need to have a gtk_main() in order for it to work? Yes; you need to run gtk_main(). Cheers, -Tristan

Re: Threads/IPC/???

2006-02-13 Thread Tristan Van Berkom
Ed Kutrzyba wrote: I am developing an application that controls a Data Collection System. I used glade and anjuta for my GUI and C backend control coding. My program works great, but I need to add some extra backround tasks: 1) I need to run a script (perl or bash) on demand without

Re: Urgent help required

2006-02-01 Thread Tristan Van Berkom
Lalit Kumar wrote: Dear all, when compiling my application which contain following code snippets shows an error error: request for member 'widget' in something not a structure or union . gnome_app_create_menus (GNOME_APP (spell_chk_win), menubar1_uiinfo); gtk_widget_ref

Re: GTK and threaded applications

2006-01-31 Thread Tristan Van Berkom
kornelix wrote: Following the guidelines in the FAQ, I constructed my application threads as follows: gdk_threads_enter();// enter thread (do some work, including GTK calls) gdk_flush();// exit thread gdk_threads_leave(); return 0;

Re: images inside labels

2006-01-30 Thread Tristan Van Berkom
devel wrote: I have a gtknotebook that I would like to put small images inside the tab labels. I've looked around, but haven't seen how to do that. I am willing to bet that it can't be done, but I'll just ask as a last resort. Thanks. Hmmm how much you wanna bet ? heh, so do you want images

Re: images inside labels

2006-01-30 Thread Tristan Van Berkom
Stefan Kost wrote: hi, you need to put in an event box first. the tab has no window. eventbox(hbox(icon,label)) Hmmm, are you certain of this ? I think GtkLabel is also GTK_NO_WINDOW, and is usually the type of widget for tab-label's in the notebook... I would expect this requirement to be

Re: Tell me about difference between g_signal_connect and g_signal_connect_after

2006-01-12 Thread Tristan Van Berkom
Cool Guy wrote: In reference, g_signal_connect : The handler will be called before the default handler of the signal. g_signal_connect_after : The handler will be called after the default handler of the signal. But, I don't know why is different g_signal_connect and g_signal_connect_after.

Re: array of entry?

2006-01-09 Thread Tristan Van Berkom
Juan Pablo wrote: [...] Thank you all for your help...and pacience!!! :D I think you want GtkTable. Cheers, -Tristan ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org

Re: Tiled Image with GdkFill?

2006-01-04 Thread Tristan Van Berkom
Ronald Vincent Tarrant wrote: Hi all, Does anyone know how to tile an image as a background in a widget? I'm thinking it has something to do with GdkFill types (such as GDK_TILED) but I don't see any example code. In fact, I'm not at all clear on how to use a GdkFill type at all. Any

Re: is it possible to have a widget act as insensitive but look as it is sensitive?

2005-12-30 Thread Tristan Van Berkom
Yiannis wrote: Sorry for posting back but my code failed :) [...] Try doing: static GdkColor *insensitive_colour = NULL; static GdkColor *normal_colour = NULL; /* ... When initializing ... */ label = gtk_label_new (); insensitive_colour = gdk_color_copy ((GTK_WIDGET

Re: is it possible to have a widget act as insensitive but look as it is sensitive?

2005-12-27 Thread Tristan Van Berkom
Yiannis wrote: Hi, is it possible to have a widget (a toggle button in particular) act as insensitive but look as it is sensitive. More specific is it possible to have a toggle button act as insensitive once activated but look sensitive, ie without the grey shade? Whatever you're doing,

Re: Button can't be clicked.

2005-12-21 Thread Tristan Van Berkom
[EMAIL PROTECTED] wrote: [...] Under the above condition, I operate a pointing device(mouse cursor) as follows. 1. Focused on the button. 2. Clicked the button. - then the sensitive of the button turns FALSE. 3. Focused out from the button. 4. Again, focused back in to the button. -

Re: If this starts another flamewar please ignore: Why do you think Linus Torvalds made the statement against Gnome?

2005-12-20 Thread Tristan Van Berkom
Yiannis wrote: For those not knowing the story... Linus Torvalds made the following statement and is posted on 13/12/05 This 'users are idiots, and are confused by functionality' mentality of Gnome is a disease. If you think your users are idiots, only idiots will use it. I don't use Gnome,

Re: Events and derived objects

2005-12-16 Thread Tristan Van Berkom
Eduardo M KALINOWSKI wrote: [...] However, I find that solution not nice. The derived object structure should be considered opaque, for example. I would like to connect the signal to the derived object iself, not to widgets inside it: g_signal_connect(G_OBJECT(derived_object), ...) and have

Re: Events and derived objects

2005-12-15 Thread Tristan Van Berkom
Eduardo M KALINOWSKI wrote: [...] What is happening is that the user signal handler is being run only after the default handler, even if g_signal_connect (not after) is used, but it should happen before. Hi, what you're saying stikes me as odd; this is the declaration of key-press-event

Re: Events and derived objects

2005-12-14 Thread Tristan Van Berkom
Eduardo M Kalinowski wrote: [...] I've achieved capturing some specials keys, but letting everything else work as normally in the TextView by connecting a handler to a key-press-event of the TextView inside the derived widget's implementation, but I have'nt discovered how to propagate keys

Re: signals and threads

2005-12-07 Thread Tristan Van Berkom
Dmitry A. Yanko wrote: On Mon, Dec 05, 2005 at 01:50:40PM -0500, Tristan Van Berkom wrote: [...] My app architecture: Main: g_thread_init(); gdk_threads_init(); Thread_A: gtk_init(); gtk_main(); Thread_B: g_idle_add(); - create window

Re: signals and threads

2005-12-07 Thread Tristan Van Berkom
Dmitry A. Yanko wrote: [...] Its better to use the gthread api only; while using pthreads directly might work, it wont be portable it wont be garaunteed to work properly either. Ok. What about a sockets and file io? Glib has such support, but it's more convenient for me to make direct calls

Re: signals and threads

2005-12-05 Thread Tristan Van Berkom
Dmitry A. Yanko wrote: Hi! I develop the app, that needs to run 2 same windows, each in separate thread. I have a same signal handlers in each thread. The difference is only in thread specific data, because i need to make a different things in different threads. Example: ...

Re: signals and threads

2005-12-05 Thread Tristan Van Berkom
Dmitry A. Yanko wrote: On Mon, Dec 05, 2005 at 11:55:57AM -0500, Daniel Atallah wrote: You can use g_idle_add() to trigger your UI updates from your data processing threads. Ok. Thanks a lot. I will try. Will it also resolve my hignal handlers problem? Every signal callback registered to a

Re: swap images on click event.

2005-11-28 Thread Tristan Van Berkom
Craig Harding wrote: Hi, I'm trying to change an image with another when I click on my applet button, but it doesn't work, can anyone help me out? CODE: play_button = gtk_image_new_from_file (/usr/local/pixmaps/play.png); pause_button = gtk_image_new_from_file(/usr/local/pixmaps/pause.png);

Re: Problem sending data to gtk_button on clicked event

2005-11-09 Thread Tristan Van Berkom
Evan Behar wrote: I've been getting seg-faults when I try to work with data in my button clicked callback functions, so as a test, I compiled and ran the following program: Be carefull how you prototype your callbacks, for example; the GtkButtonClass's closure for the clicked signal will

Re: data acqusition, display and control

2005-10-25 Thread Tristan Van Berkom
Premsagar C wrote: [...] Tristian, A timeouthandler did the job howvever I still have a few bugs. My data acuqisition is working and getstting displayed on my text widget as I have included my timeout in the main . On clicking a button i require to stop the data acqusition and do a few other

Re: data acqusition, display and control

2005-10-25 Thread Tristan Van Berkom
Premsagar C wrote: [...] Tristan, Heres the basic gist of my prgram My data acquistion is done in a dialog box called teleop defined by the function teleop void teleop { // define my 6 text boxes to dispaly values from my 6 ckts plus my snap shot button and another textbox obj and a menu button

Re: Programming style

2005-10-24 Thread Tristan Van Berkom
Gus Koppel wrote: Tristan Van Berkom wrote: Every widget callback comes with a user_data argument, and you can pass the desired data through that argument (which is just as fast as using a global variable and is just as clean as using a lookup_widget type of routine). Right. However

Re: multiple calls to g_io_channel_read_line and g_free question

2005-10-18 Thread Tristan Van Berkom
Colossus wrote: Hi, I have a doubt. I call g_io_channel_read_line several times this way: g_io_channel_read_line ( ioc, line, NULL, NULL, NULL ); //do some things on line //shall I g_free (line) here ? g_io_channel_read_line ( ioc, line, NULL, NULL, NULL ); //ecc My doubt is: shall I free

Re: Multithreading and GTK widgets

2005-10-17 Thread Tristan Van Berkom
Alan M. Evans wrote: [...] I would have the GUI thread update the list/tree models, but the GUI thread spends most of its time sitting in gtk_main. Ofcourse it does, Anything that a GTK+ gui does is inside gtk_main(), you can get the gui thread to do the updating by passing the appropriate

Re: Text Label on top of button Image

2005-10-11 Thread Tristan Van Berkom
Bill Sousan wrote: [...] I tried using both the button's label and image. However, it always appeared to want to push the image to one side of the button, and push the label to the other side of the button. I was not able to find a way to overlay the label on top of the button image.

gtk_window_set_position [ was (no subject) ]

2005-10-06 Thread Tristan Van Berkom
Kurucz Istvan wrote: Hy! I would like that, the visiting-card window is present in the middle of modaled main window. I no purpose use the gtk_window_set_position (MainWindow, GTK_WIN_POS_CENTER_ON_PARENT) funciton, the visiting-card window always present an other, outside of the main

Re: Displaying intermediate button images.

2005-09-27 Thread Tristan Van Berkom
Rich Burridge wrote: [...] Can I ask a favour please? Could you adjust the reve_sleep() routine in the attached small program to use a g_timeout_add() to do the pausing? The problem with your program is not with reve_sleep(), the problem is that you have a reve_sleep() function at all, in

Re: Displaying intermediate button images.

2005-09-27 Thread Tristan Van Berkom
Rich Burridge wrote: Hi Tristan, Can I ask a favour please? Could you adjust the reve_sleep() routine in the attached small program to use a g_timeout_add() to do the pausing? You seemed to have ignored the revised small attached program that I sent you and gone back to my first version.

Re: Displaying intermediate button images.

2005-09-26 Thread Tristan Van Berkom
Rich Burridge wrote: [...] What do I need to do to make the intermediate images appear? You should read a little of this: http://developer.gnome.org/doc/API/2.0/glib/glib-The-Main-Event-Loop.html The problem is that you are hijacking the mainloop, in GTK+ programming, you must let GTK+

Re: GtkExpander label widgets (using buttons as)

2005-09-25 Thread Tristan Van Berkom
David Caldwell wrote: I have a GtkExpander and I set its label widget to an hbox to which I added a label and 2 buttons. They all display nicely, but the buttons don't work properly. When I click on them it activates the expander instead of the buttons themselves. Actually, a couple of the

Re: keeping track of time.

2005-09-20 Thread Tristan Van Berkom
John Vetterli wrote: [...] Use g_timeout_add to execute a callback function periodically. http://developer.gnome.org/doc/API/2.0/glib/glib-The-Main-Event-Loop.html The interval may not be terribly accurate, but if I understand your needs, this is not important. The callbacks would only cause

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

2005-09-19 Thread Tristan Van Berkom
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 code inside this callback function? Since signals are run synchronously

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

2005-09-19 Thread Tristan Van Berkom
Felix Kater wrote: [...] a. The lock is already aquired by gtk when the button is toggled by the user's mouse click--so the callback is already (automatically) inside the lock from the client programmer's view. b. The lock has to be aquired explicitly by the client programmer who is using gtk

Re: Focus on Notebook tab

2005-09-09 Thread Tristan Van Berkom
sadhees kumar wrote: Friends, I am using GtkNotebook widget, it has 7 pages.i want to navigate all the pages.In my project i am using GDK_Tab key for navigating to next page. This is done in the GtkNotebook widget's keypress callback function. The problem is i'm not getting the focus in

Re: Focus on Notebook tab

2005-09-09 Thread Tristan Van Berkom
Tristan Van Berkom wrote: sadhees kumar wrote: Friends, I am using GtkNotebook widget, it has 7 pages.i want to navigate all the pages.In my project i am using GDK_Tab key for navigating to next page. This is done in the GtkNotebook widget's keypress callback function. The problem is i'm

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

2005-09-06 Thread Tristan Van Berkom
Felix Kater wrote: 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

Re: TreeView expander questions (again)

2005-09-01 Thread Tristan Van Berkom
Wallace Owen wrote: I'd like all the data I put in a treeview visible all the time (fully expanded). Is there a way to make new child rows in my treeview expended when the model tells the view that the row has been added, or must I call gtk_tree_view_expand_all()? Is there a way to make the

Re: gtk_button_set_markup / animation / background color

2005-08-25 Thread Tristan Van Berkom
ramare wrote: Dear all, I'm working on the look and feel of my gtk application. -- first : many thanks for those who developped this stuff :-) -- second : gtk_label_set_markup is great but how do I do that with button instead ? The only way is to put a label

Re: Resizing an image widget

2005-08-22 Thread Tristan Van Berkom
LaundroMat wrote: Hi all - First time here, thanks for having a look at this. I have a window, consisting of a horizontal box, with 3 vboxes in it. One vbox contains an image, another a set of labels and the third has text entry widgets. How can I resize the image to the unexpanded size of

Re: GdkPixbuf and FIFO's

2005-08-22 Thread Tristan Van Berkom
Alex Levin wrote: Hi everyone. I'm trying to pass a GdkPixbuf object through a FIFO from one thread to another. Does anyone have any code snippets which does something similar to this? Thanks in advance. You should be able to serialize what you need by only piping a GdkPixData struct

Re: Resizing an image widget

2005-08-22 Thread Tristan Van Berkom
LaundroMat wrote: I realise I wasn' t too clear in my mail. The thing is, I have a window with essentially 3 boxes: A B C A = image B = labels C = text entry The height of B (and C for that matter) is smaller than that of A. But I would like to resize A to the height of C. If you set the

Re: XGrabKey

2005-08-17 Thread Tristan Van Berkom
Alex Levin wrote: Hi Mario. I did something very similar in my app. Now that you are using X functions to process those keys, you need to handle them with X instead of GTK. So, keep your GTK key handler for regular keys, but for the keys you've grabbed use something like the following. I'm

Re: gdk threads enter/leave not enough?

2005-08-15 Thread Tristan Van Berkom
Felix Kater wrote: 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

Re: gobject reference question

2005-08-15 Thread Tristan Van Berkom
Wallace Owen wrote: How can I see what the current reference count is, so I can be sure I'm using g_object_ref() and g_object_unref() correctly? You can check G_OBJECT (object)-ref_count, note that it is fundementally wrong to do any conditional code based on this (for the same reason you cant

Re: gdk threads enter/leave not enough?

2005-08-15 Thread Tristan Van Berkom
Felix Kater wrote: [...] b. It is not possible to savely call gtk/gdk functions from different threads using gdk_threads_enter/leave only (see my original post). In this case a thread enters gdk_threads_enter() although is shouldn't. My workaround: Use flags and let gtk functions be called from

Re: gdk threads enter/leave not enough?

2005-08-11 Thread Tristan Van Berkom
Fe Kater wrote: This sounds very strange, are you wrapping all your gtk+ api accessing code in enter/leave in all threads (including the parent) and only from event sources (i.e. not in signal handlers that are fired by gtk widgets) ? I never call gtk+ directly but have my own wrappers

Re: GdkEvent -- XEvent

2005-08-03 Thread Tristan Van Berkom
Brian J. Tarricone wrote: [...] I'm relatively sure the XEvent is indeed lost by the time you see it in your event handler. If you'll look at the various XEvent and GdkEvent structures, however, you'll note that they're fairly similar (I think it's safe to assume GdkEvent was originally based

Re: I don't think I need a custom widget

2005-08-03 Thread Tristan Van Berkom
Greg Breland wrote: [...] This sounds like a workable idea as long as it won't alter the allocation request of the child widget. You mean the size-request (aka GtkRequisition) ? Usually a size-request isn't needed on a widget, but you shoulnt allow a widget to have an allocation that is

Re: Providing gtk_main() with asynchronous data

2005-08-01 Thread Tristan Van Berkom
Pat Mahoney wrote: [...] The GSourceFuncs prepare and check are only passed the GSource and no other data. Thus, the only way they can check any variable is through a global variable. Now, my program would like to dynamically create several (likely never more than 3-5) threads to feed the

Re: gtk_tree_store_set

2005-07-28 Thread Tristan Van Berkom
The Saltydog wrote: [...] Yes, I have just realized that! I am changing to G_TYPE_UINT64. But, do you think that this could generate a segfault on PowerPc and amd64, and NOT on i386? Absolutely, try doing calling : g_object_set (object, long-property, (gchar *value),

Re: Scree Updating - Updating toooo soooow

2005-07-26 Thread Tristan Van Berkom
John Cupitt wrote: On 7/26/05, Przemysław Więckowski [EMAIL PROTECTED] wrote: Could you please tell me. What would be faster: directly putting prepared pixmap using gdk_draw_drawable(..) as rectangle or drawing rectangle using gdk_draw_rectangle(..)?? ( i heve't tested it so i ask...) You

<    1   2   3   4   5   >