How to detect when user scrolls

2011-09-05 Thread Andrew Wood
Im writing some code which will call a function (userActive) when the user does something, for mouse moves, clicks and keyboard presses this is working fine: g_signal_connect(G_OBJECT(mainwindow),motion-notify-event,G_CALLBACK(userActive),NULL); //will be called when a mouse move occurs

Re: How to detect when user scrolls

2011-09-05 Thread Andrew Wood
Excellent. Thank you On 05/09/11 15:37, David Nečas wrote: On Mon, Sep 05, 2011 at 02:37:32PM +0100, Andrew Wood wrote: However in the mainwindow is a GtkScrolledWindow, and although its detecting mouse movement over the display area, if the user is just moving the scrollbarsandnot doing

Re: Detecting Ctrl Esc in GTK app

2011-08-30 Thread Andrew Wood
Thanks for the tip. Can accelerators only be used with menu items, only Ive just tried doing it by linking it to the clicked signal on a (hidden) GtkButton but it doesnt work? My idea was when the key combo was pressed the accelerator would emit a clicked signal on the button and the buttons

Re: Detecting Ctrl Esc in GTK app

2011-08-30 Thread Andrew Wood
How would you link it directly to the window then rather than to a widget? As far as I can see you need to associate it with a signal, but looking down the list of signals for windows I cant really see one suitable, hence I was using this:

Re: Detecting Ctrl Esc in GTK app

2011-08-30 Thread Andrew Wood
Thanks John thats solved that one. Now onto the next issue to do with the window type for which I will start a new thread On 30/08/11 15:50, jcup...@gmail.com wrote: On 30 August 2011 15:22, Andrew Wooda@me.com wrote: How would you link it directly to the window then rather than to a

How to achieve functionality of GTK_WINDOW_POPUP but with keyboard input

2011-08-30 Thread Andrew Wood
How can I achieve the same 'screen invasion' effect (i.e covers everything including the Gnome Panels and prevents other windows being brought to the front with Alt-Tab) that GTK_WINDOW_POPUP has but also allow keyboard input to the widgets in the window. Ive tried GDK_WINDOW_TYPE_HINT_DOCK

Detecting Ctrl Esc in GTK app

2011-08-29 Thread Andrew Wood
Is there a way to regiser a handler function which will be called whenever the user presses Ctrl-Esc in a GTK app? Thanks ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Errors creating GdkPixbuf

2010-09-05 Thread Andrew Wood
Im getting errors when trying to create a GdkPixbuf using: GdkPixbuf* unviewedicon = gdk_pixbuf_new_from_file(/home/andrew/txe2mdr/unviewedicon.png, NULL); When it runs it spews out: (process:2153): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.24.0/gobject/gtype.c:2706: You forgot to

Re: Problem swapping GtkScrolledWindow contents on the fly

2010-01-15 Thread Andrew Wood
, Jan 13, 2010 at 08:26:57PM +, Andrew Wood wrote: Just tried it with a simple vbox and label created manually and am getting exactly the same problem so its not specific to libglade If I do this: --- main.cpp.orig 2010-01-13 22:36:25.0 +0100 +++ main.cpp2010-01-13

Re: Problem swapping GtkScrolledWindow contents on the fly

2010-01-13 Thread Andrew Wood
Still getting strange results with this. Ive posted a skeleton app at www.simple.org/TCSAdminGTK.tar which is a single source file which can be comiled with g++ ./main.cpp `pkg-config --cflags --libs libgnome-2.0 libgnomeui-2.0 libglade-2.0` When you click one of the options on the left

Re: Problem swapping GtkScrolledWindow contents on the fly

2010-01-13 Thread Andrew Wood
Great thanks On 13 Jan 2010, at 11:05, David Nečas wrote: On Wed, Jan 13, 2010 at 10:33:07AM +, Andrew Wood wrote: Still getting strange results with this. Ive posted a skeleton app at www.simple.org/TCSAdminGTK.tar which is a single source file which can be comiled with g

Re: Problem swapping GtkScrolledWindow contents on the fly

