00001 /*-------------------------------------------------------------------- 00002 * vlistbox.h 00003 * 00004 */ 00005 00006 #ifndef VLISTBOX_H 00007 #define VLISTBOX_H 00008 00009 #include "tcltk_calling_convention.h" 00010 #include "vwidget.h" 00011 00012 class vnode; 00013 class binding; 00014 00015 struct listbox_entry { 00016 vnode *object; 00017 binding *bd; 00018 00019 listbox_entry(vnode *vn, binding *b) { object = vn; bd = b; } 00020 }; 00021 00022 class vlistbox : public vwidget { 00023 00024 private: 00025 00026 //array_tos<listbox_entry*> entries; 00027 list<listbox_entry*> entries; 00028 00029 public: 00030 vlistbox(vwidget *par, char *title, bool horizontal_slider = false ); 00031 ~vlistbox(void); 00032 void destroy(void); 00033 virtual int kind(void) { return WIDGET_LISTBOX; } 00034 00035 void add(binding *b, vnode *object, char *text); 00036 void clear(void); 00037 00038 /* interface with tcl/tk */ 00039 static int TCLTK_CALLING_CONVENTION vlistbox_cmd(ClientData clientData, Tcl_Interp *interp, int argc, 00040 char *argv[]); 00041 00042 }; 00043 00044 #endif