Re: gtk_entry_new and accented chars
Luiz Rafael Culik Guimaraes-4 wrote: Dear Friends I have an small app with one gtk_entry_new with an handle to my user defined key_press_event but i cannot get the accented char from latin 1 code page on entry here an part of my key handler here is the routine for key_press_event #define WM_MOVE 3 #define WM_SIZE 5 #define WM_KEYDOWN 256// 0x0100 #define WM_KEYUP257// 0x0101 #define WM_MOUSEMOVE512// 0x0200 #define WM_LBUTTONDOWN 513// 0x0201 #define WM_LBUTTONUP514// 0x0202 #define WM_LBUTTONDBLCLK515// 0x0203 #define WM_RBUTTONDOWN 516// 0x0204 #define WM_RBUTTONUP517// 0x0205 static gint cb_event( GtkWidget *widget, GdkEvent * event, gchar* data ) { gpointer gObject = g_object_get_data( (GObject*) widget, obj ); LONG lRes; if( !pSym_onEvent ) pSym_onEvent = hb_dynsymFindName( ONEVENT ); //if( !gObject ) // gObject = g_object_get_data( (GObject*) (widget-parent-parent), obj ); if( pSym_onEvent gObject ) { LONG p1, p2, p3; if( event-type == GDK_KEY_PRESS || event-type == GDK_KEY_RELEASE ) { p1 = (event-type==GDK_KEY_PRESS)? WM_KEYDOWN : WM_KEYUP; p2 = ((GdkEventKey*)event)-keyval; p3 = ( ( ((GdkEventKey*)event)-state GDK_SHIFT_MASK )? 1 : 0 ) | ( ( ((GdkEventKey*)event)-state GDK_CONTROL_MASK )? 2 : 0 ) | ( ( ((GdkEventKey*)event)-state GDK_MOD1_MASK )? 4 : 0 ); } else if( event-type == GDK_SCROLL ) { p1 = WM_KEYDOWN; p2 = ( ( (GdkEventScroll*)event )-direction == GDK_SCROLL_DOWN )? 0xFF54 : 0xFF52; p3 = 0; } else if( event-type == GDK_BUTTON_PRESS || event-type == GDK_2BUTTON_PRESS || event-type == GDK_BUTTON_RELEASE ) { p1 = (event-type==GDK_BUTTON_PRESS)? WM_LBUTTONDOWN : ( (event-type==GDK_BUTTON_RELEASE)? WM_LBUTTONUP : WM_LBUTTONDBLCLK ); p2 = 0; p3 = ( ((ULONG)(((GdkEventButton*)event)-x)) 0x ) | ( ( ((ULONG)(((GdkEventButton*)event)-y)) 16 ) 0x ); } else if( event-type == GDK_MOTION_NOTIFY ) { p1 = WM_MOUSEMOVE; p2 = ( ((GdkEventMotion*)event)-state GDK_BUTTON1_MASK )? 1:0; p3 = ( ((ULONG)(((GdkEventMotion*)event)-x)) 0x ) | ( ( ((ULONG)(((GdkEventMotion*)event)-y)) 16 ) 0x ); } else if( event-type == GDK_CONFIGURE ) { p2 = 0; if( widget-allocation.width != ((GdkEventConfigure*)event)-width || widget-allocation.height!= ((GdkEventConfigure*)event)-height ) { return 0; } else { p1 = WM_MOVE; p3 = ( ((GdkEventConfigure*)event)-x 0x ) | ( ( ((GdkEventConfigure*)event)-y 16 ) 0x ); } } else if( event-type == GDK_ENTER_NOTIFY || event-type == GDK_LEAVE_NOTIFY ) { p1 = WM_MOUSEMOVE; p2 = ( ((GdkEventCrossing*)event)-state GDK_BUTTON1_MASK )? 1:0 | ( event-type == GDK_ENTER_NOTIFY )? 0x10:0; p3 = ( ((ULONG)(((GdkEventCrossing*)event)-x)) 0x ) | ( ( ((ULONG)(((GdkEventMotion*)event)-y)) 16 ) 0x ); } else sscanf( (char*)data,%ld %ld %ld,p1,p2,p3 ); } return 0; } any ideia? Regards Luiz ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list right,you should modify your codes again by virtue of to be in different level(GTK and GDK). if you were to focus on any widgets to get a piece of informations,then your ways to be wrong! -- View this message in context: http://www.nabble.com/gtk_entry_new-and-accented-chars-tp14884653p19118756.html Sent from the Gtk+ - Apps Dev mailing list archive at Nabble.com. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Is there a way to invert gtk_ui_manager_get_path()
The function gtk_ui_manager_get_path() gets the xml path to a widget in your menu hierarchy. Is there a way, given a widget to find this path? Note this is not the path gotten from gtk_widget_path() which is the container hierarchy. I want the menu hierarchy (so as to be able to insert menu items there in some future invocation of the program). Richard Shann ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Gtkfilechooser question
Hi, i'm facing a problem in the use of the gtk_file_chooser_dialog. I'm developing a frontend for an antivirus scanner and i need to pass to the scanner the path of the file OR folder to scan. At the moment due to the nature of the GtkFileChooserAction typedef enum { GTK_FILE_CHOOSER_ACTION_OPEN, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER } GtkFileChooserAction; I solved the problem by adding two buttons to the gui one to select a file and one to select a folder. This obviously is a suboptimal solution. In the past i used a gtk_file_selection widget for that function but i abandoned it as now it is deprecated. After googling aroud a lot I tried various hacks to the gtk_file_chooser_dialog by connecting to different signals and trying to change the GtkFileChooserAction on the fly with no result. What I'm missing is a: GTK_FILE_CHOOSER_ACTION_SELECT_FILE_FOLDER action but i doubt the gtk people will implement it for me :-). I also started looking at the gtk_file_chooser source to see if it is possible to implement a private version of the widget for my app but this looks like a rather difficult task. Any hints are welcome as i'm at a dead end now Thanks in advance and best regards, Tito ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Gtkfilechooser question
Hi: GTK_FILE_CHOOSER_ACTION_SELECT_FILE_FOLDER action but i doubt the gtk people will implement it for me :-). I don`t see any reason to implement that in gtk. I believe you have design your own widget Regards. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Gtkfilechooser question
On Saturday 23 August 2008 15:26:55 Martin (OpenGeoMap) wrote: Hi: GTK_FILE_CHOOSER_ACTION_SELECT_FILE_FOLDER action but i doubt the gtk people will implement it for me :-). I don`t see any reason to implement that in gtk. I believe you have design your own widget Regards. Hi, In my opinion there would be some reasons to implement it as this is a feature that could be useful in many cases. The fact that this feature is missing is a needless limitation to a tool that already has the capabilities to do that built in. There are examples for the need of this feature also in other OSes: the gui of Nero essentials pops up, after clicking on add, a standard win file chooser dialog that allows to add files and/or folders. The KDE open files dialog has it to... I think there could be more examples Last but not least the previous GtkFileSelection interface had this feature already and after deprecating it in my opinion it should be natural to offer in the replacement interface at least the same features as in the previous. Thanks for your response and best regards, Tito ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list