How to generate event explicit (through code) ?
Hello list, I want the focus to move selection/focus from one icon to another automatically on single key press. I have tried to just run key_press event code in a loop, but the selection is not moving from one to another, it is directly coming to the last item. it requires a h/w interruption (key_press) . As I understood, I need to generate the event key_press explicitly in the loop every time. How to generate gtk_event explicitly without any (h/w) key press? regards Leena ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How to generate event explicit (through code) ?
http://developer.gnome.org/gobject/unstable/gobject-Signals.html g_signal_emit is what you are looking for. Regaards BernhardLeena Chourey schrieb am 23.04.12 13:46: Hello list, I want the focus to move selection/focus from one icon to another automatically on single key press. I have tried to just run key_press event code in a loop, but the selection is not moving from one to another, it is directly coming to the last item. it requires a h/w interruption (key_press) . As I understood, I need to generate the event key_press explicitly in the loop every time. How to generate gtk_event explicitly without any (h/w) key press? regards Leena ___ 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
Re: How to generate event explicit (through code) ?
On Mon, Apr 23, 2012 at 05:16:52PM +0530, Leena Chourey wrote: I want the focus to move selection/focus from one icon to another automatically on single key press. I have tried to just run key_press event code in a loop, but the selection is not moving from one to another, it is directly coming to the last item. it requires a h/w interruption (key_press) . As I understood, I need to generate the event key_press explicitly in the loop every time. How to generate gtk_event explicitly without any (h/w) key press? I must admit that I do not actually understand what you are trying to achieve (namely why you try to emulate key events). Anyway: Common keyboard control is usually defined by bindings, see GtkBindingSet for start. Maybe you just need to define bindings for the required keys to make them move the selection. If you want something special that does not correspond to the common movements then register a key-press-event callback for the widget and in that callback run gtk_widget_grab_focus() to move the focus where you want, gtk_icon_view_select_path() to set the icon view selection, etc. Return TRUE from the callback (most likely). You might also want to manipulate the selection/focus by invoking action signals of the wiget, e.g. the move-cursor signal for GtkIconView. Yeti ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
docking GTK3
Hello, I read about some possibilities to add docking capability to gtk using gdl. (http://www.micahcarrick.com/gdl-docking-gtk.html) Is there any build in solution available or planned within GTK3? regards Arne ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Replace context menu of GTK applications
Hey there! I asked this question on another mailing list. There I got the hint to ask here, maybe you can help me! I'm going to write my bachelor thesis on different menu types (e.g. Pie Menus). For this reason I'd like to replace the context menu of GTK applications (the menu opened by right-clicking). I don't want to recompile those applications, some kind of plugin technique would be awesome! I thought of two possible approaches: 1. - I know it's possible to do this with the main application menu (like all the different global menus are doing it). - So here's my question: Is that possible for context menus as well? Is there an API for this purpose? If so, what's the way to go? Documentation on this topic is very sparse... 2. - Write a GTK module and try to do it with some GObject fancyness. May this work? Best regards and thanks for your support, Simon ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Replace context menu of GTK applications
On Mon, Apr 23, 2012 at 08:18:05PM +0200, Simon Schneegans wrote: I asked this question on another mailing list. There I got the hint to ask here, maybe you can help me! I'm going to write my bachelor thesis on different menu types (e.g. Pie Menus). For this reason I'd like to replace the context menu of GTK applications (the menu opened by right-clicking). I don't want to recompile those applications, some kind of plugin technique would be awesome! I thought of two possible approaches: 1. - I know it's possible to do this with the main application menu (like all the different global menus are doing it). - So here's my question: Is that possible for context menus as well? Is there an API for this purpose? If so, what's the way to go? Documentation on this topic is very sparse... 2. - Write a GTK module and try to do it with some GObject fancyness. May this work? GtkMenuFoo classes use a number of internal Gtk+ calls and might not be reasonably replaceable from outside. So I suggest to simply change the implementation of menus in Gtk+ source code, recompile it and let programs use your modified Gtk+ (by setting LD_LIBRARY_PATH). This is trivial compared to your suggestions. In any case, you may run into some implicit assertions in the programs about how menus work. Also, there is no fundamental difference between application, context and whatever else menus. They are all GtkMenu widgets and programs may actually use a single GtkMenu object in different places. Yeti ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
GtkTextView and bidi text
How can I force GtkTextView object to use left to right rendering when I type in a character which has the default behavior of being from a RTL language? I need this behavior when I mix some RTL characters with LTR characters and the first character on a line is of RTL type. The following lines seem to have no impact. GtkTextView *view; ... gtk_widget_set_direction(view, GTK_TEXT_DIR_LTR); gtk_widget_set_default_direction(GTK_TEXT_DIR_LTR); -Ferdinand ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How to generate event explicit (through code) ?
Thanks David. This is a requirement of visually challenged person. Problem statement: To traverse the item present on desktop using single keystroke. Details : The existing way provides multiple keystroks in in multiple directions. This creates confusion of which direction to go and how many times. There may also be chances to mis few item on desktop/screen. Proposed solution: provide a traversing mechanism, in which all item can be visited using single keystroke. Feel free to discuss, I will look after the suggestions given by you. regards Leena On Mon, Apr 23, 2012 at 6:21 PM, David Nečas y...@physics.muni.cz wrote: On Mon, Apr 23, 2012 at 05:16:52PM +0530, Leena Chourey wrote: I want the focus to move selection/focus from one icon to another automatically on single key press. I have tried to just run key_press event code in a loop, but the selection is not moving from one to another, it is directly coming to the last item. it requires a h/w interruption (key_press) . As I understood, I need to generate the event key_press explicitly in the loop every time. How to generate gtk_event explicitly without any (h/w) key press? I must admit that I do not actually understand what you are trying to achieve (namely why you try to emulate key events). Anyway: Common keyboard control is usually defined by bindings, see GtkBindingSet for start. Maybe you just need to define bindings for the required keys to make them move the selection. If you want something special that does not correspond to the common movements then register a key-press-event callback for the widget and in that callback run gtk_widget_grab_focus() to move the focus where you want, gtk_icon_view_select_path() to set the icon view selection, etc. Return TRUE from the callback (most likely). You might also want to manipulate the selection/focus by invoking action signals of the wiget, e.g. the move-cursor signal for GtkIconView. Yeti ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkTextView and bidi text
Indeed there is no higher level override determine the text direction. You have to change the buffer contents to get what you want. The easiest way of doing this is by inserting the character zero-width character LRM (U+200E) before your first RTL character. Lots of years ago we spoke about having a direction override as a paragraph attribute, but we never got around to implementing it. Regards, Dov On Tue, Apr 24, 2012 at 01:33, Ferdinand Ramirez ramirez.ferdin...@yahoo.com wrote: How can I force GtkTextView object to use left to right rendering when I type in a character which has the default behavior of being from a RTL language? I need this behavior when I mix some RTL characters with LTR characters and the first character on a line is of RTL type. The following lines seem to have no impact. GtkTextView *view; ... gtk_widget_set_direction(view, GTK_TEXT_DIR_LTR); gtk_widget_set_default_direction(GTK_TEXT_DIR_LTR); -Ferdinand ___ 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