question about listbox

Started by ashleybeshir, 17 July 2015, 15:36:53

ashleybeshir

let say i create the variable like this

    tgui::ListBox::Ptr box;

how do i add the gui bit so i can draw to window. because i want to create the variable separate

texus

You can call gui.add(box).

I know that there may be some font related problems in certain situations when doing this, but I think I have fixed the most common ones. But it is still advised to add it to the gui before setting properties like its text and text size. The widget is only given a font at the moment it is added to the gui (which is normally immediately at creation) so some text related function might do nothing when no font has been set yet. But it might work to call gui.add after all the other function, I just don't guarantee that it will in tgui 0.6.

ashleybeshir

Thank u very much for your reply . I got it working now but i noticed something weird about my listbox . I attached pic with this post . As u can see the spacing between members aren't really align correctly

texus

I think I already know what the problem is, I'll see if it can be solved easily.

texus

A fix has been made, you can download the new version from the master branch on github. You have to compile the library yourself with cmake, there are tutorials for this on my site.

ashleybeshir

Sorry for the late reply. Thank u very much for the fix