Re: 3000 toggle buttons in a table?
On Tue, Apr 04, 2006 at 10:55:08AM +0530, Sailaxmi korada wrote: Perhaps, my application requires 16 toggle buttons to be placed in each row, that represent a hex value. So I need not write 3000 callbacks for them, instead with one call back I can manage to calculate the hex value, based on the position of toggle button. Tree view doesn't fit my requirement. The treeview example I sent does exactly that -- the toggle buttons represents bits in some integers (64bit in that case). So why it does not fit? Yeti -- That's enough. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Update text label
On Mon, Apr 03, 2006 at 08:00:57PM -0700, 3saul wrote: I'm very very new to GTK programming. I've created a button which get's it's label from a variable. The text in the variable will change and I need to find out how to 'refresh' the label on the button. gtk_button_set_label() Please at least skim the API reference first, this should be easy to find. Yeti -- That's enough. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
RE: 3000 toggle buttons in a table?
That was great David, it was doing the task in fraction of seconds... Why I said Tree view doesn't fit my requirement was, in a row I've to display label, 15 toggle buttons, text entry... Like this I've to fill the widgets in 178 rows. Displaying label is fine with List store... But how can I manage with text entry?? Thanks Laxmi -Original Message- From: David Necas (Yeti) [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 04, 2006 12:33 PM To: Sailaxmi korada Cc: gtk-app-devel-list@gnome.org Subject: Re: 3000 toggle buttons in a table? On Tue, Apr 04, 2006 at 10:55:08AM +0530, Sailaxmi korada wrote: Perhaps, my application requires 16 toggle buttons to be placed in each row, that represent a hex value. So I need not write 3000 callbacks for them, instead with one call back I can manage to calculate the hex value, based on the position of toggle button. Tree view doesn't fit my requirement. The treeview example I sent does exactly that -- the toggle buttons represents bits in some integers (64bit in that case). So why it does not fit? Yeti -- That's enough. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: 3000 toggle buttons in a table?
On Tue, Apr 04, 2006 at 01:47:10PM +0530, Sailaxmi korada wrote: Why I said Tree view doesn't fit my requirement was, in a row I've to display label, 15 toggle buttons, text entry... Like this I've to fill the widgets in 178 rows. Displaying label is fine with List store... But how can I manage with text entry?? What about an editable column? If it has to look exactly like a classic text entry, then this is a problem, but if any editable text field will do, treeview can do that easily. Yeti -- That's enough. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
GtkTreeView Bug
Hello list. Ive downloaded the latest -all needed- gtk and still the same problem. When there are text editable cells and one is being edited, if I click in another editable cell, the first doesn't stop the edition. Instead I have two editable cells being edited, and it some times ends by segfault... It happens with the version of my debian stable and it happens with the latest release. I don't think my code is wrong, i checked other programs and it's the same. Saludos, Juan Pablo. PD: This mail should be in other list? May be some one could forward it there? Thanks. __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: text tag table
ashley maher wrote: G'day, In the references to the text widget of the GTK API it says to refer to the gtk-demo for examples. These examples are very good. Using the Multiple Views example I can save a gtk text buffer to, and retrieve, from a text file. I can change the look and feel using tags. All modified from the example code. However I can't find anywhere example code to show how to maintain persistence between running the programme. How do you save a tag table to a file so after you formatted a block of text this formatting is available next time? Or how is this done. Googling has not got me very far. Is there such code? I've not found it in the gtk-demo code, or anywhere else. GtkTextView does not have that feature built-in. You'll need to write the code to do that yourself, going through the textview, detecting which tags it has, and writing this and the attributes of the tags. -- pain, n.: One thing, at least it proves that you're alive! Eduardo M KALINOWSKI [EMAIL PROTECTED] http://move.to/hpkb ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Update text label
Thanks a lot. However it's for a menu not a button ...here is some code menubar2 = gtk_menu_bar_new (); gtk_widget_show (menubar2); gtk_box_pack_start (GTK_BOX (hbox2), menubar2, FALSE, FALSE, 0); time_date1 = gtk_menu_item_new_with_mnemonic (MENU); gtk_widget_show (time_date1); gtk_container_add (GTK_CONTAINER (menubar2), time_date1); This line: time_date1 = gtk_menu_item_new_with_mnemonic (MENU); I've changed to time_date1 = gtk_menu_item_new_with_mnemonic (x); this works, the menu button gets the string stored in x..however the string stored in x changes (with the current time). I'm very new to programming..especially GTK so I'm probably just doing silly things. -- View this message in context: http://www.nabble.com/Update-text-label-t1390768.html#a3743033 Sent from the Gtk+ - Apps Dev forum at Nabble.com. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Update text label
On Tue, Apr 04, 2006 at 05:01:06AM -0700, 3saul wrote: Thanks a lot. However it's for a menu not a button... I'm sorry (there is nothing like menu button, I chose the wrong half of the term). This line: time_date1 = gtk_menu_item_new_with_mnemonic (MENU); I've changed to time_date1 = gtk_menu_item_new_with_mnemonic (x); this works, the menu button gets the string stored in x..however the string stored in x changes (with the current time). GtkWidget *label; label = GTK_BIN(menu_item)-child; gtk_label_set_text_with_mnemonic(GTK_LABEL(label), x); Yeti -- That's enough. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Segmentation Fault
Hello everyone, I have written a program using GTK which executes some shellscripts in the background...After the shellscripts complete executing, a window is displayed showing the completion details At this time segmentation fault occurs. Is there anyway to trace the exact cause of the segmentation fault... I tried gdb, but it didn't show any error while executing the code..The segmentation fault occured when the execution went to loop after displaying the final window and waiting for user's interaction... How can i find the reason for the segmentation fault? Thanking you in advance... Sandeep Regards - New Yahoo! Messenger with Voice. Call regular phones from your PC and save big. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
show/hide widget within other widget
I have a main.c file like this: int main(int argc, char **argv) { GnomeProgram *program; program = gnome_program_init(bla, bla, ..) create_mainwindow(); gtk_main(); return 0; } where create_mainwindow reads like following: void create_mainwindow (void) { GnomeApp *window; window = create_ui(); GtkWidget *calendar; calendar = create_calendar(); gnome_app_set_contents(window, GTK_WIDGET(calendar)); gtk_widget_show_all(GTK_WIDGET(window)); } as you may guess, create_ui just sets up the window with menu and tool bars, etc. create_calendar creates a gtkcalendar. Now in my create_ui function I have a menu option for enabling/disabling the calendar. as the calendar is enabled by default, how should I now disable (maybe hide) it? what's the most elegant solution for this problem? I also think about the possibility to choose from a variety of widgets to be displayed inside the contents window. and in my eyes it doesn't make sense to first create all those widgets and then manually show/hide them as needed (suppose I just want to have one widget at a time). I'm welcome for any suggestions, cheers, Andreas ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Segmentation Fault
Are you dealing with threads? Maybe it's a problem of concurrency. Could you be more precise? Best regards! -- Forwarded message -- From: Sandeep KS [EMAIL PROTECTED] Date: 04-abr-2006 19:31 Subject: Segmentation Fault To: Gtk gtk-app-devel-list@gnome.org Hello everyone, I have written a program using GTK which executes some shellscripts in the background...After the shellscripts complete executing, a window is displayed showing the completion details At this time segmentation fault occurs. Is there anyway to trace the exact cause of the segmentation fault... I tried gdb, but it didn't show any error while executing the code..The segmentation fault occured when the execution went to loop after displaying the final window and waiting for user's interaction... How can i find the reason for the segmentation fault? Thanking you in advance... Sandeep Regards - New Yahoo! Messenger with Voice. Call regular phones from your PC and save big. ___ 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
show/hide widget within other widget
If you expected the user works with the calendar I think you can create it at start up. If using the calendar is not usual, maybe you could delay the creation and when the user enables it, create the calendar and place it in your window. Creating all widgets at start up is faster for you.. but if you planned to show only one at a time, it is quite inefficient. -- Forwarded message -- From: Andreas Kotowicz [EMAIL PROTECTED] Date: 04-abr-2006 19:36 Subject: show/hide widget within other widget To: gtk-app-devel-list@gnome.org I have a main.c file like this: int main(int argc, char **argv) { GnomeProgram *program; program = gnome_program_init(bla, bla, ..) create_mainwindow(); gtk_main(); return 0; } where create_mainwindow reads like following: void create_mainwindow (void) { GnomeApp *window; window = create_ui(); GtkWidget *calendar; calendar = create_calendar(); gnome_app_set_contents(window, GTK_WIDGET(calendar)); gtk_widget_show_all(GTK_WIDGET(window)); } as you may guess, create_ui just sets up the window with menu and tool bars, etc. create_calendar creates a gtkcalendar. Now in my create_ui function I have a menu option for enabling/disabling the calendar. as the calendar is enabled by default, how should I now disable (maybe hide) it? what's the most elegant solution for this problem? I also think about the possibility to choose from a variety of widgets to be displayed inside the contents window. and in my eyes it doesn't make sense to first create all those widgets and then manually show/hide them as needed (suppose I just want to have one widget at a time). I'm welcome for any suggestions, cheers, Andreas ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Notification area application
On Sun, 2006-04-02 at 07:37 -0700, BobS0327 wrote: I am trying to develop an application that resides in the notification area of Fedora 5 and version 2.14.0 of the Notification area. I have found some sample code on the internet for a base system tray (notification area) application. It compiles without any problem but no icon appears in the notification area. Thus, can anybody provide any assistance to help me develop this base system tray application? Thanx Bob, You and I may be at the same place in writing code to this interface. I include three links to answer your question. 1. look at libegg/tray and use that code as is or modified. Your already have a notification tray in the gnome panel (or add to panel one), as a target for this code. This code also includes a test program for the two type/styles of tray_icons. http://cvs.gnome.org/viewcvs/libegg/?only_with_tag=MAIN 2. Some guidance on how/when to use a notification area versus a gnome-panel-applet. http://developer.gnome.org/projects/gup/hig/2.0/desktop-notification-area.html 3. The FreeDesktop.org spec or description of the notification area protocol. http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.2.html Hope this helps, James, Bob -- View this message in context: http://www.nabble.com/Notification-area-application-t1382780.html#a3713241 Sent from the Gtk+ - Apps Dev forum at Nabble.com. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
api reference
The api has the following reference: http://www.gtk.org/api/2.6/gtk/TextWidget.html I have everything in this reference working. However after you have made a mark of a section of text in a buffer how do you save this so if you save the text in a file when you open this file again all the text editing (ie the tags applied to the buffer) are retained? Any references or examples appreciated. Regards, Ashley ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Segmentation Fault
On Tue, 4 Apr 2006, Sandeep KS wrote: I have written a program using GTK which executes some shellscripts in the background...After the shellscripts complete executing, a window is displayed showing the completion details At this time segmentation fault occurs. Is there anyway to trace the exact cause of the segmentation fault... I tried gdb, but it didn't show any error while executing the code..The segmentation fault occured when the execution went to loop after displaying the final window and waiting for user's interaction... How can i find the reason for the segmentation fault? At the shell prompt, run ulimit -c unlimited, then run your application. When it segfaults, a file called core will be created in the application's current working directory, containing the state of the application when the segfault occurred. You can then inspect the core file with gdb by running gdb myapp core where myapp is the name of the application's binary file. HTH JV ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Segmentation Fault
On Tue, 2006-04-04 at 19:38 -0400, John Vetterli wrote: On Tue, 4 Apr 2006, Sandeep KS wrote: I have written a program using GTK which executes some shellscripts in the background...After the shellscripts complete executing, a window is displayed showing the completion details At this time segmentation fault occurs. Is there anyway to trace the exact cause of the segmentation fault... I tried gdb, but it didn't show any error while executing the code..The segmentation fault occured when the execution went to loop after displaying the final window and waiting for user's interaction... How can i find the reason for the segmentation fault? At the shell prompt, run ulimit -c unlimited, then run your application. When it segfaults, a file called core will be created in the application's current working directory, containing the state of the application when the segfault occurred. You can then inspect the core file with gdb by running gdb myapp core where myapp is the name of the application's binary file. Alternatively, run under gdb. When the segfault occurs tell gdb to show you a backtrace (bt). At the top of the stack trace (most nested function called) will be in some lib code. But further down it'll show you your code that called it. Or, maybe, it'll show that the inferior* program dumped core in a callback of yours. // Wally (* gdb refers to the program being debugged as the inferior program for two reasons. The other reason is because it's run under gdb. :^) -- Constructing a program is like painting a room. A beginner at either will start in one corner and end in another, left there to discover just how important approach and technique are in obtaining a good result. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Funcamentals of GTK
OK I'm having some trouble understanding how a GTK application actually works. I've created a few terminal based applications in C for linux. When I want my application to continually perform a particular function I set up a loop. Within this loop I call the functions to update data etc So now I'm wanting to do something very simple like update the GUI in gtk with newly aquired data (text on a menu button label). But I have no idea how this works. The tutorials I've seen show you how to update data when an event occurs such as clicking on a button...but not how to update information continually...with no user interaction. Are there any tutorials on how to do this? I have looked through the API refs etc but I just can't grasp how to do this...so any help would be very much appreciated. Thanks -- View this message in context: http://www.nabble.com/Funcamentals-of-GTK-t1396951.html#a3756984 Sent from the Gtk+ - Apps Dev forum at Nabble.com. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Fundamentals of GTK
On Tue, 2006-04-04 at 19:20 -0700, 3saul wrote: OK I'm having some trouble understanding how a GTK application actually works. I've created a few terminal based applications in C for linux. When I want my application to continually perform a particular function I set up a loop. Within this loop I call the functions to update data etc So now I'm wanting to do something very simple like update the GUI in gtk with newly aquired data (text on a menu button label). But I have no idea how this works. The tutorials I've seen show you how to update data when an event occurs such as clicking on a button...but not how to update information continually...with no user interaction. Are there any tutorials on how to do this? I have looked through the API refs etc but I just can't grasp how to do this...so any help would be very much appreciated. There are several ways to update a gui from a non-gui even source 1. g_idle_add() - when the gui is idle, poll some source for data 2. use io channels to generate callbacks when data arrives in pipes, files, or sockets -- see http://developer.gnome.org/doc/API/2.0/glib/glib-IO-Channels.html 3. threads, update the GUI through some kind of IPC mechanism (threads and guis are kind of tricky) The following post has an example that spawns a process and puts the process' output into the GTK gui: http://mail.gnome.org/archives/gtk-app-devel-list/2004- March/msg00026.html Michael Thanks -- View this message in context: http://www.nabble.com/Fundamentals-of-GTK-t1396951.html#a3756984 Sent from the Gtk+ - Apps Dev forum at Nabble.com. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Fundamentals of GTK
Thanks for the information...that was very helpful. So in terms of how the main function works in a GTK app is it like this: int main( int argc, char *argv[] ) - start here and work down to... gtk_main (); - check to see if anything needs to be done for the gui then loop back up to int main( int argc, char *argv[] )?? Is that how it works? -- View this message in context: http://www.nabble.com/Fundamentals-of-GTK-t1396951.html#a3757705 Sent from the Gtk+ - Apps Dev forum at Nabble.com. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list