mirror of
https://github.com/gryf/window-maker.github.io.git
synced 2025-12-17 11:10:18 +01:00
Add WINGs tutorial
The original website is http://www.quantitativefinanceservices.com/OpenDir/WINGslib/WINGToc.html and it had the following notice at the bottom: Copyright (c) 2010 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". So we are fine.
This commit is contained in:
committed by
Doug Torrance
parent
beb38913b4
commit
6c515667a7
34
WINGs_tutorial/SecondWindow.c
Normal file
34
WINGs_tutorial/SecondWindow.c
Normal file
@@ -0,0 +1,34 @@
|
||||
void closeAll(WMWidget *self,void *data){
|
||||
fprintf(stderr,"I've been used!\n");
|
||||
WMDestroyWidget(self);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main (int argc, char **argv){
|
||||
|
||||
Display *display;
|
||||
WMScreen *screen;
|
||||
|
||||
WMWindow *win;
|
||||
WMColor *color;
|
||||
|
||||
WMInitializeApplication("SecondWin", &argc, argv);
|
||||
|
||||
if (!(display = XOpenDisplay(""))){
|
||||
fprintf(stderr, "cannot open display\n");
|
||||
exit(1);
|
||||
}
|
||||
screen = WMCreateScreen(display, DefaultScreen(display));
|
||||
|
||||
win = WMCreateWindow(screen, "");
|
||||
WMSetWindowCloseAction(win, closeAll, NULL);
|
||||
color = WMCreateRGBColor(screen,124<<9,206<<8,162<<8, False);
|
||||
WMSetWidgetBackgroundColor((WMWidget *)win, color);
|
||||
|
||||
WMMapWidget(win);
|
||||
WMRealizeWidget(win);
|
||||
|
||||
WMScreenMainLoop(screen);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user