GList

2005-08-17 Thread Tristan Sloughter
I am using GLists and want to make sure I am freeing all the memory, and not twice or course. There are three possible functions for removing an element from the list: g_list_remove (GList *list, gconstpointer data); g_list_remove_link (GList *list, GList *llink); g_list_delete_link (GList *lis

Re: [GtkMenu] Callback problem with popups submenus

2005-08-17 Thread Emmanuel saracco
Le Jeudi 18 Août 2005 01:55, Brian J. Tarricone a écrit : Hi, > I'm not sure if it matters or not (would have to look at the gtk source, > and I'm lazy), but you should be using gtk_menu_shell_append() instead > of gtk_container_add() to add menu items to the menu. Same result: first level menu

Re: [GtkMenu] Callback problem with popups submenus

2005-08-17 Thread Brian J. Tarricone
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Emmanuel saracco wrote: > Hi, > > I have a problem with popup submenus callbacks. The following code display > the > popup, but the callback is not called: > > - > GtkWidget *menu, *submenu, *item; > > menu = gtk_menu_new (); > > item = gtk_m

Re: [GtkMenu] Callback problem with popups submenus

2005-08-17 Thread Emmanuel saracco
Le Mercredi 17 Août 2005 22:45, John Coppens a écrit : Hi John, > The GTK tutorial does things rather differently: > > http://www.gtk.org/tutorial/ch-menuwidget.html#SEC-MANUALMENUCREATION This is not the problem. Same thing following and adapting tutorial example to my needs. -> I both build

Re: XGrabKey

2005-08-17 Thread Mario Levinsky
Thank you for your reply, as can I see you suggest using of gdk_display_add_client_message_filter it has parameter GdkAtom message_type but there are no information of it usage and how create GdkAtom as message type, how you use it? >I did something very similar in my app. May be you hear a

Re: Unicode text Direction Detection

2005-08-17 Thread Mark Leisher
Gaurav Jain wrote: Could you give me some tips on how to go about implementing a "naive" version of such an algorithm? Suppose I have a unicode character, what's the simplest way to know if it is a LTR directional character or a RTL directional character? Try http://crl.nmsu.edu/~mleisher/ucd

Re: Unicode text Direction Detection

2005-08-17 Thread Behdad Esfahbod
On Wed, 17 Aug 2005, Gaurav Jain wrote: > Could you give me some tips on how to go about implementing a "naive" > version of such an algorithm? Suppose I have a unicode character, > what's the simplest way to know if it is a LTR directional character > or a RTL directional character? Here it is

Re: Unicode text Direction Detection

2005-08-17 Thread Behdad Esfahbod
On Wed, 17 Aug 2005, Gaurav Jain wrote: > Hi, > > I have a Unicode text, and I need to detect its direction by some BiDi > algorithm (i.e., whether it is Left-to-right or Right-to-left). For > example, I need to look for the first "strong" directional character > in the text, and find out its dir

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 n

Re: XGrabKey

