Re: Ruler Class in GTK+ 3

2015-01-09 Thread Emmanuele Bassi
hi;

On 9 January 2015 at 17:51, Marcus Karlsson  wrote:
> On Fri, Jan 09, 2015 at 04:12:12PM +, Emmanuele Bassi wrote:
>> my suggestion is to look at ruler widgets in GIMP and Inkscape.
>
> Either that, or the GtkRuler widget itself from GTK 2 [1]. It doesn't
> look like it's very complicated and can probably be ported to GTK 3
> without too much effort, you just have to keep a copy of it in your app.

assuming the licensing terms are compatible, obviously.

to be fair, GtkRuler hasn't been maintained for a long, long time, and
any porting effort from the old GTK drawing semantics to the new ones
is probably going to be considerably more expensive than just using a
GtkDrawingArea and 25 lines of Cairo drawing code.

ciao,
 Emmanuele.

-- 
https://www.bassi.io
[@] ebassi [@gmail.com]
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Ruler Class in GTK+ 3

2015-01-09 Thread Emmanuele Bassi
hi;

On 9 January 2015 at 18:14, Carlos Pereira
 wrote:
> This is really unfortunate, my application also has a ruler... GTK is really
> moving away from its users,

where "its users" is a small subset of people using a single, niche
widget and who did not show up when said widget was on the pile of
widgets to potentially deprecate:

 * https://mail.gnome.org/archives/gtk-devel-list/2000-October/msg00163.html
 - yes, 2000. it was before GTK 2.0, and GtkRuler was definitely on
the chopping board. sadly, we did not get around deprecating it
immediately.

 * https://mail.gnome.org/archives/gtk-devel-list/2009-October/msg00111.html
 - first discussion about deprecating over-specialized, unmaintained,
niche widgets

 * https://bugzilla.gnome.org/show_bug.cgi?id=613942
 - tracking bug from 2010 about deprecating said widgets

care to be slightly less melodramatic in the future? alternatively, if
you find a deprecated widget, you can step up and maintain it. we can
"undeprecate" it, after all.

ciao,
 Emmanuele.

>> none. GtkRuler was deprecated in GTK+ 2.x and removed in GTK+ 3.x.
>> it's a*very*  niche widget, and most applications that use one in
>> their UI ended up having their own class.
>>
>> my suggestion is to look at ruler widgets in GIMP and Inkscape.
>>
>> if you want to draw your own, you can use a GtkDrawingArea subclass
>> with a custum draw() virtual function.
>>
>> ciao,
>>   Emmanuele.
>>
>
>
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



-- 
https://www.bassi.io
[@] ebassi [@gmail.com]
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Ruler Class in GTK+ 3

2015-01-09 Thread Carlos Pereira
This is really unfortunate, my application also has a ruler... GTK is 
really moving away from its users,

C

none. GtkRuler was deprecated in GTK+ 2.x and removed in GTK+ 3.x.
it's a*very*  niche widget, and most applications that use one in
their UI ended up having their own class.

my suggestion is to look at ruler widgets in GIMP and Inkscape.

if you want to draw your own, you can use a GtkDrawingArea subclass
with a custum draw() virtual function.

ciao,
  Emmanuele.
   


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


Re: Ruler Class in GTK+ 3

2015-01-09 Thread Stefan Sauer
On 01/09/2015 05:12 PM, Emmanuele Bassi wrote:
> hi;
>
> On 9 January 2015 at 16:02, Kamalpreet Grewal  
> wrote:
>
>> I am trying to add ruler to my application based on GTK+ 3.
>>
>> A class namely  is available in GTK2. I havebeen trying to find a
>> class serving the purpose of ruler in GTK+ 3.
>>
>> What are the possible classes available for this implementation?
> none. GtkRuler was deprecated in GTK+ 2.x and removed in GTK+ 3.x.
> it's a *very* niche widget, and most applications that use one in
> their UI ended up having their own class.
>
> my suggestion is to look at ruler widgets in GIMP and Inkscape.
>
> if you want to draw your own, you can use a GtkDrawingArea subclass
> with a custum draw() virtual function.
>
> ciao,
>  Emmanuele.
>
+1 you essentially need a draw function. This is what I did when porting
to gtk+-3
https://github.com/Buzztrax/buzztrax/blob/master/src/ui/edit/signal-analysis-dialog.c#L552-615
there is a 2nd with a log scale in the same file.

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


Re: Ruler Class in GTK+ 3

2015-01-09 Thread Marcus Karlsson
On Fri, Jan 09, 2015 at 04:12:12PM +, Emmanuele Bassi wrote:
> my suggestion is to look at ruler widgets in GIMP and Inkscape.

Either that, or the GtkRuler widget itself from GTK 2 [1]. It doesn't
look like it's very complicated and can probably be ported to GTK 3
without too much effort, you just have to keep a copy of it in your app.

Marcus

[1] https://git.gnome.org/browse/gtk+/tree/gtk/gtkruler.c?h=gtk-2-24
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Ruler Class in GTK+ 3

2015-01-09 Thread Emmanuele Bassi
hi;

On 9 January 2015 at 16:02, Kamalpreet Grewal  wrote:

> I am trying to add ruler to my application based on GTK+ 3.
>
> A class namely  is available in GTK2. I havebeen trying to find a
> class serving the purpose of ruler in GTK+ 3.
>
> What are the possible classes available for this implementation?

none. GtkRuler was deprecated in GTK+ 2.x and removed in GTK+ 3.x.
it's a *very* niche widget, and most applications that use one in
their UI ended up having their own class.

my suggestion is to look at ruler widgets in GIMP and Inkscape.

if you want to draw your own, you can use a GtkDrawingArea subclass
with a custum draw() virtual function.

ciao,
 Emmanuele.

-- 
https://www.bassi.io
[@] ebassi [@gmail.com]
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Ruler Class in GTK+ 3

2015-01-09 Thread Kamalpreet Grewal
On Fri, Jan 9, 2015 at 9:32 PM, Kamalpreet Grewal
 wrote:
> A class namely  is available in GTK2.

namely gtkruler

-- 
Kamalpreet Kaur Grewal
Blog: http://kamalpreetgrewal.com/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Ruler Class in GTK+ 3

2015-01-09 Thread Kamalpreet Grewal
Hi

I am trying to add ruler to my application based on GTK+ 3.

A class namely  is available in GTK2. I havebeen trying to find a
class serving the purpose of ruler in GTK+ 3.

What are the possible classes available for this implementation?

-- 
Kamalpreet Kaur Grewal
Blog: http://kamalpreetgrewal.com/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list