Re: gtkhruler in gtk3



On Sun, Feb 17, 2013 at 11:37:28PM +0900, Tristan Van Berkom wrote:
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.

I forked GtkRuler a long time ago because I needed stuff such as
different units, scientific number format, etc.

I have a Gtk+3 version now (not much theming support), you can see how
it looks here

    http://gwyddion.net/gwyddion-3/libgwyui/GwyRuler.html

and the code is

    https://sourceforge.net/p/gwyddion/code/HEAD/tree/branches/GWYDDION-3/libgwyui/ruler.c

but it's much more dependent on other Gwyddion stuff than GwyScroller I
linked couple of days ago so it's probably difficult to reuse.

Concerining the requirement to implement GtkOrientalble, that's mostly
frameworkish rubbish.  Rulers can be placed on *four* possible sides of
some area.  So they have up/down/left/right looks and orientations, not
two.

Regards,

Yeti



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