Re: gtkhruler in gtk3



Thanks for the tip Tristan. I'm also porting a few of the widgets from
the (I think orphaned) GIW project too, so you may be interested in
adding those also to egg.

https://sourceforge.net/projects/giw/

I have:
giwknob - a range widget
giwled - a simple "lamp" style togglebutton
giwvslder - a slider widget (I will probably make this an orientable giwslider)

I will add giwruler too.

So you should just be able to do a replace of giw with egg.

The only thing you might need to alter is that some of the widgets use
fixed colours rather than taking them from the stylecontext (for
example the dial surround is always rendered in black). If I can get
my head round stylecontext better, I might try to fix that myself.

Regards,
Salsaman.


http://lives.sourceforge.net
https://www.ohloh.net/accounts/salsaman


On Sun, Feb 17, 2013 at 11:37 AM, Tristan Van Berkom <tvb gnome org> wrote:
On Sun, Feb 17, 2013 at 9:00 PM, salsaman <salsaman gmail com> wrote:
Hi,
has anybody created a gtk3 widget similar to the gtkhruler in gtk2 ?
It could save me a lot of work.


The ruler was only removed in GTK+3 because it was judged to be
too specialized to have a place in the toolkit (not very many users
of that widget), not for any technical reason making it hard to
port.

If you take the ruler widget code from GTK+2, you should be
able to very easily use it compiling against GTK+3... You'll
need to change ->expose_event() and ->size_request()
appropriately (for ruler code, you should only need to
implement ->get_preferred_width()/->get_preferred_height()
since there's no complex height-for-width stuff to do
in there).

Perhaps, if you port the widget (as I mentioned it should
be quite easy), we could then add the ported version
to libegg, where people (if any) need it they can easily
copy it into their sources.

If you do this, one thing I would suggest is to make it
simply an EggRuler type that implements GtkOrientable,
instead of having separate H/V subclasses.

Cheers,
    -Tristan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]