Re: how to set gtkeventbox to respect background image
Dear Friends How to make gtk_event_box with an label inside respect the background image defined on the window. Other controls on same window like radios, checkbox and buttons, apear correct on the image background i create the background with the follow void SetWindowBackImage(GtkFixed box, char * szFileName, int x, int y, int h , int w ) GtkWidget * hCtrl; GdkPixbuf * handle = gdk_pixbuf_new_from_file( szFileName, NULL ); GdkPixbuf * pHandle= alpha2pixbuf( handle, 16777215 ); hCtrl = gtk_image_new_from_pixbuf(pHandle); if ( box ) gtk_fixed_put( box, hCtrl, x,y); gtk_widget_set_size_request( hCtrl,h,w ); } and the label i create with void CreateLabel(GtkFixed box, char * cTitle, int x, int y, int h , int w ) { GtkWidget * hCtrl, * hLabel; GtkFixed * box; GdkPixbuf * handle ; GdkPixbuf * pHandle; hCtrl = gtk_event_box_new(); cTitle = hwg_convert_to_utf8( cTitle ); hLabel = gtk_label_new( cTitle ); g_free( cTitle ); gtk_container_add( GTK_CONTAINER(hCtrl), hLabel ); g_object_set_data( (GObject*) hCtrl, label, (gpointer) hLabel ); } if ( box ) gtk_fixed_put( box, hCtrl, x,y); gtk_widget_set_size_request( hCtrl,h,w); } Regards and thanks in advance Luiz Rafael ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
getwindowRect
Dear Friends is their any function or way in gtk to emulate GetWindowRect() and return the widget top/left/bottom/right position? Regards Luiz ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: status bars with multiples part
Hi Lance I would just pack 4 different statusbars in an hbox, and have each statusbar have it's own information. thanks for the info, but is possible to specify the size of each part of statusbar ? Regards Luiz ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
status bars with multiples part
Dear Friends is possible to create an statusbar in gtk with multiples parts? example part 1 show the filename, part 2 show row number, part 3 show col number, part 4 show ins/CAPS status on/off Regards Luiz ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: text color on the button
Hi I do void ChangeColor( GtkWidget *hCtrl,ULONG hColor) // color in rgb format { GtkWidget *label ; GdkColor fColor ; if (GTK_IS_BUTTON(hCtrl) ) label = gtk_bin_get_child(GTK_BIN(hCtrl)); hwg_parse_color( hColor, fColor ); gtk_widget_modify_fg(label,GTK_STATE_NORMAL,fColor); } - Original Message - From: Lukasz Gromotowicz [EMAIL PROTECTED] To: gtk-app-devel-list@gnome.org Sent: Monday, May 12, 2008 1:12 PM Subject: text color on the button Hi all, I can not find anywhere the complete description of how to change the color on the button label. I know I have to access the label which is on the button and then set the color with gtk_widget_modify_fg(), but how can I get this label? I have created the button using gtk_button_new_with_label. Could anyone help me please? Best regards, LUK ___ 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
Gradient Text
Dear Friends Is possible to display an label with gradient background? also any example is possible? Regards Luiz - Original Message - From: Ian Puleston [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 24, 2008 10:55 PM Subject: RE: Jerky window resizing in Windows GTK app Hi again, OK, I found the problem. After continuing to pair down the app until the problem went away, it turned out to be due to this line: gtk_window_set_position(GTK_WINDOW(mainWin), GTK_WIN_POS_CENTER_ALWAYS); It's the continual re-centering due to that GTK_WIN_POS_CENTER_ALWAYS that is not working very well. After changing it to GTK_WIN_POS_CENTER (which is actually what I really wanted anyway) it resizes nice and smoothly now. Ian -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Puleston Sent: Monday, March 24, 2008 12:33 PM To: [EMAIL PROTECTED] Subject: RE: Jerky window resizing in Windows GTK app -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tor Lillqvist Sent: Monday, March 24, 2008 1:40 AM I would say that is not expected, at least with a current GTK+ version. What version of GTK+ are you using? Pretty much current - 2.12.3. Do you have a minimal but complete sample program that exhibits the behaviour? I do now. I've cut my program down to bare bones without actually changing the layout of the window, and uploaded a zip file (119 Kbytes) containing the source plus an exe (compiled with the MinGW compiler) here: http://diverian.tripod.com/home/Files/gtk-test.zip The tstapp.exe program in the bin directory demonstrates the problem. Ian ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
toolButton Disable
Dear Friends Is their an way to disable an specific tool buton like the winapi? I read the docs, but could not find an reference Regards Luiz - Original Message - From: ying lcs [EMAIL PROTECTED] To: Luis Menina [EMAIL PROTECTED] Cc: gtk-app-devel-list@gnome.org Sent: Saturday, March 22, 2008 10:48 PM Subject: Re: Question in using gdk_pixbuf_get_from_drawable() Luis, The 'window' object is from: gtk_window_new(GTK_WINDOW_TOPLEVEL) I do see it works something, while other times, I see the screenshot get out of place (as shown in the image I attached). I suspect my window is obscured during the capture. So how can I programmatic make sure my window is not obscured before the catpure? I have tried adding: gdk_window_raise(window); gdk_flush(); But it does not always help. Thank you for any more pointers. On Thu, Mar 20, 2008 at 7:37 PM, Luis Menina [EMAIL PROTECTED] wrote: Hi, where does your window object come from ? Could you please give us the code where you initilized it ? I've tried to adapt your code in a simple example, and it just works... I get a screenshot of what is in the window, without the window decoration. Cheers, Luis ying lcs a écrit : Hi, I have a question of using gdk_pixbuf_get_from_drawable(). I have the following code which save the gdk window to a png file. But something I get something which is totally not what is displayed on the window. Can you please tell me what am I missing? GdkWindow *window ; if (window != NULL) { int x, y, width, height, depth; gdk_window_get_geometry( window, x, y, width, height, depth ); printf ( width=%d, height=%d\n, width, height); /* copy the pixmap from the treeview and from the title */ pb = gdk_pixbuf_get_from_drawable(NULL, GDK_DRAWABLE(window), NULL, 0, 0, 0, 0, width, height); /* save the pixbuf to a png file */ gdk_pixbuf_save(pb, filename, png, NULL, compression, 9, NULL); } Thank you. ___ 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_entry_new and accented chars
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
Re: gtk_entry_new and accented chars
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
Re: gtk_entry_new and accented chars
Tor for char ä i get this values (((GdkEventKey*)event)-keyval = 65506 (((GdkEventKey*)event)-keyval = 65111 (((GdkEventKey*)event)-keyval = 97 Well, apparently you don't have any 'ä' key on the keyboard, and are entering the 'ä' character using a dead accent sequence. I.e. using two keystrokes, first the (dead) diaeresis key, then 'a'. Each GdkEventKey event corresponds to a physical key press or release, so you don't have any key press that would correspond to the 'ä' character as you don't have any 'ä' key on the keyboard. If you print the keyvals in hex and look them up in gdkkeysyms.h, you will see that: 65506 = 0xFFE2 = GDK_Shift_R 65111 = 0xFE57 = GDK_dead_diaeresis 97 = 0x61 = 'a' If you desperately need to get the 'ä' using a single keystroke, switch to a keyboard layout that has a 'ä' key... Brasilian abnt2 dont have such keys, accents chars is get by using the accent key(~^´`¨) + one of the vogels so their an way to get the 'ä' key on two strokes, otherwise, ill change the code to get the chars on two strokes by combining then Also, your problem isn't exactly made easier by the fact that you apparently try to turn GDK events into emulated Windows messages. yes, since is an binding from gtk to xharbour to me compatible with the windows version,i emulate the same windows message on gtk events thanks for the answer Regards Luiz ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
gtk_entry_new and accented chars
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
Re: gtk_entry_new and accented chars
Hi To get the corresponding Unicode character (if any), use gdk_keyval_to_unicode (). I'll let you figure out by yourself how to convert from a Unicode character to Latin1. thanks for answer i tryed to add the code to printf the unicode char but i always get 0 as unicode value for accented char my LANG envar is set to pt_BR on open suse 10.1 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