Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2000-02

[TListbox]

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Shane Miller

Glib types huh? That would explain it.

Can someone look at the implementation of ListBox. I have but haven't figured it out. It's not working. For example, run lazarus and select FILE - NEW UNIT 3 times so you create 3 units. You won't notice the units being created.

Then, select VIEW - UNITS and a dialog will appear with UNIT1 UNIT2 and UNIT3 in it. When you select one, the name should appear in the edit box. I do that by using the onclick of the Listbox and running through listbox.items.count checking the Selected[I] value. If true, I write that name to the edit box.

Watch the debug code as you select one and you'll see it calls LM_GETSEL 3 times (once for each entry) passing it the index (0 first, 1 second and 2 the third time) and each time it gets a -1 as the result from the function call g_list_position. It never finds that GList in the SELECTION list.

Any ideas???

Shane

>> 02/23/00 03:19PM >>>
Shane Miller wrote
Where is the definition for glist or pglist? What is it? I can't find it in the gtk documentaion.

Because they are glib types...

Also, where is g_list_nth and g_list_position defined?

In glib, too.

- Sebastian

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

Where is the definition for glist or pglist? What is it? I can't find it in the gtk documentaion.

Also, where is g_list_nth and g_list_position defined?

Shane

Reply by email

Michal Bukovjan

Should not this be rather an equivalent to TListView?

Michal Bukovjan

Hans-Joachim Ott wrote 30 lines
Hello Shane! As you might remember, I'm interested in having a listbox in Linux which has columns. Since I found no way to have it with the current implementation based on the Gtk List widget, I made some code to have it based on the CList widget. It seems that it's much more easy to use than the List widget and it supports columns and other stuff currently not implemented in lcl, e.g. ListBox.Items.Objects[] and ..Items.Begin/EndUpdate. Also the Gtk tutorial prefers the CList widget. As a start, I've - added a new component (csCListBox) to vclglobals.pp - added some blocks for csCListBox to gtkobjects.inc - added a GtkCListStringList to gtklistsl(h).inc - created a component TCListBox = class(TListBox) - made a small form containing some buttons and such a listbox, to test it It has currently all the functionality of csListBox, plus ListBox.Items.Objects[], and it seems to work. Before I add more functionality (which might require new LM_ messages), I'd like to know if you would like to put this code into lcl, to replace csListBox (or maybe as add-on?), or if I should move my code into a unit of my own and make a separate component. Shall I send you the files? Kind regards, Hans _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

____________________________________________________________________ Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.

Reply by email