2005-08-17 Thread Tristan Sloughter
I did this in my program tilda like this: key_grab (gchar *key) { XModifierKeymap *modmap; unsigned int numlockmask = 0; unsigned int modmask = 0; gint i, j; /* Key grabbing stuff taken from yeahconsole who took it from evilwm */ modmap = XGetModifierMapping(dpy); for (i

RE: XGrabKey

2005-08-17 Thread Alex Levin
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. // This function handles a

Re: [GtkMenu] Callback problem with popups submenus

2005-08-17 Thread John Coppens
On Wed, 17 Aug 2005 21:46:02 +0200 Emmanuel saracco <[EMAIL PROTECTED]> wrote: > Does anybody see what's wrong here? The GTK tutorial does things rather differently: http://www.gtk.org/tutorial/ch-menuwidget.html#SEC-MANUALMENUCREATION John ___ gtk-ap

XGrabKey

2005-08-17 Thread Mario Levinsky
Hi! I would like to make possilbe in my gtk+ application using global hot keys, I found xbindkeys application, and use part of its code. Usage is simple: first I call this void grab_keys(Display *dpy, Keys_t *keys, int nb_keys); and after that I catch XKeyEvent. In xbindkeys it works, in gt

Re: dynamically changing color of labels and edit boxes

2005-08-17 Thread Gian Mario Tagliaretti
2005/8/17, Faria, Sydney C <[EMAIL PROTECTED]>: > Is there a way to change the color of the text displayed in an edit box > after the text has been put into the edit box? I have a need to do range > checking on edit box entries and would like to change the text color to red > if the value entered

[GtkMenu] Callback problem with popups submenus

2005-08-17 Thread Emmanuel saracco
Hi, I have a problem with popup submenus callbacks. The following code display the popup, but the callback is not called: - GtkWidget *menu, *submenu, *item; menu = gtk_menu_new (); item = gtk_menu_item_new_with_label ("Submenu 1"); gtk_container_add (GTK_CONTAINER (menu), item); submenu

dynamically changing color of labels and edit boxes

2005-08-17 Thread Faria, Sydney C
Is there a way to change the color of the text displayed in an edit box after the text has been put into the edit box? I have a need to do range checking on edit box entries and would like to change the text color to red if the value entered is out of range. I have a similar need to do this with

Re: Signal when the content of a GtkEntry is changed

2005-08-17 Thread Bill Medland
On August 16, 2005 09:03 pm, John Coppens wrote: > On Tue, 16 Aug 2005 16:48:35 -0700 > > Bill Medland <[EMAIL PROTECTED]> wrote: > > (I wish the API actually documented this stuff). Can you > > expand on "and such"? I could build an experiment and try > > to find out, but I would rather hear wha

Re: Unicode text Direction Detection

2005-08-17 Thread Gaurav Jain
Thanks Behdad. On 8/17/05, Behdad Esfahbod <[EMAIL PROTECTED]> wrote: > On Wed, 17 Aug 2005, Gaurav Jain wrote: > > > Hi, > > > > I have a Unicode text, and I need to detect its direction by some BiDi > > algorithm (i.e., whether it is Left-to-right or Right-to-left). For > > example, I need t

Re: Unicode text Direction Detection

2005-08-17 Thread Gaurav Jain
Thanks Matthias for the quick response. On 8/17/05, Matthias Clasen <[EMAIL PROTECTED]> wrote: > On Wed, 2005-08-17 at 17:32 +0530, Gaurav Jain wrote: > > Hi, > > > > I have a Unicode text, and I need to detect its direction by some BiDi > > algorithm (i.e., whether it is Left-to-right or Right-to

Re: Unicode text Direction Detection

2005-08-17 Thread Matthias Clasen
On Wed, 2005-08-17 at 17:32 +0530, Gaurav Jain wrote: > Hi, > > I have a Unicode text, and I need to detect its direction by some BiDi > algorithm (i.e., whether it is Left-to-right or Right-to-left). For > example, I need to look for the first "strong" directional character > in the text, and fi

Re: GdkColor to Hexadecimal conversion

2005-08-17 Thread David Necas (Yeti)
On Wed, Aug 17, 2005 at 12:40:13PM +0200, Iago Rubio wrote: > On Wed, 2005-08-17 at 20:21 +1000, Nick Watts wrote: > > Easiest way to convert a GdkColor to its hexadecimal equivalent? > > If you mean an #RRGGBB string for web use: > > gchar* // please free me when you're done > gdk_color_to_rgb_

Unicode text Direction Detection

2005-08-17 Thread Gaurav Jain
Hi, I have a Unicode text, and I need to detect its direction by some BiDi algorithm (i.e., whether it is Left-to-right or Right-to-left). For example, I need to look for the first "strong" directional character in the text, and find out its direction. Is there a way I can do that using some GTK

Re: GdkColor to Hexadecimal conversion

2005-08-17 Thread Iago Rubio
On Wed, 2005-08-17 at 20:21 +1000, Nick Watts wrote: > Easiest way to convert a GdkColor to its hexadecimal equivalent? If you mean an #RRGGBB string for web use: gchar* // please free me when you're done gdk_color_to_rgb_hex_string(GdkColor* color) { gchar* rgb; gfloat r, g, b;

Re: scroll window with no border

2005-08-17 Thread Yogesh M
found the solution, the ugly border comes from the gtk_viewport, So first wrap the widget with the viewport and remove the border for it. then wrap viewport with scroll window and remove the border[default removed], now you get a scroll window with view port and no kind of border. where to u

GdkColor to Hexadecimal conversion

2005-08-17 Thread Nick Watts
Easiest way to convert a GdkColor to its hexadecimal equivalent? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Getting workspace number?

2005-08-17 Thread Jan Struyf
Dear All, I would like to write a command line application that outputs the current workspace (under GNOME, I had someting in WindowMaker, but this does not work in GNOME). I have tried the following: int main(int argc, char** argv) { gtk_init(&argc, &argv); WnckScreen *scree

Re: Current Working Directory

2005-08-17 Thread Tor Lillqvist
Nick Watts writes: > How can I set the cwd to the path my app is in? Do you mean the process's working directory, or the file selector's default directory? I'll answer the former. char buffer[1000]; char *app_dir; GetModuleFileName (NULL, buffer, sizeof (buffer));

Re: Best place to call gtk_widget_show()?

2005-08-17 Thread Iago Rubio
On Wed, 2005-08-17 at 09:36 +0200, Stefan Kost wrote: > Hi Markus, > Markus Lausser wrote: > > Hello, > > > > I wonder, in which order should the following tasks be done: > > * show widget > > * add widget to parent container > > * add childs to widget > > > > Which order is the fastest (CPU)? >

Re: Current Working Directory

2005-08-17 Thread Iago Rubio
On Wed, 2005-08-17 at 16:57 +1000, Nick Watts wrote: > Writing a GTK app under win32. When I use "Open With" to open > a file with my app, the current working directory is the one the file > is in rather than the one my app is in. > > How can I set the cwd to the path my app is in? On installat

Re: Signal when the content of a GtkEntry is changed

2005-08-17 Thread Arne Skjaerholt
> (I wish the API actually documented this stuff). Can you expand > on "and such"? I could build an experiment and try to find out, > but I would rather hear what the designers intended it to do. If you install the devhelp application (which I heartily recommend) you will find all the signals

Re: Current Working Directory

2005-08-17 Thread Benoît Touron
Nick, Use GetCommandLine and extract the path your app is in (might be a bit tricky though). Use SetCurrentDirectory to change the current dir. Ben Writing a GTK app under win32. When I use "Open With" to open a file with my app, the current working directory is the one the file is in rathe

Re: Best place to call gtk_widget_show()?

2005-08-17 Thread Stefan Kost
Hi Markus, Markus Lausser wrote: Hello, I wonder, in which order should the following tasks be done: * show widget * add widget to parent container * add childs to widget Which order is the fastest (CPU)? First add childs, then show? First show then add to parent? etc... Or maybe call gtk_widg