Mail Archives: geda-user/2012/03/28/08:41:22
On Tue, 2012-03-27 at 23:31 -0500, John Griessen wrote:
> On 03/27/2012 06:49 PM, Stefan Salewski wrote:
> > What do you think about my new grid selector?
> >
> > http://www.ssalewski.de/PetEd.html.en
>
> The image of it looks good.
Hmm -- I have just used the Stock apply image, looks not to bad, and
apply term is not too wrong. I need some indication for what grid is the
active snap grid. One toggle button is basically sufficient, but these
two symmetrically radio buttons looks nicer for me, and consumes not
really much area in the toolbar
> Is your code ready for people to test it?
> Easy to compile?
>
> John
No compile necessary, it is pure Ruby. Extract the archives and type
"ruby peted.rb" in a shell window to start it, if you really want to
play with it. But as stated on my page, it is absolutely useless
currently. Of course you need Ruby (1.9.x) and GTK/Cairo bindings
installed.
The coding is very easy, similar as in gtk-demo program shipped with
GTK. One trick is, that we connect to the "activate" signal of the entry
child of the combobox to detect when user presses 'Enter' key after
manual grid input. First I tried the "changed" signal, so I got an
signal for each keystroke, which results in grids 7 and 75 when user
types "75" -- unwanted redraw with grid 7 first. I had to ask at
gtk-list for this.
I made a class for this extended widget, because I need two of them. I
do not know if or how we can do that in plain C (guess GLIB may support
that) but of course we do not need a class. So it should be not really a
problem integrating something like that in gschem -- for someone
familiar with gschems code base. (The ruby code in in file peted.rb,
near the top, only 65 lines.)
- Raw text -