Re: help on scrollbars

2006-08-31 Thread Tito Ragusa

-Messaggio Originale- 
From: [EMAIL PROTECTED]
Sent: 30/8/2006 12:20:12 PM
gtk-app-devel-list@gnome.org
Subject: Re: help on scrollbars

-Messaggio Originale- 
From: Paul Pogonyshev
Sent: 29/8/2006 8:25:05 PM
To: gtk-app-devel-list@gnome.org
Cc: [EMAIL PROTECTED]
Subject: Re: help on scrollbars

[EMAIL PROTECTED] wrote:
 Hi,
 I'm working on an app and I'm facing the need to access the
 button at the end of a vertical scrollbar of a scrolled window
 to do something like a
 
 gtk_button_clicked()
 
 to ensure that the widget (a treeview) contained in it
 gets scrolled to the end with whatever screen resolution
 is used.

Untested. This might help:

gtk_adjustment_set_value (gtk_scrolled_window_get_adjustment
(scrolled_window),
 DBL_MAX);

where `scrolled_window' contains the tree, of course. Actually
`DBL_MAX' can be replaced with any large enough value, like
1e100, if you don't want to include `float.h'.

Paul
.


I've tried this already but it doesn't work as expected.
What I get is:
1) I add a row to the treeview and call the function you suggested or
similar
2) the slider of the scrollbar correctly slides to the end
3) the rebounds to the middle of his range

I'm thinking about posting some example code
so that this is reproducible for others..

TIA and Ciao,
Tito 

Hi,
in the hope it could be useful to others this is what solved my problem
about gtktreeview autoscrolling when a new row is added:

void list_vertical_autoscroll(GtkWidget *list)
{
GtkTreePath *path;
GtkTreeIter iter;
GtkTreeModel* model;

model = gtk_tree_view_get_model(GTK_TREE_VIEW(list)); 
path = gtk_tree_model_get_path(GTK_TREE_MODEL(model), iter);
gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(list), path, NULL, TRUE, 0.0,
0.0);
gtk_tree_path_free(path);
}

Thanks and Ciao,
Tito 


Ppfont face=Arial, Helvetica, sans-serif size=2 
style=font-size:13.5px___BRBODY
BR
Milioni di oggetti, impossibile non trovare quello che cerchi.BR
Dallo spillo all'elefante, non ti stupire.BR
Sei su a 
href=http://adfarm.mediaplex.com/ad/ck/724-25726-1029-36?id=1;eBay!/a


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


Re: help on scrollbars

2006-08-30 Thread zz

-Messaggio Originale- 
From: Paul Pogonyshev
Sent: 29/8/2006 8:25:05 PM
To: gtk-app-devel-list@gnome.org
Cc: [EMAIL PROTECTED]
Subject: Re: help on scrollbars

[EMAIL PROTECTED] wrote:
 Hi,
 I'm working on an app and I'm facing the need to access the
 button at the end of a vertical scrollbar of a scrolled window
 to do something like a
 
 gtk_button_clicked()
 
 to ensure that the widget (a treeview) contained in it
 gets scrolled to the end with whatever screen resolution
 is used.

Untested. This might help:

gtk_adjustment_set_value (gtk_scrolled_window_get_adjustment
(scrolled_window),
 DBL_MAX);

where `scrolled_window' contains the tree, of course. Actually
`DBL_MAX' can be replaced with any large enough value, like
1e100, if you don't want to include `float.h'.

Paul
.


I've tried this already but it doesn't work as expected.
What I get is:
1) I add a row to the treeview and call the function you suggested or
similar
2) the slider of the scrollbar correctly slides to the end
3) the rebounds to the middle of his range

I'm thinking about posting some example code
so that this is reproducible for others..

TIA and Ciao,
Tito 


Ppfont face=Arial, Helvetica, sans-serif size=2 
style=font-size:13.5px___BRBODY
BR
Milioni di oggetti, impossibile non trovare quello che cerchi.BR
Dallo spillo all'elefante, non ti stupire.BR
Sei su a 
href=http://adfarm.mediaplex.com/ad/ck/724-25726-1029-36?id=1;eBay!/a


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


Re: help on scrollbars

2006-08-30 Thread zz

-Messaggio Originale- 
From: David Neèas \(Yeti\)
Sent: 29/8/2006 6:38:20 PM
To: gtk-app-devel-list@gnome.org
Subject: Re: help on scrollbars

