paragui-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-cvs] CVS: paragui/test listbox.cpp,NONE,1.1.2.1 Makefile.am,1.2


From: Alexander Pipelka <address@hidden>
Subject: [paragui-cvs] CVS: paragui/test listbox.cpp,NONE,1.1.2.1 Makefile.am,1.2,1.2.6.1
Date: Thu, 02 May 2002 04:45:40 -0400

Update of /cvsroot/paragui/paragui/test
In directory subversions:/tmp/cvs-serv32451/test

Modified Files:
      Tag: devel-1-0
        Makefile.am 
Added Files:
      Tag: devel-1-0
        listbox.cpp 
Log Message:
removed unneccessary mutex locks
added check for strdup
added replacement if strdup is unavailable
fixed deletion of listboxitems within the message handler



--- NEW FILE ---
#include "paragui.h"
#include "pgapplication.h"
#include "pglistbox.h"
#include "pglistboxitem.h"

PARAGUI_CALLBACK(handleListBoxItem) {
        PG_ListBoxItem* item = reinterpret_cast<PG_ListBoxItem*>(data);
        delete item;
        return true;
}

int main( int argc, char **argv )
{
        PG_Application app;
        
        app.LoadTheme( "default" );
        
        app.InitScreen( 640, 480, 0 );
        app.SetEmergencyQuit(true);
        
        PG_ListBox listbox(NULL, PG_Rect(10,10,300,100));
        listbox.SetEventCallback(MSG_SELECTITEM, handleListBoxItem);
        
        listbox.AddItem(new PG_ListBoxItem(25, "Item1"));
        listbox.AddItem(new PG_ListBoxItem(25, "Item2"));
        listbox.AddItem(new PG_ListBoxItem(25, "Item3"));
        listbox.AddItem(new PG_ListBoxItem(25, "Item4"));
        listbox.AddItem(new PG_ListBoxItem(25, "Item5"));
        listbox.AddItem(new PG_ListBoxItem(25, "Item6"));
        listbox.AddItem(new PG_ListBoxItem(25, "Item7"));
        listbox.AddItem(new PG_ListBoxItem(25, "Item8"));
        listbox.AddItem(new PG_ListBoxItem(25, "Item9"));
        listbox.AddItem(new PG_ListBoxItem(25, "Item10"));
        listbox.Show();
        

        app.Run();
        
        return 0;
}

Index: Makefile.am
===================================================================
RCS file: /cvsroot/paragui/paragui/test/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.2.6.1
diff -C2 -r1.2 -r1.2.6.1
*** Makefile.am 15 Apr 2002 13:31:31 -0000      1.2
--- Makefile.am 2 May 2002 08:45:36 -0000       1.2.6.1
***************
*** 1,5 ****
  AUTOMAKE_OPTIONS = foreign
  
! bin_PROGRAMS = animation dropdown paratest dblbuffer navtest windowtest 
layouttest windowresize
  
  windowresize_SOURCES = windowresize.cpp
--- 1,8 ----
  AUTOMAKE_OPTIONS = foreign
  
! bin_PROGRAMS = listbox animation dropdown paratest dblbuffer navtest 
windowtest layouttest windowresize
! 
! listbox_SOURCES = listbox.cpp
! listbox_LDADD = $(PARAGUI_LIBS)
  
  windowresize_SOURCES = windowresize.cpp




reply via email to

[Prev in Thread] Current Thread [Next in Thread]