Re: problems to make the datas appear in a TREE ...
Hi, > for (list = history_list->history, i = 0; list ; list = > list->next, i++) { > GtkTreeStore *store = GTK_TREE_STORE > (gtk_tree_view_get_model(GTK_TREE_VIEW(tree))); > gtk_tree_store_append(store, iter, NULL); Here a top-level row is appended but no contents is set for this row. > add_to_node(history_list, &iter, dialog_widgets->tree, i); This fn seems to add a child to the top-level row (that was just created with no content). If the history_list->history contains 14 elements then the TreeView will have 14 top level rows with one child each. If you have only a list of elements why do you go for TreeStore rather than ListStore. Why don't you use code something like the follg: GtkTreeIter iter; for (list = history_list; list; list = list->next) { gtk_list_store_append (store, &iter); gtk_list_store_set (store, 0, (const char*)list->data, -1); } Sorry, if my inference is wrong. I have never used a GtkTreeStore. I assume that since the toplevel rows doesn't have any content, "you see no output". -- Santhosh. ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ Project - http://eccvs.sf.net ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: problems to make the datas appear in a TREE ...
Hi Peter, > Well...in the code snippets you posted, the GtkTreeIter iter that > you pass to add_to_node isn't initialized. Was that done > elsewhere? sorry, without this initialize I was getting a segfault :S ... in fact, i'm doing something like this : (...populating the tree...) for (list = history_list->history, i = 0; list ; list = list->next, i++) { GtkTreeStore *store = GTK_TREE_STORE (gtk_tree_view_get_model(GTK_TREE_VIEW(tree))); gtk_tree_store_append(store, iter, NULL); add_to_node(history_list, &iter, dialog_widgets->tree, i); } (...) no segfault occur ... but, is this enough to initialize it (iter) ?! thanks and best regards -- Antonio Gomes E-mail: [EMAIL PROTECTED] Embedded Linux Lab - 10LE INdT - Instituto Nokia de Tecnologia (Manaus/Br) NOKIA's Technology Institute ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: problems to make the datas appear in a TREE ...
On 04/18/2005 04:57:27 PM, Antonio Gomes wrote: Hi every one, I'm getting some troubles to make datas appear in a gtk tree store ... i'm pasting the piece of code in my app that is resposible to create and populate the tree [ code snipped ] after all this code, there is no segfaults but nothing occurs ... just a line is created in the tree with no content :S ... am I doing some thing wrong or is missing any details !!? Well...in the code snippets you posted, the GtkTreeIter iter that you pass to add_to_node isn't initialized. Was that done elsewhere? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Kerberos Dialog Box
Hello, I am wondering how you might go about implementing a kerbos dialog box which will spawn an independent process (to periodically do a krcp). I am not sure how to make use of the info at http://www.arl.hpc.mil/userservices/krb_pipes.html Presently, I only know how to do things manually, e.g. > kshell > kinit [provide password and SecurID Passcode] > krcp kraken:/u/home/eckhoff/model.dat . Then I can do stuff with the file model.dat (plots, progress bars). I know people have written perl scripts to do this, but I am curious as to whether this can become part of my gtk+ app. Mike ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
problems to make the datas appear in a TREE ...
Hi every one, I'm getting some troubles to make datas appear in a gtk tree store ... i'm pasting the piece of code in my app that is resposible to create and populate the tree (...) /*Create store and columns */ store = gtk_tree_store_new(1,G_TYPE_STRING); dialog_widgets->tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); column = gtk_tree_view_column_new(); renderer = gtk_cell_renderer_text_new(); gtk_tree_view_column_pack_start(column, renderer, TRUE); gtk_tree_view_column_add_attribute(column, renderer, "text", 0); gtk_tree_view_append_column(GTK_TREE_VIEW(dialog_widgets->tree), column); gtk_tree_view_set_expander_column(GTK_TREE_VIEW(dialog_widgets->tree), column); (...populating the tree...) for (list = history_list->history, i = 0; list ; list = list->next, i++) { add_to_node(history_list, &iter, dialog_widgets->tree, i); } GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(dialog_widgets->tree)); (...) static void add_to_node(HistoryStruct * history_list, GtkTreeIter * iter, GtkWidget * tree, gint index) { GtkTreeIter C_iter; gchar *buffer = NULL; GtkTreeStore *store = GTK_TREE_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(tree))); gtk_tree_store_append(store, &C_iter, iter); gtk_tree_store_set(store, &C_iter, 0, (const gchar *) g_slist_nth_data (history_list->history, index), -1); } after all this code, there is no segfaults but nothing occurs ... just a line is created in the tree with no content :S ... am I doing some thing wrong or is missing any details !!? Best regards -- Antonio Gomes E-mail: [EMAIL PROTECTED] Embedded Linux Lab - 10LE INdT - Instituto Nokia de Tecnologia (Manaus/Br) NOKIA's Technology Institute ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Ignore FOCUSOUT
Hi all, In my focus out event, I validate the string specified in the entry box for which the focus out has been generated. If the value is invalid, I want the focus to stay there itself. I tried to return TRUE from the callback for invalid enty, I got the error. gtkEntry-did not recieve focus-out-event. If you connect a handler to this signal, it must return FALSE so the entry gets the evnt as well. And an error message(message box) is diplayed throwing Gtk-ERROR**: file gtkentry.c: line 4856 (blink_cb): assertion failed:(GTK_WIDGET_HAS_FOCUS(entry)) aborting I tried to set focus using gtk_window_set_focus, for the same entry. But again I get the same error message even if I return FALSE. Please help me Thanks Deekshit M ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Drag&Drop from GtkListStore and icon size
Hello to the list, I currently develop an application which uses Drag&Drop from a list build up with a GtkListStore-"Object". When I drag an item from the list, I get the whole line as "drag-icon". But I only want a small icon. How do I change the behavior? Functions like "gtk_drag_set_icon_stock" do not work. I used this function as described in the documentation. Thanks you very much for the answers Juergen Dankoweit PS: I hope that this I will get an answer. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Focusout and Notebook
Hi all, I have a entry widget in first page of a notebook. I registered focusout event for the entry like gtk_signal_connect(GTK_OBJECT(pw_projname), "focus_out_event", GTK_SIGNAL_FUNC(pw_proj_name_focus_out), NULL); When I click the second page, I get the focus out event, then I switch back to first page. I get a focusout event, But the focus is still on the entry in the first page. Can anybody let me know why I am getting the focus out for the second time. Thanks in advance Deekshit M ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: gtk-app-devel-list Digest, Vol 12, Issue 35
a bit easier would be to add a while(gtk_events_pending()) gtk_main_iteration(); after each update of the progress bar. that should force a visible update of the bar: system("wget file.a"); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pb1), 0.3); while(gtk_events_pending()) gtk_main_iteration(); gyözö both > You may use the pthread.h C library and use multiples threads to do > what you want... I don't know exactly how to do it, but it is a way > out for your problem! > > -- > André Pedralho > Bachelor in Computer Science > Instituto Nokia de Tecnologia > > On 4/18/05, Aristidas Vilkaitis <[EMAIL PROTECTED]> wrote: > > Hello, > > > > Since i'm quite new to both C and Gtk, i met a problem which i am not > > able to solve. The base of the problem is that i have a task, which > > should fetch several files from the internet. When a button is pressed, > > a new window with a progress bar opens and indicates the progress of the > > task. Basicly, since i thought C is a linear language, i just added > > several system() calls and added gtk_progress_bar_set_fraction between > > them like so: > > > > ... > > system("wget file.a"); > > gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pb1), 0.3); > > system("wget file.b"); > > gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pb1), 0.6); ... > > > > and so on. > > > > The result was that the program first executed the system calls, and > > only afterwards did it paint something or tampered with the progress bar. > > > > Why? How to go around this? What to read? -- I suggest you locate your hot tub outside your house, so it won't do too much damage if it catches fire or explodes. First you decide which direction your hot tub should face for maximum solar energy. After much trial and error, I have found that the best direction for a hot tub to face is up. -- Dave Barry, "The Taming of the Screw" ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Pop up Menu
This webpage clearly explains how to implement a popup menu. http://developer.gnome.org/doc/API/2.0/gtk/gtk-migrating-checklist.html#checklist-popup-menu Good luck. -- Hazael Maldonado Torres ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Progress bars and syscalls
On Monday 18 April 2005 11:51, Aristidas Vilkaitis wrote: > Since i'm quite new to both C and Gtk, i met a problem which i am not > able to solve. The base of the problem is that i have a task, which > should fetch several files from the internet. When a button is pressed, > a new window with a progress bar opens and indicates the progress of the > task. Basicly, since i thought C is a linear language, i just added > several system() calls and added gtk_progress_bar_set_fraction between > them like so: > > ... > system("wget file.a"); > gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pb1), 0.3); > system("wget file.b"); > gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pb1), 0.6); ... > > and so on. > > The result was that the program first executed the system calls, and > only afterwards did it paint something or tampered with the progress bar. > > Why? How to go around this? What to read? Check out g_spawn_async() in connection with GIOChannel and g_io_add_watch(). You can find an example (which uses wget, even) here: http://scentric.net/tmp/spawn-async-with-pipes-gtk.c (Don't use threads for this kind of stuff, it's completely unnecessary and will cause you more problems than it solves). Cheers -Tim ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Progress bars and syscalls
Aristidas Vilkaitis ha scritto lo scorso 18/04/2005 12:51: Hello, Since i'm quite new to both C and Gtk, i met a problem which i am not able to solve. The base of the problem is that i have a task, which should fetch several files from the internet. When a button is pressed, a new window with a progress bar opens and indicates the progress of the task. Basicly, since i thought C is a linear language, i just added several system() calls and added gtk_progress_bar_set_fraction between them like so: ... system("wget file.a"); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pb1), 0.3); /* return control to main loop in order to serve all pending * requests */ while ((gtk_events_pending ()) { gtk_main_iteration (); } system("wget file.b"); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pb1), 0.6); ... while ((gtk_events_pending ()) { gtk_main_iteration (); } This should do the job. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Progress bars and syscalls
You may use the pthread.h C library and use multiples threads to do what you want... I don't know exactly how to do it, but it is a way out for your problem! -- André Pedralho Bachelor in Computer Science Instituto Nokia de Tecnologia On 4/18/05, Aristidas Vilkaitis <[EMAIL PROTECTED]> wrote: > Hello, > > Since i'm quite new to both C and Gtk, i met a problem which i am not > able to solve. The base of the problem is that i have a task, which > should fetch several files from the internet. When a button is pressed, > a new window with a progress bar opens and indicates the progress of the > task. Basicly, since i thought C is a linear language, i just added > several system() calls and added gtk_progress_bar_set_fraction between > them like so: > > ... > system("wget file.a"); > gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pb1), 0.3); > system("wget file.b"); > gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pb1), 0.6); ... > > and so on. > > The result was that the program first executed the system calls, and > only afterwards did it paint something or tampered with the progress bar. > > Why? How to go around this? What to read? > > Thank you, > Fireel > > ___ > 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: Pop up Menu
You must use the gtk_menu_popup (). The GTK api shows all you may do with this. See it at: http://developer.gnome.org/doc/API/2.0/gtk/GtkMenu.html#gtk-menu-popup Use this function inside your callback for a click on your frame. Then specify the button you clicked (GDK_BUTTON3_MASK for the right click). e.g gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, GDK_BUTTON3_MASK, gtk_get_current_event_time()); -- André Pedralho Bachelor in Computer Science Instituto Nokia de Tecnologia On 4/18/05, dimitri PIEL <[EMAIL PROTECTED]> wrote: > > Hi > > I'm moreless newbie with Gtk and I don't really know how to display a pop up > menu when the user right-click inside a frame. > Could you help me please > > Thanks. > > Dimitri > ___ > 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
Pop up Menu
Hi I'm moreless newbie with Gtk and I don't really know how to display a pop up menu when the user right-click inside a frame. Could you help me please Thanks. Dimitri ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Progress bars and syscalls
Hello, Since i'm quite new to both C and Gtk, i met a problem which i am not able to solve. The base of the problem is that i have a task, which should fetch several files from the internet. When a button is pressed, a new window with a progress bar opens and indicates the progress of the task. Basicly, since i thought C is a linear language, i just added several system() calls and added gtk_progress_bar_set_fraction between them like so: ... system("wget file.a"); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pb1), 0.3); system("wget file.b"); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pb1), 0.6); ... and so on. The result was that the program first executed the system calls, and only afterwards did it paint something or tampered with the progress bar. Why? How to go around this? What to read? Thank you, Fireel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
label hi-lite
hi all; using gtk how to hi-lite the alternative labels, or rows. thanks; vas. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
RE: running a function
> I am new to gtk, and trying my hand at writing a mp3player, I > am working on the point of the player that when one song is done > playing it will load and play the next song. How do I run a test > function every couple milli seconds to check to see if it is still > playing or not? is g_timeout_add() what I need to use? g_timeout_add() will do pretty much exactly what you want (the only gotca with it is that you'll probably need to cast your callback to the right type, and you have to check your callback return value). Even running an external program, you can generally coax it into telling you when it's finished. Glib as mechanisms for doing that. But it's a pretty ghastly way of doing things. GUI's are supposed to be event-driven, which basically means that the program spends as much time as possible doing absolutely nothing. It just sits around waiting for someone or something to come around and wake it up. Instead of polling the player to see if it's still running, make it tell you when it's finished. And if it won't, find one that will. (Someone suggested gstreamer) In general, if you have to use a callback to check something at very small intervals, and you're not working directly with fickle hardware, you're probably doing something wrong. Fredderic ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list