Re: A question about GTK Scale

2008-04-16 Thread Christopher Backhouse
Perhaps it takes 2 iterations of the main loop for the vscale to update. What happens if you try while(gtk_events_pending()) gtk_main_iteration(); instead? Ke Jin wrote: Dear All, I have a VScale in my interface and I created button named Play that once the button is clicked, the scale will

Re: Implement drag and drop between two TreeViews

2006-10-18 Thread Christopher Backhouse
- Hash: SHA1 On Tue, Oct 17, 2006 at 03:42:35PM +0100, Christopher Backhouse wrote: Hi I have two Treeviews (just lists, they use Liststore) and I want to be able to drag entries from one into the other. What is the correct way to do this? I call enable_model_drag_source on one list

Implement drag and drop between two TreeViews

2006-10-17 Thread Christopher Backhouse
Hi I have two Treeviews (just lists, they use Liststore) and I want to be able to drag entries from one into the other. What is the correct way to do this? I call enable_model_drag_source on one list and enable_model_drag_dest on the other - the gui behaves as if drag-and-drop will work and

Re: Command Window with MSVC++ GTK apps

2006-10-03 Thread Christopher Backhouse
Lots of my code has this at the top of it #pragma comment(linker, /subsystem:\windows\ /entry:\mainCRTStartup\) //Kill console window I got it off the internet somewhere. I assume the unrecognised pragma will be ignored by every other compiler out there so it should be portable (if a little

Re: size of an image on a button

2006-07-29 Thread Christopher Backhouse
. gtk_button_set_image(GTK_BUTTON(button),gtk_image_new_from_pixbuf(gdk_pixbuf_new_from_file_at_size(fname,width,height,NULL))); at least scales the image, but only to a preset size and obviously not with the size of the button Tristan Van Berkom wrote: Christopher Backhouse wrote: If I set a button

size of an image on a button

2006-07-27 Thread Christopher Backhouse
If I set a button to have an image like this: gtk_button_set_image(GTK_BUTTON(button),gtk_image_new_from_file(fname.svg)); then the button grows to the full size of the image (huge). Using: gtk_widget_set_size_request(button,30,30); I can make the button have a sensible size, but the

Re: Removing selected items from a list

2006-07-22 Thread Christopher Backhouse
I like option 2. Strange that I didn't think of it, as this exactly what I usually do for std::vector (although the performance of deleting from the middle of a vector is obviously not good) David Nečas (Yeti) wrote: On Fri, Jul 21, 2006 at 11:23:40PM +0100, Christopher Backhouse wrote: so

Removing selected items from a list

2006-07-21 Thread Christopher Backhouse
I want to remove all the items in a list that the user has highlighted After discovering that I'm not allowed to use gtk_tree_selection_selected_foreach I am trying it like this GList* seln=gtk_tree_selection_get_selected_rows(gtk_tree_view_get_selection(view),model); do { GtkTreeIter

Re: Removing selected items from a list

2006-07-21 Thread Christopher Backhouse
a path. All in all not the prettiest code, but at least it works. If there is a neater solution I would be happy to hear about it Brian J. Tarricone wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/21/2006 2:32 PM, Christopher Backhouse wrote: I want to remove all the items in a list

Re: Question about put GtkWidget pointer as function's argument

2006-07-17 Thread Christopher Backhouse
chao yeaj wrote: splash = frame;/* Here, the splash is not NULL*/ splash is a local variable. if you want to assign to the data at the pointer: *splash=frame ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org

Re: gtk_tree_view_get_visible_range

2006-07-05 Thread Christopher Backhouse
What do you exactly expect from gtk_tree_view_get_visible_range() when the tree view is not realized, has no size allocated, etc. (beside a more helpful error message)? What is *visible* then? I probably expect FALSE again but I suppose the current behaviour is OK The errors disappear if

gtk_tree_view_get_visible_range

2006-07-04 Thread Christopher Backhouse
My previous email on this subject was rubbish and unspecific, sorry for the spam. So - I have reduced my code down to the smallest test case and now hope someone can help me. #include gtk/gtk.h int main(int argc, char **argv) { gtk_init(argc, argv); //make a store and view

gtk_tree_view_get_visible_range

2006-07-03 Thread Christopher Backhouse
So - I have a treeview, initially empty. I am using the code below as part of a function to find out what items are visible. Once any items are added to the list it goes bad (usually - sometimes it works fine) //I bet we don't need to initialise these - in fact I bet we leak this //way - but

Re: gtk_tree_model_get_iter segfault in on_row_activated

2006-06-17 Thread Christopher Backhouse
You are both right - it now works fine. Thanks for pointing out what was right under my nose. I do honestly know what I am doing with pointers - I think this is the effects of code written at 2 in the morning and then seeing what should have been there upon trying to debug it. All the

gtk_tree_model_get_iter segfault in on_row_activated

2006-06-16 Thread Christopher Backhouse
I have connected to the row activated signal and want to handle it - so I am doing this: void on_row_activated(GtkTreeView* tree_view,GtkTreePath* path,GtkTreeViewColumn* column,gpointer user_data) { std::coutpath was gtk_tree_path_to_string(path)\n; GtkTreeModel*