Re: Getting the "busy" cursor to display.

2012-04-10 Thread James Tappin
On 10 April 2012 11:36, Michael Cronenworth  wrote:

> James Tappin wrote:
> > Is there some other call (or calls) I should be making to force the
> updates
> > to take place?
>
> I use the following for widget updates during background processing:
>
>while ( gtk_events_pending( ) )
>gtk_main_iteration(  );
>
> Not sure if it will work for cursor drawing though.
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>

I have tried that as well -- and still no joy.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


RE: Making a cursor (cross hair) track between image displays

2012-04-10 Thread Tilton, James C. (GSFC-6063)
Hi GTK+ application developers:

As it often happens, the inquirer often answers his own question. I finally 
found clear enough example of something similar in gtkmm 3 and through a little 
trial and error found the solution. Here it is for gtkmm 3:

  Glib::RefPtr  ref_Gdk_window = get_window();
  Glib::RefPtr display_cursor = 
Gdk::Cursor::create(ref_Gdk_window->get_display(), Gdk::CROSSHAIR);
  ref_Gdk_window->set_cursor(display_cursor);

Now, to complete my application, I just need to draw a cursor "clone" 
(crosshair) at the corresponding location in the associated gtkmm windows.

Jim Tilton

-Original Message-
From: gtk-app-devel-list-boun...@gnome.org 
[mailto:gtk-app-devel-list-boun...@gnome.org] On Behalf Of Tilton, James C. 
(GSFC-6063)
Sent: Tuesday, April 10, 2012 9:28 AM
To: gtk-app-devel-list@gnome.org
Subject: RE: Making a cursor (cross hair) track between image displays

Hi again,

I've made a lot of progress on this task - but I still am having trouble with 
manipulating the appearance of the Cursor. Apparently the approach for doing 
this has changed between gtkmm 2 and 3, and apparently all the solutions I can 
find via Google are for gtkmm 2.  How can I change the default appearance of my 
cursor from the default cursor to something else (e.g. a CrossHair) in gtkmm 3?

Thanks.

Jim Tilton

-Original Message-
From: gtk-app-devel-list-boun...@gnome.org 
[mailto:gtk-app-devel-list-boun...@gnome.org] On Behalf Of Tilton, James C. 
(GSFC-6063)
Sent: Monday, April 02, 2012 12:00 PM
To: gtk-app-devel-list@gnome.org
Subject: Making a cursor (cross hair) track between image displays

Hi GTK+ application developers!

I have developed an application using gtkmm in which I display related images 
in multiple Gtk::Window's.

I have two types of "display images."  One is based on Gtk::Image and the other 
is based on Gtk::DrawingArea.
For the Gtk::Image case I add the Gtk::Image to a Gtk::EventBox, which in turn 
I add to a Gtk::ScrolledWindow.
For the Gtk::DrawingArea, is directly add the Gtk::DrawingArea to a 
Gtk::ScrolledWindow (without the intervening Gtk::EventBox).

When the image sizes exceed the ScrolledWindow display area, I use the 
Gtk::Adjustment associated with each Gtk::ScrolledWindow to have the 
pan-scrolling of each window track each other.

When I place the cursor in one of the display images, I would like to have a 
cross hair appear at the cursor location of the window in which the cursor is 
placed at the location currently pointed to by the cursor. I would ALSO like to 
have a similar cross hair appear in each of the other associated display images.

How can I make this happen with GTK+/gtkmm? I've looked for examples of this 
and haven't found any. Can anyone point me in the right direction for 
implementing this feature in my application?

(In my current application, the normal arrow cursor appears in just one window, 
and if I hold the either the left or right mouse button down, I have the column 
and row location and image data value(s) appear in text below the Scrolled 
Window image display.)

Thanks.

Jim Tilton

Dr. James C. TiltonVoice:   
301-286-9510
NASA Goddard Space Flight Center   FAX: 301-286-1776
Mail Code 606.3E-Mail:  
james.c.til...@nasa.gov
(Computational & Information Sciences and Technology Office)
Greenbelt, MD 20771
URLs:  http://ipp.gsfc.nasa.gov/ft_tech_rhseg.shtm and 
http://science.gsfc.nasa.gov/606.3/TILTON/



___
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
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Getting the "busy" cursor to display.

2012-04-10 Thread Michael Cronenworth
James Tappin wrote:
> Is there some other call (or calls) I should be making to force the updates
> to take place?

I use the following for widget updates during background processing:

while ( gtk_events_pending( ) )
gtk_main_iteration(  );

Not sure if it will work for cursor drawing though.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Getting the "busy" cursor to display.

2012-04-10 Thread James Tappin
On 10 April 2012 10:09,  wrote:

> On 10 April 2012 16:58, James Tappin  wrote:
> >  call gdk_display_sync(gdk_display_get_default())
> >  call gdk_window_set_cursor(draw_window, busy_cursor)
> >  call gdk_display_sync(gdk_display_get_default())
>
> My gtk2 program does this with:
>
>gdk_window_set_cursor( window, cursor );
>gdk_flush();
>
> If that's any help :( I've not tried gtk3 yet.
>
> J
>

