Yasushi Shoji <yashi / yashi.com> wrote:
>At Sat, 23 Dec 2000 16:33:47 +0900,
>Kevin Smith wrote:
>> 
>> 1. Gtk::CList does not seem to have a "get 
>> selected" method, nor a "size" method like Tk. So 
>> I had to catch the select and unselect events and 
>> remember the current item for myself. And I had 
>> to keep track of the row count myself, also. It 
>> seems like I must just be missing something.
>
>Gtk::CList#columns

Actually, I found CList#rows, which is what I 
wanted. It's not listed in the official GTK+ 
online reference I was using.

>don't know about tk's "get selected"

I found each_selected (again, not in the GTK 
reference I was using), which I believe is what I 
was looking for. So far, I haven't gotten them to 
work for me, but I think it's because I haven't 
been storing data for each row, and they give you 
the data. And I think my little tests so far 
trying to store data have had a lifecycle/GC 
problem (in my own code).

>
>> 2. Based on the C API, I was expecting to find a 
>> method named CList#remove but it is actually 
>> CList#remove_row. 
>
>from ChangeLog:
>    - since Gtk::CList#remove conflict with Gtk::Continer#remove in name,
>      rename it to Gtk::CList#remove_row as Gtk--.
>
>Gtk+ core team has already admited that CList is broken from
>design. so can't complain, i guess.

This makes sense. I hadn't thought to look in the 
changelog.

>> 4. Widget creation is a bit different. In Tk, you 
>> specify the parent as part of the .new call. With 
>> GTK, you create the widget, and later tell the 
>> parent to add the widget to itself. 
>
>there was some trick if i'm not misunderstanding. don't remenber
>exactly.

This certainly is not a GTK problem. It's a 
difference that people porting from Tk need to be 
aware of, but I'm happier with GTK's approach.

>> 
>> 1. GTK does not require the distinction between 
>> root and toplevel. 
>
>with X, it does.  You can't create Root window, but you can create
>toplevel windows. dont' know about win32.

Oh. Well, in my little test, I'm creating two 
windows with the TOPLEVEL flag, and everything 
seems to be working fine. 

>hope this helps,

Thanks for your response. In case it wasn't 
clear, I wasn't criticizing Ruby/GTK. As I have 
said, I am quite happy with it. I just hoped to 
help anyone else who was porting from Tk.

Kevin