Re: reg: callbacks
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, Dec 13, 2006 at 12:43:00PM +0530, Prasad Achar wrote: Hi I have a situation where in have to catch 2 different callbacks on 2 different events from single fuction. Then how can i manage the below function.. whether i have to add one more gpointer func_data1 ? gint gtk_signal_connect( GtkObject *object, gchar *name, GtkSignalFunc func, gpointer func_data ); Quite probably you are not being called from *both* places *at the same time* ;-) So when you are being called from place A you point with func_data to func_data, else you point to func_data1. Now you just have to differentiate both cases whithin your callback. May be a struct member in the struct pointed to by func_data is all is needed. E.g.: | typedef struct func_data { /* generic */ | int whence; /* 0 for A, 1 for B; better use enum! */ | union { | struct { | blah blah | } A; | struct { | bloh bloh | } B; | } stuff; | } fundata; Then on place A: | fundata *f1 = g_new(fundata, 1); | f1-whence = 0; /* called from A */ | f1-stuff.A.foo = 2; | ... | gtk_signal_connect(obj, foobar from A, fun, f1); Likewise on place B HTH - -- tomás -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFFf8c9Bcgs9XrR2kYRAtGdAJ0aTJtY28xsXn/GBswufUMP0+9ABwCeNf1b /0hhs6jwYnJ/jJJeMtK1cD8= =r6JY -END PGP SIGNATURE- ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
simulate and enter pressed event
Hi, I need to simulate Key Enter pressed event from another application. I'm able to simulate a move focus from my application by calling g_signal_emit_by_name(window_main, move_focus, GTK_DIR_TAB_FORWARD); Is there any similar way to get Enter key press event. Please let me how it can be done. Regards, Krithika ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Need to get the widget focused
Hi, How can I find which widget has focus set? I have lot of widgets so cannot explicitly check one by one. Is there any other way to do it? Regards, Krithika ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
RE: Need to get the widget focused
Hi krithika... I am not very clear with your query. Most of the widgets provide activate property, and a corresponding API to Activate them. Either you grab focus or not, on that widget. Its immaterial. You can activate the widget with the API. Other details you may require are: Enter key Press : GDK_Return Event : key_press_event Maybe if you can mention your exact query. It would be easier for e1. I hope this helps. Rgds, Madhusudan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, December 13, 2006 7:04 PM To: gtk-app-devel-list@gnome.org Subject: Need to get the widget focused Hi, How can I find which widget has focus set? I have lot of widgets so cannot explicitly check one by one. Is there any other way to do it? Regards, Krithika ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
FW: Need to get the widget focused
Sorry group, The Reply is for the earlier mail of M/s Krithika This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Madhusudan E Sent: Wednesday, December 13, 2006 7:10 PM To: [EMAIL PROTECTED]; gtk-app-devel-list@gnome.org Subject: RE: Need to get the widget focused Hi krithika... I am not very clear with your query. Most of the widgets provide activate property, and a corresponding API to Activate them. Either you grab focus or not, on that widget. Its immaterial. You can activate the widget with the API. Other details you may require are: Enter key Press : GDK_Return Event : key_press_event Maybe if you can mention your exact query. It would be easier for e1. I hope this helps. Rgds, Madhusudan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, December 13, 2006 7:04 PM To: gtk-app-devel-list@gnome.org Subject: Need to get the widget focused Hi, How can I find which widget has focus set? I have lot of widgets so cannot explicitly check one by one. Is there any other way to do it? Regards, Krithika ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
GTK Themes, and theme libraries : how do they fit (get plugged) into GTK ?
Hello, all, Some time ago I asked a question on a library that hadn't been found upon installing a new GTK library (libqtengine.so, that was). I slowly start realising now that this was a file belonging to what's called a theme library, and that it is actually not an integral part of GTK itself (so typically part of a distribution, I guess) Then I asked myself how this theme mechanism is working in GTK. I found out that there's a whole lot of an object's properties that are customisable in gtkrc files. But the changeable properties in these files can (unless I'm wrong, or wrongly understand the code) at most explain some differences in colors, but not at all any difference in widget drawing method. So how(/where in the code) are these theme libraries coming in the game ? How can e.g. a GtkToggleButton possibly be drawn another way, e.g. with more rounding, or with another kind of shading (as I said, I'm explicitly *not* speaking of a different color scheme) ? How(/where in the code) do these theme libraries get plugged-in into GTK ? Could someone please give some beginning of conceptual explanation, and then give further (clues to) links to good documentation on how this is all working together (a hint in the GTK code can also do) ? Thanks, and kind regards, PhB. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: FW: Need to get the widget focused
On Wed, Dec 13, 2006 at 07:23:11PM +0530, Madhusudan E wrote: Sorry group, The Reply is for the earlier mail of M/s Krithika This e-mail and attachments contain confidential information from HUAWEI, If this information is confidential, why are you posting it to a public mailing list? which is intended only for the person or entity whose address is listed above. So if the email is sent to the an address the sender didn't intend or it's forwarded it's ok. Because simply recieving the email allows the recipient to assume that it was intended for them, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! But if I receive the email then I am *by definition* an intended recipient (see above). What idiots write this shit, and wy are they allowed to practice law? -jkl ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Need to get the widget focused
2006/12/13, [EMAIL PROTECTED] [EMAIL PROTECTED]: How can I find which widget has focus set? I have lot of widgets so cannot explicitly check one by one. Is there any other way to do it? gtk_window_get_focus () will get the focused widget whithin the main window. cheers -- Gian Mario Tagliaretti http://www.parafernalia.org/pygtk/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GTK Themes, and theme libraries : how do they fit (get plugged) into GTK ?
On Wed, Dec 13, 2006 at 04:01:48PM +0100, Philippe Bertin wrote: So how(/where in the code) are these theme libraries coming in the game ? How can e.g. a GtkToggleButton possibly be drawn another way, e.g. with more rounding, or with another kind of shading (as I said, I'm explicitly *not* speaking of a different color scheme) ? How(/where in the code) do these theme libraries get plugged-in into GTK ? All functions gtk_paint_foo() essentially do nothing more than call some method(s) of the GtkStyle object passed to them. That is, GtkStyle is a class and it has methods that actually draw the things. Widgets pass their style as the style argument, which is under normal circumstances the default style shared between all widgets (assigned in gtk_widget_init() and attached to windows when widgets are realized). The default style is set by the RC parser, which also loads the theme engine when it encounters a theme engine declaration in the RC file. gtk_theme_engine_get() simply uses the GTypeModule mechanism to load the module implementing a class (theme engine). To see the code, look at gtkstyle.c, gtkrc.c and gtkthemes.c. Yeti -- Whatever. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: simulate and enter pressed event
2006/12/13, [EMAIL PROTECTED] [EMAIL PROTECTED]: Is there any similar way to get Enter key press event. what about key-press-event... http://developer.gnome.org/doc/API/2.0/gtk/GtkWidget.html#GtkWidget-key-press-event cheers -- Gian Mario Tagliaretti http://www.parafernalia.org/pygtk/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: FW: Need to get the widget focused
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, Dec 13, 2006 at 10:01:13AM -0500, John K Luebs wrote: [...] What idiots write this shit, and wy are they allowed to practice law? ...maybe because they otherwise would write programs :-D (SCNR) - -- tomás -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFFgCyBBcgs9XrR2kYRAoXZAJ9XpZTvmWONpSaqs7j3uvt490xAnQCeKb0R oPb4zkJiIKczOEehwJBwToM= =Razu -END PGP SIGNATURE- ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Crossing thread boundary with idle function
Hullo, Short version: When GTK+ is in its main run loop, blocking on an event, is there a way to awaken/unblock it from some external thread such that it will pay attention to newly-added idle functions? Long version with context: I have a lovely multithreaded application in C++/GTKmm that I'm working on part of (oh, lucky me), but the general problem is GTK+, not the binding, so please just bear with the C++ names. :) GTK+/the UI gets a thread in this system all to itself. For various reasons, pthreads is what's being used, and GTK+ never gets to, or needs to, know that other threads exist, as _all_ GTK+ operations occur within this thread. It is, however, necessary to poke this thread occasionally from another, controlling thread. To do this, I have a notify() method, which performs a g_idle_add() [or, in GTKmm parlance, connects to Glib::signal_idle()] with a notifyInternal() function. notifyInternal() does the work it needs to in the UI thread, then returns false in order to be removed again. According to the docs, calling g_idle_add() from outside of the Glib thread is safe, so this seems like a nice, clean way to cross the thread boundary. The problem with this is that adding an idle function doesn't actually wake a blocked GTK+ main loop---the idle function won't run until some other event, such as mouse movement, does that. It /will/ run if the run(window) call is replaced with a while loop which does non-blocking iteration() calls, but this is clearly horrendously inefficient. Hence, I need to somehow need to prod the events pending condition that the GTK+ loop is waiting on. My thoughts are along the lines of giving it a synthetic event of some nature to process---hopefully at a Glib level, as the documentation has gdk_threads_enter()/leave() as necessary for multi-thread access to GDK and up, but not safe for the Win32 back-end (and, yes, this abomination is also cross-platform). Any ideas on how I can do this? Thanks in advance, Phil ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
GtkEntry Persistent Cursor
Hello All, I'm creating a menu that is essentially an onscreen reproduction of a keyboard. It has all the buttons of a keyboard and at the bottom has a GtkEntry where whatever you type on the either the software keyboard or your actual keyboard is displayed. What I'd like to know is, is it possible, even if another widget(or even another window, as this app has multiple windows) has the focus, for the cursor (the flashing line that displays your position) to remain in the GtkEntry textbox? Even a non-flashing static cursor indicator would suffice. I've seen this in other apps and was hoping it would be a simple option but I can't seem to find it. Mike ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Display date and time using gtkmm2.4
Hi All In my project, I need to display the date time on the window as long as the application is running. Kind of real time display of date,time on the window. I can use time_t from time.h and obtain the date and time. But, how do I make is real time? I am using libgtk2.8 and libgtkmm 2.4. I searched all over the net and couldn't find any solution. All your suggestions are highly appreciated. I am pretty new to GTK programming and I come from Java/C# background. Hope someone there can help me with a seemingly simple problem. Thanks in advance Sirisha ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Crossing thread boundary with idle function
On Wednesday 13 December 2006 18:05, Philip Boulain wrote: Hullo, Short version: When GTK+ is in its main run loop, blocking on an event, is there a way to awaken/unblock it from some external thread such that it will pay attention to newly-added idle functions? [snip] I does that by itself. You have probably not called g_thread_init() (or Glib::thread_init()). Chris ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
gtk_widget_size_request v. reality
I believe this goes against the GTK philosophy, but for the sake of backwards compatibility I'm trying to get the width of a hbox so that I can calculate a hardcoded spacing percentage between two widgets and use the number as pack padding (sorta like an invisible pane that the user can't adjust). How do I force a parent to tell the child how much space will be available to the child at this time? Is it even possible? Do I really have to call gtk_widget_set_size_request()/gtk_widget_size_request() on every parent so that the children have something to work with? I believe there is some kind of 'negotiation' between parents and children. I basically want to know what the parent would give the child if the child asked for more space than is available to the child (the max). I'm new to GTK, but as far as I can tell, most GTK tutorials and documentation don't really cover packing widgets when homogeneous, expand, and fill are not all set to TRUE (if only I could just let GTK do it all for me...). Suggestions? P.S. if this is the wrong email list, feel free to redirect me. ~Thanks ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Crossing thread boundary with idle function
On Wed, 2006-12-13 at 21:20 +, Chris Vine wrote: On Wednesday 13 December 2006 18:05, Philip Boulain wrote: When GTK+ is in its main run loop, blocking on an event, is there a way to awaken/unblock it from some external thread such that it will pay attention to newly-added idle functions? I does that by itself. You have probably not called g_thread_init() (or Glib::thread_init()). Ah, I wondered if it was supposed to. I haven't, no; my understanding of those is that they will enable the Glib-specific threading system. I was kind of concerned about how that would interact with the fact that we're already using pthreads (various comic historic reasons). I have now added it, and that appears to work, at least for the Linux build. (If it breaks for Windows, I get to see how much teeth-gnashing can come from having to port a load of pthreads-based code over to Glib threads can cause. ;) ) (For the sake of catching stupid newbie errors which may later bite me in the posterior: the thread_init() directly precedes the Gtk::Main() construction, within the UI thread; from what I can tell, this is the correct approach.) Thanks again, Phil ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Crossing thread boundary with idle function
On Wednesday 13 December 2006 21:52, Philip Boulain wrote: On Wed, 2006-12-13 at 21:20 +, Chris Vine wrote: [snip] I does that by itself. You have probably not called g_thread_init() (or Glib::thread_init()). Ah, I wondered if it was supposed to. I haven't, no; my understanding of those is that they will enable the Glib-specific threading system. I was kind of concerned about how that would interact with the fact that we're already using pthreads (various comic historic reasons). I have now added it, and that appears to work, at least for the Linux build. (If it breaks for Windows, I get to see how much teeth-gnashing can come from having to port a load of pthreads-based code over to Glib threads can cause. ;) ) You have to call g_thread_init() before any glib functions are called, so do it early on. If you do not do that then the glib main loop (amongst other things) is not thread safe, as you have discovered. glib will use the underlying thread implementation (pthreads for Unix-like systems, and windows threads for windows). The only exception is if you are using a pthreads implementation under windows, but even that will probably work OK since the pthreads implemention will probably be a wrapper for windows threads and even if it isn't both will be using the same architecture-specific locking primitives underneath. If all else fails you can use the gthread implementation, which works on both Unix-like systems and on windows. Chris ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: gtk_widget_size_request v. reality
How do I force a parent to tell the child how much space will be available to the child at this time? Is it even possible? Do I really have to call gtk_widget_set_size_request()/gtk_widget_size_request() on every parent so that the children have something to work with? Use an alignment and set the Left/Right Padding in a callback for size-request of the parent. I'm new to GTK, but as far as I can tell, most GTK tutorials and documentation don't really cover packing widgets when homogeneous, expand, and fill are not all set to TRUE (if only I could just let GTK do it all for me...). Suggestions? Open up glade, create a dummy project and play around with it. I got around a bunch of GTK's crummy documentation by doing this. You can also consider using glade and libglade in your app, instead of just as an exploration tool. -Jim ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
RE: Display date and time using gtkmm2.4
Hi, You may use For ex: g_timeout_add_full(G_PRIORITY_DEFAULT,1000, periodicTask, NULL, (GDestroyNotify)go_to_timeout); Where in , the 'periodicTask' callback will be called every 1 sec (1000 msec), Within this callback you can use, time_t to get the time current time. Update your window and display. I hope this helps. Rgds, Madhusudan. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of SIRISHA MUPPAVARAPU Sent: Thursday, December 14, 2006 2:03 AM To: gtk-app-devel-list@gnome.org Subject: Display date and time using gtkmm2.4 Hi All In my project, I need to display the date time on the window as long as the application is running. Kind of real time display of date,time on the window. I can use time_t from time.h and obtain the date and time. But, how do I make is real time? I am using libgtk2.8 and libgtkmm 2.4. I searched all over the net and couldn't find any solution. All your suggestions are highly appreciated. I am pretty new to GTK programming and I come from Java/C# background. Hope someone there can help me with a seemingly simple problem. Thanks in advance Sirisha ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Publically exposing GtkFileChooserIface
Hi Federico, It has come to our attention that important pieces needed to implement a third-party file chooser dialog outside of GTK+ are not installed. As far as I can see implementing your own file chooser dialog involves implementing the GtkFileChooserIface and then plugging it into GTK+. The main problem is that the definition of this interface is in gtkfilechooserprivate.h, which is obviously not installed. A second problem is that the definition uses types defined in the semi-public gtkfilesystem.h (especially GtkFilePath). The easiest way to solve this is probably to: * Move GtkFileChooserIface into it's own, new, header file. gtkfilechooserprivate.h also contains some data structures internal to the implementation of the default file chooser which don't make sense to install. * Add GTK_FILE_SYSTEM_ENABLE_UNSUPPORTED defines like in gtkfilesystem.h. * Get GTK+ to install it. I would really like to get this into 2.12. Objections? Suggestions? thanks, -kris. ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: gmodule-dl.c: _g_module_symbol()
On Tue, 2006-12-12 at 16:10 +0100, Michael Natterer wrote: On Mon, 2006-12-11 at 18:41 +0100, Felix Kater wrote: Just this annotation: On linux 'man dlopen' says that the correct way to check if dlsym() was successful is to do something like this dlerror(); p=dlsym(...); pc=dlerror(); if(pc) /* (error) */ else /* (ok) */ Anyone know if dlerror is thread safe? J. -- Jan Schmidt [EMAIL PROTECTED] T - If we were anyone but us, the fact that being shot down is often fatal would be a factor there. R - And if beggars were horses, something something ferrets. - Triangle Robert #1860 ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Depth related assertion in gdk_drawable_set_colormap()
Hello, We are getting some depth related assertions at time of running mozilla over gtkDFB port. The assertion is coming for the following functions: -- pixmap = gdk_pixmap_new(NULL,x,y, gdk_rgb_get_visual()); gdk_drawable_set_colormap(pixmap, gdk_rgb_get_colormap()); -- It says the depth of drawable is not equal with the depth of colormap. any suggestions or any example code through which we can solve it?? Thanks, Karunakaran A. ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: Depth related assertion in gdk_drawable_set_colormap()
Hi, On Thu, 2006-12-14 at 11:10 +0530, Karunakaran A wrote: We are getting some depth related assertions at time of running mozilla over gtkDFB port. The assertion is coming for the following functions: -- pixmap = gdk_pixmap_new(NULL,x,y, gdk_rgb_get_visual()); gdk_drawable_set_colormap(pixmap, gdk_rgb_get_colormap()); -- It says the depth of drawable is not equal with the depth of colormap. any suggestions or any example code through which we can solve it?? What about using a debugger, setting a breakpoint or using --g-fatal-warnings, locating the problem, fixing it and submitting a patch (if it turns out that the problem is in gdk-directfb)? Sven ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list