Re: Mary Christimas
* Everaldo Canuto ([EMAIL PROTECTED]) wrote: Hi all, I know that this is a international list and not all people have same religion or calendar but... Mary Christimas, a happy new year and a big success in 2006!! Everaldo. Thank you. To you and yours too. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: New to GTK+, please help
* Jun Shen ([EMAIL PROTECTED]) wrote: Hi, I am new to GTK+. I am trying to run the Hello World program from GTK+ 2.0Tutorial in Visual C++ 6.0. But I am getting the following error. Please help. Thank you very much. Jun ** (gtk.exe): WARNING **: The specified module could not be found. Failed to load Pango module for id: 'BasicScriptEngineWin32' (gtk.exe): GLib-GObject-CRITICAL **: file gobject.c: line 1561 (g_object_ref): a ssertion `G_IS_OBJECT (object)' failed ** (gtk.exe): CRITICAL **: file pango-engine.c: line 68 (_pango_engine_shape_sha pe): assertion `PANGO_IS_FONT (font)' failed Do you have the Pango Libraries specified in your VC++ project? I'm not up on Visual C but check to make sure everything is linked in correctly. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Are there anybody interested in porting GTK to embedded dev board
* lin Yang ([EMAIL PROTECTED]) wrote: Hello,everybody! I'm working on porting GTK to Intel dev board. My goal is to develop a system like smart phone or PDA. After investegating Qt and GTK, I choose GTK as my graphic user interface.However it's not easy.Firstly, I port X11 onto the dev board. Secondly, I compiled GTK.As to applications, I want to use GPE. If anyone else is interested in this topic,please feel free to contact me. I'm very pleased to discuss with you. Actually, I think someone has altready done this with FLTK or someting. ONe of the PDAs I used to have was entirely linux based and used GTK for the UI which was a special version which I *think* was called FLTK or something like that. The PDA used an embedded chip (though not intel based). Let's see, here is what I was thinking of, though according to the page it's C++ based. http://www.fltk.org/ It's worth a look. Failing that, I'd be happy to help you out on a contractual basis. Note that GTK+ is a little large for embedded systems. See this reference: http://www.linuxdevices.com/cgi-bin/board/UltraBoard.pl?Action=ShowPostBoard=100Post=45Idle=0Sort=0Order=DescendPage=5Session= -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: (no subject)
* trupthi n t ([EMAIL PROTECTED]) wrote: Hi, To write/find a function which returns the the widget on which the current focus is,when i used the following function GtkWidget* gtk_window_get_focus(GtkWindow *window); The compiler(gtk+1.2.10) gave the following error: [EMAIL PROTECTED] test]# make gcc `gtk-config --cflags` foc.c -o foc `gtk-config --libs` foc.c: In function `fovu': foc.c:60: warning: assignment makes pointer from integer without a cast /tmp/ccbfegod.o(.text+0x297): In function `fovu': : undefined reference to `gtk_window_get_focus' collect2: ld returned 1 exit status make: *** [foc] Error 1 [EMAIL PROTECTED] test]# Kindly help as to how to proceed further. did you put the function definition in a header file included in the .c files you want to use? The without a cast error means you have to do something like this: (GTK_WINDOW) GtkWidget = gtk_window_get_focus(*theWindow); But it's hard to tell without seeing the code in question. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Printing in GTK+
* Roger Leigh ([EMAIL PROTECTED]) wrote: Some of the recent (paid) work I've done with GTK+ has involved output to receipt printers for point of sale applications, where this sort of thing would have been quite useful. As it was, I just used normal pipes. And all the reporting used groff as a backend; a GTK+ frontend is also planned. For Gimp-Print, the libgimpprintui library provides its own print dialog, providing full control over the printer, but it's currently dependent upon libgimpprint and so would only be good for client-side processing. I talked with Jody about moving some of the widgets into libgimpprintui if they would be useful (once the code has been cleaned up--it's not currently modular enough). What kind of label (POS) printer are you using? I'll need to get something I know works. The PostScript rendering API could use the same GIOChannel to send the print job--it would just be an extra layer that you have the choice of using or not as you see fit (and the fact that there are two layers could be hidden by the rendering API). That would be nice. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Printing in GTK+
I have some data I want to print out in my application. How do I do it? To make things a little different, I *might* print to one of those POS type printers (USB) not a regular printer. Pointers? Which classes do I need to use? Thanks. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Printing in GTK+
* Roger Leigh ([EMAIL PROTECTED]) wrote: Carl B. Constantine [EMAIL PROTECTED] writes: I have some data I want to print out in my application. How do I do it? To make things a little different, I *might* print to one of those POS type printers (USB) not a regular printer. Pointers? Which classes do I need to use? GTK+ itself doesn't currently offer any printing support, so the question doesn't really involve GTK+ directly. You need to either 1) Open the printer device (e.g. /dev/usb/lp0) and write data to it. 2) Open a pipe to the printer spooler (e.g. lpr -P queuename) and then write the job data and close the connection. Thanks for clearing this up. By a POS printer, I take that to mean a 40 col receipt printer sort of thing. These are basic devices which are basically ASCII thermal printers plus some additional control codes and possibly some extra bitmap raster graphics mode. For these you just send the control codes inline with the text you're printing to either (1) or (2) above. Your program is entirely responsible for the formatting, layout and cutting etc. yes, that's pretty much what I mean. What do I use to do layout and formatting before dumping to the printer? Where would I find information on the extra control codes? I'm sure not all printer manufactureres publish this sort of thing. How does that work with CUPS? For the work I do, I send jobs to a receipt printer via CUPS. After completion of a transaction, the receipt gets printed after a barely noticeable delay ( 0.5s). Your best bet is to use a spooler. This also makes networked operation totally transparent, and is far more flexible. You can use libcups, lpc or lpstat etc. to get a list of all available printers if the user needs to choose one. Ok, so I probably will use a print spooler (CUPS), what do I need to do? I'll look at the CUPS docs, but some fast direct pointers are nice. Thanks in advance. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: fix for: assignment discards qualifiers from pointer target type
* John Cupitt ([EMAIL PROTECTED]) wrote: On Wed, 14 Jul 2004 20:53:16 -0700, Carl B. Constantine [EMAIL PROTECTED] wrote: gchar *userid = NULL; userid = gtk_entry_get_text(GTK_ENTRY(lookup_widget(logon, password))); Try const char *userid = gtk_entry_get_text( GTK_ENTRY( ... That works great. Thank you. Now, any ideas on the other problem I had printing the string pointer? -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
fix for: assignment discards qualifiers from pointer target type
I'm getting the following warning message on compile: filename.c:124: warning: assignment discards qualifiers from pointer target type. This occurs on lines such as this: ... gchar *userid = NULL; userid = gtk_entry_get_text(GTK_ENTRY(lookup_widget(logon, password))); but, gtk_entry_get_text returns a gchar* (specifically a G_CONST_RETURN gchar*). So my question is, how on earth do I fix this warning message? Am I casting something incorrectly? -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
can't print string pointer, get error?
I have the following defined in my program: gchar *id; I perform the following operation which fills id with appropriate values: gtk_tree_model_get(theModel, custListIter, CUST_ID, id, -1); Then, I print out the value of id for debugging purposes: g_printf(row number %s was retrieved\n, id); but, upon compile, I receive the following error: callbacks.c:509: warning: char format, different type arg(arg 2) Say what? Why am I getting this error? It doesn't make sense. You print out string pointers using printf(%s, var) which works fine numer normal C conditions. So why do I get this warning, and how do I fix it? Thanks. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Traditional C rejects ISO C
* Manish Singh ([EMAIL PROTECTED]) wrote: On Sat, Jun 12, 2004 at 08:01:05PM -0700, Carl B. Constantine wrote: I thank you for your reply, however it doesn't really answer my question. First, I'm only using gcc, so Borland and MS C don't count. Second, I'm obviouslly using gcc's -Wtraditional setting for these errors to come up, so my question was: how do I get rid of these errors so that everything works correctly while still using -Wtraditional? Should I even be using -Wtraditional? I doubt you should be using -Wtraditional. Do you really care if your code works with pre-ANSI C compilers? That's what traditional means. I don't. I found the setting for that. However, Anjuta in Fedora Core 2 doesn't seem to let this setting go off, even after I turn it off :-( My debian install works fine, I can turn it off and all is well again. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Traditional C rejects ISO C
I'm getting alot of these in my code recently. Most likely due to the update to gcc on my systems. I have two problems: 1) I get these errors in gutils.h which I didn't write. (using glib2-2.4.0-1 in Fedora Core 2. I haven't tried with a newer version of glib yet on my Debian box. 2) I get these errors in callbacks.c for routines like: void on_button_3_clicked(GtkButton *button, gpointer user_data) which I didn't write, but glade generated it for me. So my question really comes down to, how do I solve these problems? I don't really understand the difference between traditional C and ISO C so how do I fix it in code I *do* write? I'm writing C code the way I've always done. Thanks for any pointers you can give. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
restricting data entry (filters?)
I posted a note a while back about adding an input filter to a GtkEntry widget. I recieved a couple of responces, but I don't think they are what I need. I want the user to only be able to type numbers in a GtkEntry field. I don't want to have to check the value after the fact. One person came up with declaring the field cast as an INT, that may work, but I have no idea how to hook that into Glade (which is generating my source at present) and thus into my app. Does anyone have other ideas on how to do what I want? Thanks. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
GtkEntry input filters
I have a GtkEntry in my app where the only thing I want to be able to input is numbers. I don't want letters or characters like (, * , -, ), and so forth. Anyone know how to write such an input filter? -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: someone please answer, clearing text in a GtkTextView!
* Roger Leigh ([EMAIL PROTECTED]) wrote: Carl B. Constantine [EMAIL PROTECTED] writes: I have a GtkTextView in a window used for data entry into a database. The text typed in the view gets put in the database no problem, but once the data entry has occurred, I want to clear the view so that the next screen of data can be input. Do you want to clear the *view* (the GtkTextView) or the *model* (the GtkTextBuffer)? If the former, you want to remove the TextBuffer and replace it with a new one. If the latter, you just need to clear the buffer. Try something like: GtkTextIter start, end; gtk_text_buffer_get_start_iter(textbuffer, start); gtk_text_buffer_get_end_iter(textbuffer, end); gtk_textbuffer_delete(textbuffer, start, end); I did that and it crashed. The answer, thanks to a couple other posters was to set the text buffer to null: gtk_text_buffer_set_text(textbuffer, \0, -1); -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
someone please answer, clearing text in a GtkTextView!
I have a GtkTextView in a window used for data entry into a database. The text typed in the view gets put in the database no problem, but once the data entry has occurred, I want to clear the view so that the next screen of data can be input. Looking through the API, there isn't a set text function for this view (per se) like the GtkEntry widgets, except in the GtkTextBuffer. The other funcition in that widget is gtk_text_buffer_delete, which I called but I'm getting an error. Here's the code I was using to get the buffer, then delete it: /* the GtkTextView in this window requires a bit of extra work to get the text value stored in it. */ specialView = lookup_widget(customers, cust_instructions); specialBuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(specialView)); gtk_text_buffer_get_bounds(specialBuffer, start, end); gtk_text_buffer_delete(specialBuffer, start, end); But here's the error I'm getting when I try to do that: (dispatcher:1523): Gtk-WARNING **: Invalid text buffer iterator: either the iter ator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created. You must use marks, character numbers, or line numbers to preserve a position ac ross buffer modifications. You can apply tags and insert marks without invalidating your iterators, but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset) will invalidate all outstanding iterators (dispatcher:1523): Gtk-CRITICAL **: file gtktextbuffer.c: line 1297 (gtk_text_bu ffer_delete): assertion `gtk_text_iter_get_buffer (start) == buffer' failed Then it segfaults. So I tried the set text call like this: gtk_text_buffer_set_text(specialBuffer,, 0); but that makes my app segfault as well. Can anyone help? -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ 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-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
How to delete/clear text in GtkTextView?
I'm probably using the wrong widget for this, but never-the-less. I have a GtkTextView in a window used for data entry into a database. The text typed in the view gets put in the database no problem, but once the data entry has occurred, I want to clear the view so that the next screen of data can be input. Looking through the API, there isn't a set text function for this view (per se) except in the GtkTextBuffer. The other funcition in that widget is gtk_text_buffer_delete, which I called but I'm getting an error. Here's the code I was using to get the buffer, then delete it: /* the GtkTextView in this window requires a bit of extra work to get the text value stored in it. */ specialView = lookup_widget(customers, cust_instructions); specialBuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(specialView)); gtk_text_buffer_get_bounds(specialBuffer, start, end); gtk_text_buffer_delete(specialBuffer, start, end); But here's the error I'm getting when I try to do that: (dispatcher:1523): Gtk-WARNING **: Invalid text buffer iterator: either the iter ator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created. You must use marks, character numbers, or line numbers to preserve a position ac ross buffer modifications. You can apply tags and insert marks without invalidating your iterators, but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset) will invalidate all outstanding iterators (dispatcher:1523): Gtk-CRITICAL **: file gtktextbuffer.c: line 1297 (gtk_text_bu ffer_delete): assertion `gtk_text_iter_get_buffer (start) == buffer' failed Then it segfaults. So I tried the set text call like this: gtk_text_buffer_set_text(specialBuffer,, 0); but I think that makes my app segfault as well. Can anyone help? -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ 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
deleting text in a text view
I'm probably using the wrong widget for this, but never-the-less. I have a GtkTextView in a window used for data entry into a database. The text typed in the view gets put in the database no problem, but once the data entry has occurred, I want to clear the view so that the next screen of data can be input. Looking through the API, there isn't a set text function for this view (per se) except in the GtkTextBuffer. The other funcition in that widget is gtk_text_buffer_delete, which I called but I'm getting an error. Here's the code I was using to get the buffer, then delete it: /* the GtkTextView in this window requires a bit of extra work to get the text value stored in it. */ specialView = lookup_widget(customers, cust_instructions); specialBuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(specialView)); gtk_text_buffer_get_bounds(specialBuffer, start, end); gtk_text_buffer_delete(specialBuffer, start, end); But here's the error I'm getting when I try to do that: (dispatcher:1523): Gtk-WARNING **: Invalid text buffer iterator: either the iter ator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created. You must use marks, character numbers, or line numbers to preserve a position ac ross buffer modifications. You can apply tags and insert marks without invalidating your iterators, but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset) will invalidate all outstanding iterators (dispatcher:1523): Gtk-CRITICAL **: file gtktextbuffer.c: line 1297 (gtk_text_bu ffer_delete): assertion `gtk_text_iter_get_buffer (start) == buffer' failed Then it segfaults. So I tried the set text call like this: gtk_text_buffer_set_text(specialBuffer,, 0); but I think that makes my app segfault as well. Can anyone help? -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
g_strncat -- THANKS
Just a quick note (thought late) to thank everyone that helped me out with my g_strncat problem. Of course, now that I have the answer, it's obvious and fell like an idiot that I didn't pick up on that. But when you're in the heat of coding, sometimes these things get missed. thanks again to everyone for the help. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
more on g_strconcat problem
Ok, I've definately nailed the problem down to an issue with the check button in my data entry box. But it still doesn't make sense. consider the following code: idRequired = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(customers, cust_id_req))); g_print(ID Required status: %d\n, idRequired); toggleTest = (gint)idRequired; g_print(ID Required status: %d\n, toggleTest); the above code prints 0 if the checkbox is unchecked and 1 if it is checked. With that in mind, consider the following additional code: sql = g_strconcat(insert into customers (id_req) values(', toggleTest, '),0L); g_print(First sql: %s\n,sql); This code prints the following when the checkbox is unchecked: insert into customers (id_req) values(' so it doesn't even complete the string. That same code crashes with a segfault 11 if I check the checkbox in the dialog. This makes absolutely NO sense what so ever! Please help, this is driving me NUTSO! -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: GTK TreeView Column Header Colors
* Tim Evans ([EMAIL PROTECTED]) wrote: It is possible, just not particularly obvious. What you need to do is call gtk_tree_view_column_set_widget, passing in your own label that is set to display the column title. Once the label is shown and realized, call gtk_widget_get_parent three times, which should move up through a GtkAlignment and a GtkHBox to give you a GtkButton. This button is the column header. Calling gtk_widget_modify_bg on it will change the background colour of the column header. not particularly obvious is a bit of an understatement, but THANK YOU very much for the information. I didn't realize you could do it that way, but it does make sense now that I look at it. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. pgp0.pgp Description: PGP signature
dynmically growing GtkTreeView from MySQL DB?
I'm writing an app that uses MySQL (currently but could use Unix ODBC later) as a backend. On one of the Data Entry screens, I want to show a treeview of the list of people added or are in the DB. I need the list to display quickly and be updated as new people are added. The TreeView set up as a list as opposed to a tree. Additionally, I want the data entry person to be able to double-click on an entry and edit it in the data entry portion of the window, which means I need fast retrieval of that information. How really should I handle this? In particularly the dynamically growing nature of the view? Any and all help is greatly and urgently requested and appreciated. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
data between windows?
I'm writing an application that uses a lot of data entry features with a MySQL (currently) back end. One of my data entry screens also includes a find button. Clicking the find button brings up another small window to type a portion of the client phone number. This in turn will bring up a dialog with a list of matching results (not yet implemented). The person doing the data entry would then select the correct client and have the data appear in the data entry window for updating purposes. My question is, what do you folks think is the best way to accomplish this? I'd like to reuse the same window for find/update as I do for entry/add as that window is often already open. But I need to get data from a dialog that appears later BACK into my data entry window. Thoughts? -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
destroy event
I curious what (or how much) clean up I should do when one of my windows gets a destroy event by clicking the X to close the window. Do I have to free any memory for the window? What about if I re-use the window later in my application? Is it better to just call gtk_widget_show()/gtk_widget_hide() on the window and wait until application quit time? What is the common concensus? -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: unsubscribe
* MALHERBE HUGUES ([EMAIL PROTECTED]) wrote: I wish to unsubscribe from [EMAIL PROTECTED] I have already sent several mails to the above mail with subject unsubscribe. But I am still receiving the posts of this mailing-list. Can anybody tell me how to unsuscribe ? Thank in advance for your answer. [EMAIL PROTECTED] you sent the email to the wrong address. Also, next time, take a look at the full email headers, they often have info on how to unsubscribe from lists. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Getting text out of a GtkTextView
* Seth Remington ([EMAIL PROTECTED]) wrote: You've created two pointers to a GtkTextIter, but they don't point to a valid GtkTextIter structure in memory. Here's what you probably meant to do... void insertCustomer( GtkWidget*customers ) { GtkTextBuffer *specialBuffer; GtkTextView *specialView; GtkTextIter start; GtkTextIter end; gchar* *specialText; specialView = lookup_widget(customers, cust_instructions); specialBuffer = gtk_text_view_get_buffer(specialView); gtk_text_buffer_get_bounds(specialBuffer, start, end); specialText = gtk_text_buffer_get_text(specialBuffer, start, end, FALSE); g_print(Special Text: %s \n,specialText); } The gtk_text_buffer_get_text() routine does *not* work. * Alejandro Garc?a Rodr?guez ([EMAIL PROTECTED]) wrote: Hello, list! The following link tells you how to get the contents of the entire text widget as a string: http://developer.gnome.org/doc/API/2.0/gtk/gtk-question-index.html#id2850623 No it's not. that url doesn't resolve (at least as far as the #id tag goes). Additionally, your suggestion doesn't work either... buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)); gtk_text_buffer_get_bounds (buffer, start, end); text = gtk_text_iter_get_text (start, end); ...use text... g_free (text); In both of these instances I get the following error: Gtk-WARNING **: Invalid text buffer iterator: either the iter ator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created. You must use marks, character numbers, or line numbers to preserve a position ac ross buffer modifications. You can apply tags and insert marks without invalidating your iterators, but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset) will invalidate all outstanding iterators -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
Re: Getting text out of a GtkTextView
* Carl B. Constantine ([EMAIL PROTECTED]) wrote: The following link tells you how to get the contents of the entire text widget as a string: http://developer.gnome.org/doc/API/2.0/gtk/gtk-question-index.html#id2850623 No it's not. that url doesn't resolve (at least as far as the #id tag goes). Additionally, your suggestion doesn't work either... Actually, I *did* find it on that page, way down but clicking the link didn't put me in the correct spot. buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)); gtk_text_buffer_get_bounds (buffer, start, end); text = gtk_text_iter_get_text (start, end); ...use text... g_free (text); In both of these instances I get the following error: Never mind, I found my problem. I had declared start and end as *GtkTextIter instead of just GtkTextIter. That pointer makes all the difference in the world ;-) -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
Getting text out of a GtkTextView
I have a GtkTextView in one of my application windows; mainly because a GtkEntry is only single width and I want text wrapping and so forth. Anyway, I'm trying to get the text from the GtkTextView but only end up with 'null' when I try to print it. Here is a code snipped: void insertCustomer( GtkWidget *customers ) { GtkTextBuffer *specialBuffer; GtkTextView *specialView; GtkTextIter *start; GtkTextIter *end; gchar* *specialText; specialView = lookup_widget(customers, cust_instructions); specialBuffer = gtk_text_view_get_buffer(specialView); gtk_text_buffer_get_bounds(specialBuffer, start, end); specialText = gtk_text_buffer_get_text(specialBuffer, start, end, FALSE); g_print(Special Text: %s \n,specialText); } I actually want to be able to insert that text into a database field but it's not working. Any help is appreciated. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
Re: TreeView speedup
* Andrew E. Makeev ([EMAIL PROTECTED]) wrote: Good day, I would to ask if someone got TreeView widget filling in speed really improved? On our side we made 2 improvements: 1. Added function in GTK that fills TreeModel row with values stored in GList. Test case: 1 rows with 4 string, 4 int, 4 double, 4 bool columns. Model was filled with values in 3-4 x times faster. (1 sec against 4 sec). 2. Wrote our own simple TextRenderer with cached Pango::Layout where only text could be changed. Test case: 1 rows with 4 string, 4 int, 4 double, 4 bool columns. TreeView was filled with values in 3-4 x times faster. (8-9 sec against 30 sec). Any other suggestions would be welcome. I'm just learning the widget myself so I don't have any suggestions for you. But I am interested in your findings if you care to share them with the rest of us ;-) I'm using several TreeViews in my application for displaying of status and database information. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
Re: A quick question:what ide should I use to program in Linux with gtk?
* jiangyi178 ([EMAIL PROTECTED]) wrote: Thanks a lot! So KDevelop or Kylix are not the recommended way to go, right? Not for GTK/Gnome programming, no. KDevelop and Kylix are focused, and really specificically for, Qt programming. Anjuta can be used for Qt Development as well, but has a bit of a bug/conflict with the Qt installation that is currently being worked out. For GTK/Gnome development, Anjuta is a good choice if you want a full GUI environment like CodeWarrior on the Mac or Windows. If you're not that kind of person, Emacs or Vim are also excellent choices. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
Assert messages.
I'm getting a couple of assert messages in my app kind of all-of-a-sudden as of late. I'm curious what they really mean and how can I track them down. Here are the asserts I'm getting: (dispatcher:1692): Gtk-CRITICAL **: file gtkwidget.c: line 4814 (gtk_widget_set_size_request): assertion `height = -1' failed (dispatcher:1692): Gtk-WARNING **: gtkwidget.c:2653: widget `GtkCheckButton' has no activatable signal toggled without arguments (dispatcher:1692): Gtk-WARNING **: gtkwidget.c:2653: widget `GtkCheckButton' has no activatable signal toggled without arguments The last two seem to relate to a new window I've been working on that includes two checkboxes in it. I've set up signals for these two buttons (using glade) so there is a signal handler specified. I only have code written for one of them at present (testing). The first assert I get from time to time on a couple different windows. They don't seem to be consistant. But I've hard-coded the size of the windows (that is to say I've specified they are not resizable in Glade and I've set a specific size for them in Glade as well). Any ideas/help is greatly appreciated. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
Re: Assert messages.
* Sven Neumann ([EMAIL PROTECTED]) wrote: Hi, Carl B. Constantine [EMAIL PROTECTED] writes: I'm getting a couple of assert messages in my app kind of all-of-a-sudden as of late. I'm curious what they really mean and how can I track them down. you can force warnings to become fatal by passing --g-fatal-warnings to your GTK+ application. The application will then crash on the first warning message allowing you to examine the cause of the warning in a debugger. That may quit the program, but doesn't really give me any details as to where the program gave those warnings or why or still, what they mean. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
found one warning
As a follow up to my previous message, I *did* find where one of my warning messages was being generated. It's on this line: gtk_widget_add_accelerator (company_checkbutton, toggled, accel_group, GDK_c, GDK_MOD1_MASK, GTK_ACCEL_VISIBLE); As soon as that line is executed, I get the following warning message: (dispatcher:2906): Gtk-WARNING **: gtkwidget.c:2653: widget `GtkCheckButton' has no activatable signal toggled without arguments The question still remains as to *why* I get this message. I've set up a toggled signal for that checkbutton and attached a handler to it (on_button_name_toggled) so I'm not sure why I get this message. I've set up regular buttons with key accelerators with clicked signals and do not get any warnings like this. Any ideas/help is appreciated. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
More on key accelerators
Ok, I just made a couple more changes in my Glade file. It seems there may have been two accelerators defined. In my .glade file I had some of the labels of the checkbuttons and other buttons prefixed with an underscore (_) character so that the following letter would have an underscore in it. GTK must treat this as automatically defining alt-key as an accelerator and I don't need to define one myself for it to work. I eliminated the extra accelerator and all is well. No more warnings. I am a bit confused as to why this is, so any insight is helpful. But the long and short of it is I did indeed get it to work the way I want. Thanks. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
Re: Where is product support of www.mcp.com
* edward hage ([EMAIL PROTECTED]) wrote: Hwllo, recently bought the Dutch translation of the book 'Dev. Linux app. with GTK+ and GDK' from Eric Harlow. In the book is a reference to http://www.mcp.com/product_support to be able to download the example programs. That is very necessary because (probably in the translation) the source code written down has a lot of errors. That book is published by the New Rider's branch of mcp. Try, www.newriders.com and search their book base for information. WARNING: the NR web site isn't the best UI design in the world. It's awkward to find some things you need. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
Re: Draw on the root window?
* [rSu]G-LiTe ([EMAIL PROTECTED]) wrote: Hi all, I'm trying to draw several widgets on the root window. I've been trying to get this to work for a while now. Someone pointed me (and I seem to end up everytime) at this thread: http://mail.gnome.org/archives/gtk-list/2000-August/msg00227.html However that seems to be gtk+ 1.x related. I've tried to modify the code to work with gtk+ 2.x, but all it seems to do right now is draw all the widgets in a seperate window (managed seperately by the window manager and they won't even accept input properly) Have you checked out the Wheelbarrow example in the examples directory? I think it *might* answer some of your questions. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
Re: CellRenderText properties question.
* Diego Zuccato ([EMAIL PROTECTED]) wrote: Carl B. Constantine wrote: Thanks for the reply. That confirms what I suspected, but IMHO very bad design as it creates extra overhead for memory and storage in the TreeModel (ListStore in this case) instead of being able to determine the property programatically. What if I have a preference setting where the user change pick a color so it's not just red or blue it's between blue and purple? You can have multiple views on the same model, and tha'ts the real power of the new widgets over GtkCList and GtkCTree (that, OTOH, are much faster). And as Owen said (and I didn't know!) you can have a callback to calculate on the fly the properties. Indeed. I'll try this a little later today, but if I have the extra data in the model and currently that column has a black setting for each cell, and then I set a cell in that column to red, will the visible text then automatically change color for that cell? As you probably already understood, it's not an hide it matter. If you follow the easy way, then you store different attributes in different MODEL columns. But these columns get ALL referenced when you add a new column to the VIEW. This way you could have different attribute sets for different views. again, will try some test code in a couple hours to test this and see what happens, but any pointers you can give would be helpful. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
properties for GtkCellRenderText -- Whoohoo it works!
This message ties into an earlier message where I stated I would try out some code to see if I could change the attributes of text in my GtkListStore. It works quite nicely. Here's what happens: 1) user selects an item in my GtkTreeView (note: in this case just a single column view). 2) User clicks a button and the text at that selection turns red! Here's what I did: 1) I have an enumerated type for the storage model enum { DATA_COLUMN, MODEL_ATTRIBUTES, N_COLUMNS } 2) Created a callback for the the button press: void on_button_clicked (GtkButton *button, gpointer *userData) { do_color_test(gtk_widget_get_toplevel(button)); } 3) now, in the do_color_test routine, I need to do several things: - get the view - get the model - get the current selection - return the proper iter for the selection - set the attribute to red for the current selection void do_color_test (GtkWidget *theWindow) { GtkWidget *theView = NULL; GtkListStore *theListStore = NULL; GtkTreeIter theIter; GtkTreeModel *theModel = NULL; GtkTreeSelection *currentSelection; theView = lookup_widget(theWindow, atreeview); theModel = gtk_tree_view_get_model(theView); if (GTK_IS_LIST_STORE (theModel)) { theListStore = GTK_LIST_STORE (theModel); g_print(theModel is a ListStore\n); } /* get the current selection from theView */ currentSelection = gtk_tree_view_get_selection(theView); /* now that we have a selection, get the exact location in theIter */ if (!gtk_tree_selection_get_selected(currentSelection, theListStore, theIter)) { g_print(no current selection!!\n); } /* set the color for that row to red */ gtk_list_store_set(theListStore, theIter, MODEL_ATTRIBUTES, red, -1); } There are probably more efficient methods of doing this. For example, do I need to call gtk_tree_view_get_selection at all? Some obvious debug code can also be elminated but that's the jist of it. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
CellRenderText properties question.
The Gnome 2.0 porting docs contain the following information on the GtkCellRender widget (under new widgets in the docs): * Cell renderer properties can be set per-renderer or per-cell (based on data in the model). So for example, the text renderer has a foreground property for the foreground color. You could set the foreground color globally for an entire column, or you could have the foreground property change per-cell according to data in the model. * For a given cell renderer, multiple fields in the model can affect it. For example, if your mail client model has a boolean field indicating unread message, and a string field indicating subject, you can set the bold property of the cell from the unread flag and the text property of the cell from the subject. Looking at the API docs for GtkCellRender and GtkCellRenderText, I see the following description under gtk_cell_renderer_text_new (): ...Also, with GtkTreeViewColumn, you can bind a property to a value in a GtkTreeModel. For example, you can bind the text property on the cell renderer to a string value in the model, thus rendering a different string in each row of the GtkTreeView. However, I can't really find any code examples of how to do anything suggested in these docs. For example, I have a GtkTextView that only has a single column in it. When I click a button in my window, I want to find out the current selection in that TreeView and set it's text to Red or Bold or something. I can't seem to find anything that shows how to get the exact cell and then change its attributes. I can do it globably for a column (and have for testing) but not on a single cell. These docs seem to imply that I need some further data in my cell model to apply an attribute to. So, it seems like I have to have an extra invisible column in my model that holds text attributes, update the column text with a new string (say to red from black in order for the text in the visible column to have the attribute change. This seems very confusing to me. The docs say based on data in the model but it's not clear what that means, if it's actual attributes stored in the model, or just change based on a programmatic condition (col 1 is true so set text to bold). How can I change attributes on a single cell without having extra data in my model or do I really need the extra data in my model? I'm sure I'm missing something obvious but the docs are confusing. Also, storing extra attribute data in my ListStore adds memory overhead. Additionally, I see this description for gtk_tree_view_column_cell_set_cell_data: Sets the cell renderer based on the tree_model and iter. That is, for every attribute mapping in tree_column, it will get a value from the set column on the iter, and use that value to set the attribute on the cell renderer. I'm sorry but that's not very clear, and in fact it's extremely confusing. Maybe RedHat could hire me as a technical writer (I have several years experience at this and worked for Metrowerks as a professional technical writer). Any help is greatly appreciated. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
Re: CellRenderText properties question.
* Diego Zuccato ([EMAIL PROTECTED]) wrote: Carl B. Constantine wrote: ...Also, with GtkTreeViewColumn, you can bind a property to a value in a GtkTreeModel. For example, you can bind the text property on the cell renderer to a string value in the model, thus rendering a different string in each row of the GtkTreeView. When you add a column to your view, you put ..., text, COL, ... to show the text from model column COL in the currently being added column. The same is with background and foreground attributes, and the pointed columns must contain a colour name (as string: red, blue, etc). Thanks for the reply. That confirms what I suspected, but IMHO very bad design as it creates extra overhead for memory and storage in the TreeModel (ListStore in this case) instead of being able to determine the property programatically. What if I have a preference setting where the user change pick a color so it's not just red or blue it's between blue and purple? However, I can't really find any code examples of how to do anything suggested in these docs. For example, I have a GtkTextView that only has a single column in it. When I click a button in my window, I want to find out the current selection in that TreeView and set it's text to Red or Bold or something. I can't seem to find anything that shows how to get the exact cell and then change its attributes. I can do it globably for a column (and have for testing) but not on a single cell. I posted an example a couple of days ago. Just a code snippet from one of my projects, but should give you the idea. You have to add a column for every attribute. or add multiple attributes to the column with gtk_tree_view_column_add_attribute(). But this means I have to add a column to the model and then hide it after it's appended to the view right? ... If only it could be possible to map values to attributes (1=red, 2=blue and so on...) or have a hex value that can then be used for the color. Then a user can use the color selector to pick a color for certain cells. However, I find that interface rather awkward to use in that instance, again because it can't be determined programatically or you have to change the column the cell looks at on the fly which is awkward. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
Re: CellRenderText properties question.
* Sven Neumann ([EMAIL PROTECTED]) wrote: the API reference is not exactly the place where you'd look for code examples. The gtk-demo as found in the demos directory of the GTK+ source tree seems like a good place to look for such examples. I didn't look there, I looked at the various examples that come with GTK. of course you need the extra data. You want to display additional information, where should it come from if not from the model? Of course you can write your own custom cell renderer which calculcates the information for each cell but unless you want to do that, you need an extra column in your model. Please note that the model columns don't necessarily correspond to the view columns. It thus doesn't make any sense to speak of an invisible column in a model. Yes, I suppose that's correct. I'm a bit confused as you create the column with gtk_tree_view_column_new (or gtk_tree_view_column_new_with_attributes) and then call gtk_tree_view_append_column to append it to the tree view, at least for the view. However, I gather I would call gtk_list_store_new with the extra column (or columns) so I have a place in the store to save my data, but the view doesn't show it. This makes sense now that you point that out. I was doing a 1:1 mapping between the TreeModel (ListStore in my case) and the TreeView but it doesn't have to be such. Thanks for the help! -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
cell renderers question.
I'm writting a program (screen shots posted here before) that uses many GtkTreeView's in a window. I'm using them as a list, so I have several ListStore's (one for each view). Some views have many columns, a couple have 2, and one has 1 column. I call gtk_tree_view_append_column for each column in each view. Before I do that, I make a call to gtk_cell_renderer_text_new(). I'm curious if I have to create a new renderer for each column (ie: call this function before I append a column each time) or if I can just call it once for each view? Finally, if I have a treeview with several columns (say 4, numbered 1 to 4 for simplicity sake) and it looks like this: 1 2 3 4 -- headings d d d d where the 'd' is data, I want to be able to do the following: 1) find out exactly which cell the user clicked in (even though the whole row is highlighted). What signals need to be involved here? 2) if a user right-clicks in a column, pop-up a menu. Is this even possible? If so, what signals again? Thanks. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
blinking cursor/focus problems?
I set up a bunch of widgets in a window. some are GtkTreeView, some are GtkEntry widgets, one is a menu, one is a button, one is a GtkTextView. For the GtkEntry and GtkTextView's, I have the cursor/text visible and editable selected in Glade. All widgets have can focus set. Now, when I run my application, I can click around, but no blinking cursor in the GtkEntry or GtkTextView (though I can type text) and selecting rows in the GtkTreeView's select in a grey state (I can't really think of a word, maybe inactive but selected, or no focus, but selected). Now, if I right click in the GtkTextView or click my menu, suddenly the cursor can flash, and my row selections appear in the proper highlight color. Why is this? What am I forgetting to do? I tried to set one of the widgets to has focus in Glade, but that didn't change anything. Someone know what I'm doing wrong? -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
Re: dealing with column data
* Evan Lavelle ([EMAIL PROTECTED]) wrote: Carl B. Constantine wrote: I'm writing an app that uses GtkTreeView widget to display data. However. for two of these GtkTreeViews, the data isn't really row based, but column based. It's more like a spread sheet and I don't think GTK has anything akin to what I want. Essentially, I want to be able to select an individual cell in a table. Get the data, right-click to popup a menu and perform some function. GtkTreeView isn't geared for this. I don't want to select an entire row. Does anyone have any hints on how to accomplish this? Have you looked at http://gtkextra.sourceforge.net/? They've got a spreadsheet-like widget that may do the job. I haven't tried it. it's interesting. That looks close, but it might be overboard for my needs. I really want something like GtkTreeView but for matrix like data, not really a spread sheet per se. I just need it to display data in a tabular form. I'll take a look at this widget and see if it can be used for my needs though. I really think there needs to be some more docs. The Gtk 2.0 tutorial is missing docs on several widgets. it would be nice to get these filled in. Just my $0.02 worth. I sympathise. What would be really useful would be a distributed document it as you find it system. If you find something that's not in the docs, then you write a few lines and submit it, and future users could browse the database and wouldn't have to waste time finding out how something really works. This would have saved me hours. Well, I think we can do this anyway ;-) I plan on writing some docs to fill the Tutorial section for GtkTreeView though I do have some more questions about it first which are not in the reference docs, at least not clear in my head ;-) So I'll be asking the list for more help in that area ;-) -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
dealing with column data
I'm writing an app that uses GtkTreeView widget to display data. However. for two of these GtkTreeViews, the data isn't really row based, but column based. It's more like a spread sheet and I don't think GTK has anything akin to what I want. Essentially, I want to be able to select an individual cell in a table. Get the data, right-click to popup a menu and perform some function. GtkTreeView isn't geared for this. I don't want to select an entire row. Does anyone have any hints on how to accomplish this? On another note, I've been pooring over the documentation for GtkTreeView in particular but other widgets as well and it astounds me (as a veteran technical writer for Metrowerks a while back) the lack of documentation. I don't mean/want to be harsh, but how can the developers of Gtk+ expect developers to write apps when there is such a lack of docs on many of the widget classes and methods? Let me give a practical example from the GtkTreeView class and one other widget: http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeViewColumn.html The description for GtkTreeView column is incomplete. It says: The GtkTreeViewColumn object is a visible column in a GtkTreeView widget. It determines the geometry, type and that's as far as it gets. http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeView.html#GtkTreeView-select-cursor-row here, arg1 and returns are blank. What are they supposed to be? When should this be called? I really think there needs to be some more docs. The Gtk 2.0 tutorial is missing docs on several widgets. it would be nice to get these filled in. Just my $0.02 worth. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom pgp0.pgp Description: PGP signature
gtk testing directory
In the gtk download, there is a testing directory which contains code to test various widgets. In this directory are two files, Makefile.am and Makefile.in. I've posted this question once before and received no reply that answered the question. There is no autogen.sh in this directory or in the entire source distribution. So my question then is how do I use these two file to make the code in the testing directory (looks like individiual applications). The Makefile.in says it was generated from the Makefile.am. But there is no regular make file, no configure, no nothing. Any help is appreciated. Also, I'm sure I saw somewhere a gtktest app that tested all the widgets. But I can't seem to find it. It's not part of the source download. Does someone have a link? thanks. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom msg12461/pgp0.pgp Description: PGP signature
Re: GtkListStore usage
* pclouds ([EMAIL PROTECTED]) wrote: Hello I would like to use GtkListStore in this way: - Create GtkListStore with 1 column (G_TYPE_POINTER) - Register two functions get_value and set_value. When gtk_list_store_{get,set}_value is called, my {get,set}_value will be called, returning a value from the object in column 1 (or generate a value from the object), and set a value in the object, respectively. Registering may be connecting to signal or setting a function pointer in GtkListStore struct, .. * Or we can create GtkListStore with n+1 columns, and let GtkListStore check data types instead of {get,set}_value. - {get,set}_value contain a lot of switches to control each column data. Is there a way to do this without modifying GtkListStore or implementing a new GtkTreeModel? I don't have an answer for you, but I need similar functionality in a program I'm writing. Plus I need it for multi-column lists as well. Any info you find out would be of use to me. Similarly, if I find anything of use, I'll report it to the list for you. BTW, Gtk(2.0) uses gtktreedatalist to store a row. It would be better if GtkListStore allows developer to use another type instead of gtktreedatalist when they want. Yes, especially if you want to work on data by column instead of by row. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom msg12434/pgp0.pgp Description: PGP signature
text entry growing (Long)
name=justifyGTK_JUSTIFY_LEFT/property property name=wrapFalse/property property name=selectableFalse/property property name=xalign0.5/property property name=yalign0.5/property property name=xpad0/property property name=ypad0/property /widget packing property name=typelabel_item/property /packing /child /widget packing property name=left_attach2/property property name=right_attach11/property property name=top_attach4/property property name=bottom_attach10/property property name=y_optionsfill/property /packing /child /widget packing property name=padding0/property property name=expandTrue/property property name=fillTrue/property /packing /child child widget class=GtkStatusbar id=dispatchStats property name=visibleTrue/property property name=has_resize_gripTrue/property /widget packing property name=padding0/property property name=expandFalse/property property name=fillFalse/property /packing /child /widget /child /widget /glade-interface -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom msg12351/pgp0.pgp Description: PGP signature
selecting/updating a single cell in GtkTreeView
I have several GtkTreeViews in a window in my application. They are set up to be like a ListView as opposed to a real tree. What I want to know is, is it possible for the user to click on a single cell in the tree/list view to perform some action as opposed to an entire row? Also, is it possible to update just a single cell in the view as opposed to an entire row? Thanks in advance. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom msg12285/pgp0.pgp Description: PGP signature
extra spaces in layout question
I have a window I'm building in Glade 2 where I've done most of the widget placement in it. However, there are a few spots where there is nothing, and so appear as gray squares in Glade. Is this OK or do I *have* to put something in each potential container location? is there a spacer widget that all it does is take up space? For a look at what I mean, see the following URL: http://www.duckwing.ca/screenshots/2003_02_04_205632_shot.jpg Thanks for any help -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom msg12289/pgp0.pgp Description: PGP signature
Re: Reference Tutorial for GTK+ GUI to MySQL Database
* Joel Tome ([EMAIL PROTECTED]) wrote: Please suggest website references or tutorials on how to connect MySQL database to forms created in GTK+ You might want to see if you can pick up a copy of the New Riders' book MySQL: Building User Interfaces by Matthew Stucky. ISBN: 0-7357-1049-X I'm sure you can find a copy on Amazon or BN. It covers using Glade/GTK+ to build MySQL applications. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom msg12172/pgp0.pgp Description: PGP signature
Re: success with GtkTreeView
* Scott Andrew Baillie ([EMAIL PROTECTED]) wrote: Hi Carl, I had the same problem with the red foreground that you did. I did get it to work with a different method. See following code : [snip] Thanks for the code. I'll try it out. However, the big question is why does this work over the method given in the GTK+ 2.0 API Reference? It's not a *big* deal for me, but if a method shown of changing the text attributes of a cell or heading cell doesn't work, the docs need to be changed. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom msg11933/pgp0.pgp Description: PGP signature
Problems building gnome 2 project with Anjuta
I'm getting some weird compile errors while trying to build a project with Anjuta. It's just a quick test project for playing with GtkTreeView, but I'm getting errors in main.c. The original project was created in Anjuta. I then used Glade 1.1.3 to generate all the files (after I deleted the main.c Anjuta created). I then modified main.c with the code I'm working on. However, when building the project, I get the following errors: /home/carl/Projects/experimenting/src/main.c:49: undefined reference to `create_window1' /home/carl/Projects/experimenting/src/main.c:63: undefined reference to `lookup_widget' This doesn't make sense. create_window1 is in interface.c and lookup_widget is in support.c. interface.h and support.h are included in main.c so why it can't find them is completely strange. I've even shelled out to the console and re-issued configure and make commands to see if that would help. it doesn't. If anyone is interested, the full compressed project and source can be found at: http://www.duckwing.ca/programming/experimenting.tgz (I verified the link works this time ;-) Can anyone tell me what is going on and why this doesn't work? PS: The ENABLE_NLS code that is commented out at the top of main.c also causes problems (which is why it is commented out) but it was generated by Glade so I'm not sure what's up with that. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom msg11886/pgp0.pgp Description: PGP signature
success with GtkTreeView
Ok, you can ignore my previous message. I did get it work by creating another project (gtk2 only) and copy/paste the relevant code bits in. The good news is I used Glade to create a GtkTreeView object. I then grabbed a pointer to that object using lookup_widget, created a GtkListStore and set the GtkTreeView up to use that list store. I then started creating columns and adding them as showin in Tree and List Widget in the Gtk+ 2.0 API docs on the website, and also some help from some of you (special thanks to Harring Figueirdo on the Glade-Users list -- hmm, Figueirdo, is that Portuguese?) However, one of the things I wanted to try was to set the heading text to be red, like shown in the API reference, but for some reason it doesn't work. See for yourself at: http://www.duckwing.ca/screenshots/gtktreeview.jpg Notice the code behind window1 shows creating the cell renderer and setting the text to red using g_object_set: renderer = gtk_cell_renderer_text_new(); g_object_set( G_OBJECT(renderer), foreground, red, NULL); but when I create the column and append it to the view, the text is not red like I *thought* it should be: column = gtk_tree_view_column_new_with_attributes(Shift, renderer, text, SHIFT_COLUMN, NULL); gtk_tree_view_append_column(GTK_TREE_VIEW(theTreeView), column); This is pretty much straight from the API Reference docs. Any ideas as to why this is happening? Do the headings for the columns maybe not allow this? -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: difference between gtk_signal_connect and g_signal_connect
* ellf ([EMAIL PROTECTED]) wrote: what's the difference with g_signal_connect ? In moving from GTK-1.2 to GTK-2.0, the GTK+ Signal API functions were deprecated (and in some cases removed, I believe) in favor of their counterparts in the GSignal system. In addtion to what ellf said, I note this in the GTK-2.0 API Reference on gtk_signal_connect: Warning gtk_signal_connect is deprecated and should not be used in newly-written code. Use g_signal_connect() instead. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom msg11873/pgp0.pgp Description: PGP signature
controlling container sizes
I'm laying out a window in Glade and have it divided up into several sections. However, I can't control the size (width, height) of a specific section. I could use the fixed layout widget, but all the docs I've read say not to use it except on specific needs. Let me show you some examples. http://www.duckwing.ca/screeshots/shot1.jpg http://www.duckiwng.ca/screenshots/shot1-widgets.jpg The first link is the window, the second shows the widget tree for that window. I've used vertical and horizontal separator widgets in the vbox and hbox. It splits the window in exactly half (used the middle item). It would be nice if I could make the left side smaller than the right without doing a whole lot of extra containers and such. In another window, I've used a table container and tried to space things out. However, depending on what widget I put in a container dictates the size of the rest of the row/column for other widgets. so If I put a label widget in first, the column shrinks. Then I put a treeview below it and the column stays shrunk. I can use the treeview properties to make it fill to full width and height for that cell but it would be nice if I could have greater control over that. Any suggestions? -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom msg11875/pgp0.pgp Description: PGP signature
Re: still on treeview
* Ottavio Campana ([EMAIL PROTECTED]) wrote: I've created the treeview with all the columns I need. Now I need to know how to add rows to it e how to remove them. The tutorial has got just an empty page for it That's because that widget (and others) are in the section Undocumented Widgets and need authors to contribute ;-) Do you have got an example to understand how to do it? No, but I'm interested in what you come up with as I'll be using that widget and others to create a table for data I retrieve from a database, what the old gtkCList widget was for. -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom msg11834/pgp0.pgp Description: PGP signature
Newbie Makefile.in Makefile.am question
John Miskinis' note about the testgtk application made me go searching. My RedHat 8 box has the actual app, but not the source. My Debian system includes the source for gtk-1.2, but not for 2.0. So I downloaded gtk2 from the web site and see the testgtk app (or something like it) in the demos directory. One problem, there is no real makefile. There is a Makefile.am and a Makefile.in. The Makefile.in says it was generated from the Makefile.am. There is no configure script, nothing. So the question is, how do I build just the demo without compiling up all of gtk2 which is already installed for me? What nuance am I missing in all this? I've tried running aclocal, automake, autoconf to no avail (they all want a configure.in file). So what do I do? -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Newbie Makefile.in Makefile.am question
* Mark Jones ([EMAIL PROTECTED]) wrote: See if there is a autogen.sh script. If so, run it and that should take care of all of that. nope, already new about that, there isn't one of those. In fact, there isn't one in the entire download. Any other ideas? -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Making a gtktreeview like gtkClist
The GtkCList is now depreciated in gtk2. GtkTreeView is supposed to take its place. However, all the examples I've seen so far do NOT address HOW to make a Tree into a List (with column Lables and the whole bit). Some of the docs I've looked at in the gtk2 reference hint at it using , but no real solid example that runs as-is. Also, how does one convert existing gtk 1.2 CList into a gtk 2.x TreeView? -- .''`. Carl B. Constantine : :' : [EMAIL PROTECTED] `. `'GnuPG: 135F FC30 7A02 B0EB 61DB 34E3 3AF1 DC6C 9F7A 3FF8 `- Debian GNU/Linux -- The power of freedom ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: depreciated classes in GTK+2
* Dave Malcolm ([EMAIL PROTECTED]) wrote: In the specific example of GtkCList, you should use GtkTreeView. Though hopefully you figured that out (see the Tree and List Widget Overview in the GTK+ reference manual for more information). Yes, I did actually figure out that I should at least look at that class, but I haven't done so yet. To me a tree view is not a list. It's a tree, a hierarchy and may include a tree control. If you spot any cases where something is deprecated but where the replacement is not cited, perhaps you should file that as a bug in bugzilla? Hopefully the API notes will get fixed that way. I'll try to do that sometime this week. I've done a bit of porting from GTK 1 to 2 and may be able to help if you encounter further problems. Thank you. I'd appreciate the help. -- __ _ Carl B. Constantine / / (_)__ __ __ [EMAIL PROTECTED] / /__/ / _ \/ // /\ \/ / (2.4.18) http://www.duckwing.ca //_/_//_/\_ _/ /_/\_\ Debian 3.0 PGP key available on request Microsoft is not the Borg. The Borg have better tech support. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list