2010-01-13 Thread Andrew Wood
Just tried it with a simple vbox and label created manually and am getting exactly the same problem so its not specific to libglade David Nečas wrote: On Wed, Jan 13, 2010 at 10:33:07AM +, Andrew Wood wrote: Still getting strange results with this. Ive posted a skeleton app

Re: Problem swapping GtkScrolledWindow contents on the fly

2009-12-25 Thread Andrew Wood
I thought it was probably gtk_widget_ref but although that has cleared the warnings the widgets dont display themselves the 2nd or 3rd time the function is called, only the first time. The code is now: void showGeneralPage() { g_print(Showing General Page\n); if

Problem swapping GtkScrolledWindow contents on the fly

2009-12-24 Thread Andrew Wood
The following function is called to display a vbox, which is read from a glade file, in a scrollview. If the vbox or 'page' hasnt been displayed before then generalpageinitialised will be false. There are other 'pages' in the app which are vboxes read from a glade file in the same way. The

Re: Problem swapping GtkScrolledWindow contents on the fly

2009-12-24 Thread Andrew Wood
But that bit of code only runs the first time and the first time it works. On 24 Dec 2009, at 19:09, Tristan Van Berkom wrote: From the assertions it *looks* like glade_xml_get_widget() is returning NULL for mainvbox. Cheers, -Tristan On Thu, Dec 24, 2009 at 11:29 AM, Andrew Wood

Re: Problem swapping GtkScrolledWindow contents on the fly

2009-12-24 Thread Andrew Wood
Thanks Tristan. I think I follow what you're saying... The call to gtk_container_remove is decrementing the ref count so generalpage becomes NULL? Is there a way to up the count immediately prior to calling gtk_container_remove Tristan Van Berkom wrote: Ahh you mean it shows up and

Showing GtkButton in table view

2009-12-22 Thread Andrew Wood
Is there a way to show a standard GtkButton in a table view. I can find examples for toggle buttons but I want a standard button in each row. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org

Re: Showing GtkButton in table view

2009-12-22 Thread Andrew Wood
OK thanks On 22 Dec 2009, at 14:08, David Nečas wrote: On Tue, Dec 22, 2009 at 01:25:18PM +, Andrew Wood wrote: Is there a way to show a standard GtkButton in a table view. I suppose you mean GtkTreeView. I can find examples for toggle buttons but I want a standard button in each

GtkScrollView contents its GtkViewport contents

2009-12-22 Thread Andrew Wood
Am I right in thinking a GtkScrolledWindow can only have 1 child (a GtkViewPort) and that the GtkViewPort can only have one child also? If this is correct. Having added a widget a GtkVBox to a GtkScrolledWindow using:

Re: GtkScrollView contents its GtkViewport contents

2009-12-22 Thread Andrew Wood
Perhaps I ought to add that Im trying to change the contents of the GtkScrolledWindow whilst the app is running but am getting the error: gtk_scrolled_window_add_with_viewport: assertion `GTK_BIN (bin-child)-child == NULL' failed Andrew Wood wrote: Am I right in thinking

Storing images in GtkTreeView model

2009-12-16 Thread Andrew Wood
Im using a GtkTreeView with a GtkListStore to display a list of rows with both text and a picture. I can declare the model with just the text as follows: /lhs_store=gtk_list_store_new(1,G_TYPE_STRING,); //1 cols(string) / but how do I decalre it to have a picture as well e.g the following-

Re: Storing images in GtkTreeView model

2009-12-16 Thread Andrew Wood
Excellent thank you. Tadej Borovšak wrote: Hello. /lhs_store=gtk_list_store_new(2,G_TYPE_STRING,G_TYPE_PIXBUF); //2 cols, 1st is string, 2nd is icon/ Store creation should be done like this: lhs_store = gtk_list_store_new( 2, G_TYPE_STRING, GDK_TYPE_PIXBUF ); Hint: For most of

GtkTreeView auto selecting row

2009-12-16 Thread Andrew Wood
Is there a way to pre-select a row when the tree is first displayed. In other words if the user hasnt yet selected a row it defaults to one ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org