Community
Participate
Working Groups
When compiling with GSEAL_ENABLE I am getting this errors: os.c: In function ‘Java_org_eclipse_swt_internal_gtk_OS_GTK_1RANGE_1HAS_1STEPPER_1A’: os.c:158:17: error: ‘GtkRange’ has no member named ‘has_stepper_a’ os.c: In function ‘Java_org_eclipse_swt_internal_gtk_OS_GTK_1RANGE_1HAS_1STEPPER_1B’: os.c:170:17: error: ‘GtkRange’ has no member named ‘has_stepper_b’ os.c: In function ‘Java_org_eclipse_swt_internal_gtk_OS_GTK_1RANGE_1HAS_1STEPPER_1C’: os.c:182:17: error: ‘GtkRange’ has no member named ‘has_stepper_c’ os.c: In function ‘Java_org_eclipse_swt_internal_gtk_OS_GTK_1RANGE_1HAS_1STEPPER_1D’: os.c:194:17: error: ‘GtkRange’ has no member named ‘has_stepper_d’ These deprecated constants are used in : Scrollbar widget Looking at GTK API I can assume that GtkRange's methods: gtk_range_get_lower_stepper_sensitivity gtk_range_get_upper_stepper_sensitivity could help replacing this constants. (not 100% sure) And if they will, how to get other 2 steppers ?
(In reply to comment #0) > When compiling with GSEAL_ENABLE I am getting this errors: > > os.c: In function > ‘Java_org_eclipse_swt_internal_gtk_OS_GTK_1RANGE_1HAS_1STEPPER_1A’: > os.c:158:17: error: ‘GtkRange’ has no member named ‘has_stepper_a’ > os.c: In function > ‘Java_org_eclipse_swt_internal_gtk_OS_GTK_1RANGE_1HAS_1STEPPER_1B’: > os.c:170:17: error: ‘GtkRange’ has no member named ‘has_stepper_b’ > os.c: In function > ‘Java_org_eclipse_swt_internal_gtk_OS_GTK_1RANGE_1HAS_1STEPPER_1C’: > os.c:182:17: error: ‘GtkRange’ has no member named ‘has_stepper_c’ > os.c: In function > ‘Java_org_eclipse_swt_internal_gtk_OS_GTK_1RANGE_1HAS_1STEPPER_1D’: > os.c:194:17: error: ‘GtkRange’ has no member named ‘has_stepper_d’ > > > > These deprecated constants are used in : Scrollbar widget > > > Looking at GTK API I can assume that GtkRange's methods: > > gtk_range_get_lower_stepper_sensitivity > gtk_range_get_upper_stepper_sensitivity > > could help replacing this constants. (not 100% sure) And if they will, how > to get other 2 steppers ? Update: The function that is suitable for this case is: gtk_range_get_range_rect () But I am still wondering how to test steppers, as all the snippets that are out there return false.
(In reply to comment #1) > (In reply to comment #0) > > When compiling with GSEAL_ENABLE I am getting this errors: > > > > os.c: In function > > ‘Java_org_eclipse_swt_internal_gtk_OS_GTK_1RANGE_1HAS_1STEPPER_1A’: > > os.c:158:17: error: ‘GtkRange’ has no member named ‘has_stepper_a’ > > os.c: In function > > ‘Java_org_eclipse_swt_internal_gtk_OS_GTK_1RANGE_1HAS_1STEPPER_1B’: > > os.c:170:17: error: ‘GtkRange’ has no member named ‘has_stepper_b’ > > os.c: In function > > ‘Java_org_eclipse_swt_internal_gtk_OS_GTK_1RANGE_1HAS_1STEPPER_1C’: > > os.c:182:17: error: ‘GtkRange’ has no member named ‘has_stepper_c’ > > os.c: In function > > ‘Java_org_eclipse_swt_internal_gtk_OS_GTK_1RANGE_1HAS_1STEPPER_1D’: > > os.c:194:17: error: ‘GtkRange’ has no member named ‘has_stepper_d’ > > > > > > > > These deprecated constants are used in : Scrollbar widget > > > > > > Looking at GTK API I can assume that GtkRange's methods: > > > > gtk_range_get_lower_stepper_sensitivity > > gtk_range_get_upper_stepper_sensitivity > > > > could help replacing this constants. (not 100% sure) And if they will, how > > to get other 2 steppers ? > > Update: > > The function that is suitable for this case is: gtk_range_get_range_rect () > > But I am still wondering how to test steppers, as all the snippets that are > out there return false. Here is the patch that I would like to propose: http://fedorapeople.org/cgit/aspektor/public_git/eclipse.platform.swt.git/commit/?h=gtk_has_stepper Explanation behind it: http://developer.gnome.org/gtk/2.24/GtkRange.html#gtk-range-get-range-rect Documentation Says: "This function returns the area that contains the range's trough and its steppers, in widget->window coordinates. " So I thought if "range_rect" contains steppers in the coordinates, why not to check if coordinates of range_rect (width, height, x,y) are zero, if they are, most probably there are no steppers. Does it make sense ? If you disagree with this approach, I would love to hear any ideas on how this issue can be approached. Regards, Anatoly
I did not check but it seems your patch would fail since the doc says it includes the area for the range trough's. If I understand correctly the width, height of the rectangle would never be zero (unless the scrollbar size is small). Does it work if you check the value of these properties? http://developer.gnome.org/gtk/stable/GtkScrollbar.html#GtkScrollbar--s-has-backward-stepper http://developer.gnome.org/gtk/stable/GtkScrollbar.html#GtkScrollbar--s-has-forward-stepper http://developer.gnome.org/gtk/stable/GtkScrollbar.html#GtkScrollbar--s-has-secondary-backward-stepper http://developer.gnome.org/gtk/stable/GtkScrollbar.html#GtkScrollbar--s-has-secondary-forward-stepper
I seems promising. Tried this and it returned good values: int[] hasA = new int[1]; OS.gtk_widget_style_get (handle, "has-backward-stepper\0".getBytes(), hasA, 0); System.out.println("has back=" + hasA[0]); OS.gtk_widget_style_get (handle, "has-secondary-backward-stepper\0".getBytes(), hasA, 0); System.out.println("has secondary=" + hasA[0]);
(In reply to comment #4) > I seems promising. Tried this and it returned good values: > > int[] hasA = new int[1]; > OS.gtk_widget_style_get (handle, "has-backward-stepper\0".getBytes(), hasA, > 0); > System.out.println("has back=" + hasA[0]); > OS.gtk_widget_style_get (handle, > "has-secondary-backward-stepper\0".getBytes(), hasA, 0); > System.out.println("has secondary=" + hasA[0]); Good call, I made series of tests and it returns correct values. As I was playing with the code I incorporated example you posted, I hope you don't mind! If you would like to use patch I made basing on sample you gave, please go ahead: http://fedorapeople.org/cgit/aspektor/public_git/eclipse.platform.swt.git/commit/?h=gtk_has_stepper
- What version those style properties where added? If they have been there long enough, you can remove GTK_RANGE_HAS_STEPPER_A,B,C,D, otherwise you have to add a version check and run the old code (no need for helpers, since it is used only once). - Need to create the string constants in OS. Take a look at OS.gtk_double_click_time for an example.
(In reply to comment #6) > - What version those style properties where added? If they have been there > long enough, you can remove GTK_RANGE_HAS_STEPPER_A,B,C,D, otherwise you > have to add a version check and run the old code (no need for helpers, since > it is used only once). > > - Need to create the string constants in OS. Take a look at > OS.gtk_double_click_time for an example. What I did: 1. As you have pointed out gtk_widget_get_style is "old" enough to replace GTK_RANGE_HAS_STEPPER, thus I've removed GTK_RANGE_HAS_STEPPER functions 2. I have added constants for every stepper property and put in gtk_widget_get_style 3. I have amended my previous commit, and the new version is available here: http://fedorapeople.org/cgit/aspektor/public_git/eclipse.platform.swt.git/commit/?h=gtk_has_stepper Is there anything else I am missing ? Thank you for your time, Anatoly
Thanks. Pushed to eclipse.org. http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=a215b82e21c4662f93a9c3b2b1fa9b09bb89fa3f