mirror of
https://github.com/KeithDHedger/LFSDesktopProject.git
synced 2026-01-13 05:42:05 +00:00
66 lines
1.8 KiB
C++
Executable File
66 lines
1.8 KiB
C++
Executable File
#if 0
|
|
|
|
#(c)keithhedger Fri 28 Jul 20:19:00 BST 2017 kdhedger68713@gmail.com
|
|
|
|
if [ "X$1" != "X" ];then
|
|
USEVALGRIND="valgrind --leak-check=full"
|
|
fi
|
|
|
|
g++ "$0" -O0 -ggdb -I../LFSToolKit -L../LFSToolKit/app/.libs $(pkg-config --cflags --libs x11 xft cairo ) -llfstoolkit -lImlib2 -o windowexample||exit 1
|
|
LD_LIBRARY_PATH=../LFSToolKit/app/.libs $USEVALGRIND ./windowexample "$@"
|
|
retval=$?
|
|
echo "Exit code $retval"
|
|
rm windowexample
|
|
exit $retval
|
|
#endif
|
|
|
|
#include "../config.h"
|
|
#include "lfstk/LFSTKGlobals.h"
|
|
|
|
#define BOXLABEL "Basic Window"
|
|
|
|
|
|
LFSTK_applicationClass *apc=NULL;
|
|
LFSTK_windowClass *wc=NULL;
|
|
LFSTK_labelClass *label=NULL;
|
|
|
|
bool windowDrop(LFSTK_windowClass *lwc,void* ud)
|
|
{
|
|
if(lwc!=NULL)
|
|
printf("dropped %s on window @x/y %i %i\n",lwc->droppedData.data,lwc->droppedData.x,lwc->droppedData.y);
|
|
return(true);
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
int sy=0;
|
|
|
|
apc=new LFSTK_applicationClass();
|
|
apc->LFSTK_addWindow(NULL,BOXLABEL);
|
|
wc=apc->mainWindow;
|
|
wc->passEventToRoot=true;
|
|
|
|
wc->LFSTK_initDnD(true);
|
|
wc->LFSTK_setWindowDropCallBack(windowDrop,USERDATA(0xdeadbeef));
|
|
//wc->dropCB.runTheCallback=false;
|
|
|
|
label=new LFSTK_labelClass(wc,COPYRITE,BORDER,sy,DIALOGWIDTH-BORDER-BORDER,GADGETHITE);
|
|
sy+=HALFYSPACING;
|
|
label=new LFSTK_labelClass(wc,PERSONAL,BORDER,sy,DIALOGWIDTH-BORDER-BORDER,GADGETHITE);
|
|
label->LFSTK_setCairoFontDataParts("B");
|
|
sy+=YSPACING;
|
|
|
|
label=new LFSTK_labelClass(wc,BOXLABEL,BORDER,sy,DIALOGWIDTH-BORDER-BORDER,GADGETHITE);
|
|
label->LFSTK_setCairoFontDataParts("sB",20);
|
|
sy+=YSPACING;
|
|
sy+=200;
|
|
|
|
wc->LFSTK_resizeWindow(DIALOGWIDTH,sy,true);
|
|
wc->LFSTK_showWindow();
|
|
//fprintf(stderr,"%s\n",wc->globalLib->LFSTK_getGlobalString(-1,TYPEMONOFONT));
|
|
printf("Number of gadgets in window=%i\n",wc->LFSTK_gadgetCount());
|
|
int retval=apc->LFSTK_runApp();
|
|
delete apc;
|
|
cairo_debug_reset_static_data();
|
|
return(retval);
|
|
} |