Thanks for the suggestion. Unfortunately in this case it doesn't help. (I
have also tried gdk_display_flush and gdk_window_flush, but still the same
story).
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Getting the "busy" cursor to display.

2012-04-10 Thread jcupitt
On 10 April 2012 16:58, James Tappin  wrote:
>      call gdk_display_sync(gdk_display_get_default())
>      call gdk_window_set_cursor(draw_window, busy_cursor)
>      call gdk_display_sync(gdk_display_get_default())

My gtk2 program does this with:

gdk_window_set_cursor( window, cursor );
gdk_flush();

If that's any help :( I've not tried gtk3 yet.

J
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Getting the "busy" cursor to display.

2012-04-10 Thread James Tappin
I have a gtk (fortran) application that displays a progress monitor while
computing, and I would like to display the busy cursor while the program is
reading a large data file.

Right now what I have is:

To define the busy cursor and GDK window (module [global] variables).

   draw_window = gtk_widget_get_window(window)
   busy_cursor = gdk_cursor_new_for_display(gdk_display_get_default(), &
& GDK_WATCH)

and then to activate/deactivate it:

 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 ! Set a busy cursor on the progress monitor (for reading the database)
 subroutine set_monitor_busy(is_busy)
   logical, intent(in) :: is_busy

   if (is_busy) then
  call gdk_display_sync(gdk_display_get_default())
  call gdk_window_set_cursor(draw_window, busy_cursor)
  call gdk_display_sync(gdk_display_get_default())
   else
  call gdk_display_sync(gdk_display_get_default())
  call gdk_window_set_cursor(draw_window, NULL)
  call gdk_display_sync(gdk_display_get_default())
   end if
 end subroutine set_monitor_busy

The just before I start to read the big file I have:
  call set_monitor_busy(.TRUE.)

and after reading:
 call set_monitor_busy(.FALSE.)

However, even with both gdk_display_sync calls as shown, sometimes the busy
cursor appears and sometimes it doesn't (in fact sometimes the whole window
shows blank until after the file read). The commonest case is that the
monitor window renders but still keeps the regular cursor.

Is there some other call (or calls) I should be making to force the updates
to take place?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


RE: Making a cursor (cross hair) track between image displays

2012-04-10 Thread Tilton, James C. (GSFC-6063)
Hi again,

I've made a lot of progress on this task - but I still am having trouble with 
manipulating the appearance of the Cursor. Apparently the approach for doing 
this has changed between gtkmm 2 and 3, and apparently all the solutions I can 
find via Google are for gtkmm 2.  How can I change the default appearance of my 
cursor from the default cursor to something else (e.g. a CrossHair) in gtkmm 3?

Thanks.

Jim Tilton

-Original Message-
From: gtk-app-devel-list-boun...@gnome.org 
[mailto:gtk-app-devel-list-boun...@gnome.org] On Behalf Of Tilton, James C. 
(GSFC-6063)
Sent: Monday, April 02, 2012 12:00 PM
To: gtk-app-devel-list@gnome.org
Subject: Making a cursor (cross hair) track between image displays

Hi GTK+ application developers!

I have developed an application using gtkmm in which I display related images 
in multiple Gtk::Window's.

I have two types of "display images."  One is based on Gtk::Image and the other 
is based on Gtk::DrawingArea.
For the Gtk::Image case I add the Gtk::Image to a Gtk::EventBox, which in turn 
I add to a Gtk::ScrolledWindow.
For the Gtk::DrawingArea, is directly add the Gtk::DrawingArea to a 
Gtk::ScrolledWindow (without the intervening Gtk::EventBox).

When the image sizes exceed the ScrolledWindow display area, I use the 
Gtk::Adjustment associated with each Gtk::ScrolledWindow to have the 
pan-scrolling of each window track each other.

When I place the cursor in one of the display images, I would like to have a 
cross hair appear at the cursor location of the window in which the cursor is 
placed at the location currently pointed to by the cursor. I would ALSO like to 
have a similar cross hair appear in each of the other associated display images.

How can I make this happen with GTK+/gtkmm? I've looked for examples of this 
and haven't found any. Can anyone point me in the right direction for 
implementing this feature in my application?

(In my current application, the normal arrow cursor appears in just one window, 
and if I hold the either the left or right mouse button down, I have the column 
and row location and image data value(s) appear in text below the Scrolled 
Window image display.)

Thanks.

Jim Tilton

Dr. James C. TiltonVoice:   
301-286-9510
NASA Goddard Space Flight Center   FAX: 301-286-1776
Mail Code 606.3E-Mail:  
james.c.til...@nasa.gov
(Computational & Information Sciences and Technology Office)
Greenbelt, MD 20771
URLs:  http://ipp.gsfc.nasa.gov/ft_tech_rhseg.shtm and 
http://science.gsfc.nasa.gov/606.3/TILTON/



___
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