On Tue, Aug 29, 2006 at 02:11:09PM +0200, [EMAIL PROTECTED] wrote:
 I'm working on an app and I'm facing the need to access the
 button at the end of a vertical scrollbar of a scrolled window
 to do something like a
 
 gtk_button_clicked()
 
 to ensure that the widget (a treeview) contained in it
 gets scrolled to the end with whatever screen resolution
 is used.
 
 This obviously in the assumption that this little buttons
 are real gtk_buttons
 
 I read most of the source and reference but haven't found
 nothing usefull and I also have tried some alternatives like:
 
 void list_vertical_autoscroll(GtkWidget *list)
 {
 GtkAdjustment *adjustment;
 
 adjustment = gtk_tree_view_get_vadjustment(GTK_TREE_VIEW(list));
 gtk_adjustment_set_value(adjustment, adjustment-upper +=
ARBITRARY_BIG_NUMBER);
 /*or*/
 gtk_adjustment_set_value(adjustment, adjustment-upper
+adjustment-page_size); 
 }
 
 that achieve some scrolling but not to the very end of the treeview.
 
 The only thing that works the way i would like it is to click with
mouse
 on the v button that's why I'm looking for a way to fake this click
 with a function.
 
 Could someone make me see the light?

As far as I understand you just need to copy the couple of
lines from step_forward() (or step_back()) in gtkrange.c,
replacing g_signal_emit() with g_signal_emit_by_name().

Yeti


Hi,
Tried this but sadly I was not able to make it work for me.
Probably clicking on the buttons just move up or down
one step and not to the very end of the treeview.

I'm thinking to post some example code to the list
so that my problem could be reproducible for 
others

TIA and ciao,
Tito 


Ppfont face=Arial, Helvetica, sans-serif size=2 
style=font-size:13.5px___BRBODY
BR
Milioni di oggetti, impossibile non trovare quello che cerchi.BR
Dallo spillo all'elefante, non ti stupire.BR
Sei su a 
href=http://adfarm.mediaplex.com/ad/ck/724-25726-1029-36?id=1;eBay!/a


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


Re: help on scrollbars

2006-08-29 Thread Yeti
On Tue, Aug 29, 2006 at 02:11:09PM +0200, [EMAIL PROTECTED] wrote:
 I'm working on an app and I'm facing the need to access the
 button at the end of a vertical scrollbar of a scrolled window
 to do something like a
 
 gtk_button_clicked()
 
 to ensure that the widget (a treeview) contained in it
 gets scrolled to the end with whatever screen resolution
 is used.
 
 This obviously in the assumption that this little buttons
 are real gtk_buttons
 
 I read most of the source and reference but haven't found
 nothing usefull and I also have tried some alternatives like:
 
 void list_vertical_autoscroll(GtkWidget *list)
 {
   GtkAdjustment *adjustment;
 
   adjustment = gtk_tree_view_get_vadjustment(GTK_TREE_VIEW(list));
   gtk_adjustment_set_value(adjustment, adjustment-upper += 
 ARBITRARY_BIG_NUMBER);
   /*or*/
   gtk_adjustment_set_value(adjustment, adjustment-upper 
 +adjustment-page_size); 
 }
 
 that achieve some scrolling but not to the very end of the treeview.
 
 The only thing that works the way i would like it is to click with mouse
 on the v button that's why I'm looking for a way to fake this click
 with a function.
 
 Could someone make me see the light?

As far as I understand you just need to copy the couple of
lines from step_forward() (or step_back()) in gtkrange.c,
replacing g_signal_emit() with g_signal_emit_by_name().

Yeti


--
Anonyms eat their boogers.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: help on scrollbars

2006-08-29 Thread Paul Pogonyshev
[EMAIL PROTECTED] wrote:
 Hi,
 I'm working on an app and I'm facing the need to access the
 button at the end of a vertical scrollbar of a scrolled window
 to do something like a
 
 gtk_button_clicked()
 
 to ensure that the widget (a treeview) contained in it
 gets scrolled to the end with whatever screen resolution
 is used.

Untested.  This might help:

gtk_adjustment_set_value (gtk_scrolled_window_get_adjustment (scrolled_window),
  DBL_MAX);

where `scrolled_window' contains the tree, of course.  Actually
`DBL_MAX' can be replaced with any large enough value, like
1e100, if you don't want to include `float.h'.

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