[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

cells-gtk3 listboxes and probably other stuff later

Antsan

2/2/2016 11:14:00 PM

I'm trying to write my first GUI ever and it's already looking awful. That itself
is not such a big problem, as I can always make it look nice later.

I don't know how to make listboxes work and I desperately need them.
This is the code I've got:
(defmd mang (gtk-app)
:title "mang"
:position :center
:width 800 :height 600
:kids
(kids-list?
(+hbox ()
(+vbox ()
(+hbox ()
(+label "Current word:")
(+entry :current-word "")
)
(+label
(c? (let
((word (list->string
(first (alphabet-match (widget-value :current-word "")
*test-alphabet*)))))
(if (string= word "")
"··This is not a word written in the given alphabet··"
word))))
(mk-scrolled-window
:kids
(kids-list?
(mk-listbox :items (c? (mapcar #'list->string
(alphabet-match (widget-value :current-word "")
*test-alphabet*)))
:print-fn (lambda (item)
(list item)))))
)
(+vbox (:fill t)
)
)
))
The macros +label, +entry and so on are just nicer to use wrappers around the
corresponding mk- functions. They don't do anything special at all.

When I start the program and enter something in the entry field the label
showing the first decomposition of the entered word updates just fine and
displays what I expect, yet the listbox stays empty, although its width changes,
so there is probably some kind of update going on.

So, what am I doing wrong here?
4 Answers

Antsan

2/4/2016 2:11:00 PM

0

Nobody has any idea how to do listboxes in cells-gtk3?
I've taken a look at the cl-gtk documentation, but I haven't found anything
usable.

cells-gtk-doc on github has working examples, but I have no idea why the work. The
code is largely uncommented and the listboxes in the code aren't wrapped in
anything special nor do they have any keywords specified which point to anything
else which would be responsible for making the items in the list actually appear
in the GUI.

Kenneth Tilton

2/5/2016 1:25:00 PM

0

On Thursday, February 4, 2016 at 9:11:12 AM UTC-5, Antsan wrote:
> Nobody has any idea how to do listboxes in cells-gtk3?

I think most of us have moved on to the Web as our GUI.

Cells-gtk3 was left on my doorstep by its author and got some initial support but nothing in several years. Can you find the cells-gtk3 mailing list? That might produce something.

> I've taken a look at the cl-gtk documentation, but I haven't found anything
> usable.
>
> cells-gtk-doc on github has working examples, but I have no idea why the work. The
> code is largely uncommented and the listboxes in the code aren't wrapped in
> anything special nor do they have any keywords specified which point to anything
> else which would be responsible for making the items in the list actually appear
> in the GUI.

But as you say, they work. So copy/paste into your own code and see if it still works (kind of a sanity check). Now start introducing your changes one by one and notice when it stops working etc etc.

LTk still gets support from Mr. Herth, but then you do not have Cells.

There is my Celtk (Cells+Tk) library out there (from which Cells-Gtk was derived) but I have not touched it in years.

If you would consider the web, there is my qooxlisp library (qooxdoo+Cells) or you could start messing around with Clojure, ClojureScript, and esp Hoplon which has Javelin (Cells-alike).

hth, kt

Antsan

2/5/2016 4:05:00 PM

0

Am Freitag, 5. Februar 2016 14:24:52 UTC+1 schrieb His Kennyness:
> On Thursday, February 4, 2016 at 9:11:12 AM UTC-5, Antsan wrote:
> > Nobody has any idea how to do listboxes in cells-gtk3?
>
> I think most of us have moved on to the Web as our GUI.
I know it's popular and I kind of get why, but I personally prefer non-browser
interfaces myself. If only to not have to start up my browser, which is
overburdened with open tabs, only to do some little thing.

> Cells-gtk3 was left on my doorstep by its author and got some initial support but nothing in several years. Can you find the cells-gtk3 mailing list? That might produce something.
The one link to a mailing list for cells-gtk3 I found is dead. There is one for
cells-gtk, though. As the 3 everywhere else is always explicit I'll assume this
one's for cells with gtk2, but the last entry was in January 2014, which is
after cells-gtk3 came out, iirc, so there's some hope. Although not much.

> > I've taken a look at the cl-gtk documentation, but I haven't found anything
> > usable.
> >
> > cells-gtk-doc on github has working examples, but I have no idea why the work. The
> > code is largely uncommented and the listboxes in the code aren't wrapped in
> > anything special nor do they have any keywords specified which point to anything
> > else which would be responsible for making the items in the list actually appear
> > in the GUI.
>
> But as you say, they work. So copy/paste into your own code and see if it still works (kind of a sanity check). Now start introducing your changes one by one and notice when it stops working etc etc.
Yeah, I guess I'll have to do that. Or something similar. I guess I'm going to
reduce it to the minimal code that still shows me a working listbox.

> LTk still gets support from Mr. Herth, but then you do not have Cells.
>
> There is my Celtk (Cells+Tk) library out there (from which Cells-Gtk was derived) but I have not touched it in years.
>
> If you would consider the web, there is my qooxlisp library (qooxdoo+Cells) or you could start messing around with Clojure, ClojureScript, and esp Hoplon which has Javelin (Cells-alike).
If cells-gtk3 turns out to be unworkable for me I'll try Celtk and after that
I'll probably try LTk, but not using cells for the GUI would be kind of sad.

Antsan

2/7/2016 8:53:00 PM

0

I found what I did wrong. It is kind of embarrassing, because the missing bit
actually was inside the MK-LISTBOX call.

This is how it should look:

(mk-listbox
:items (c? (compute items here))
:print-fn (lambda (item)
(list (convert item to string here)))
;; and now for what was missing:
:columns (def-columns
(:string (:title "Some appropriate title here."))))

I just assumed that columns with an empty header would be generated and then
forgot about that assumption when my version of doing it didn't work.