-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
129 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
|
||
message(STATUS "Python_COMMAND=${Python_COMMAND}") | ||
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") | ||
message(STATUS "PATH ENV 1=$ENV{PATH}") | ||
message(STATUS "PATH 1=${PATH}") | ||
string(REPLACE "|" ";" $ENV{PATH} "${PATH}") | ||
message(STATUS "PATH ENV 2=$ENV{PATH}") | ||
|
||
set(ROOT_DIR ${CMAKE_INSTALL_PREFIX}/../Python-prefix/src/Python) | ||
|
||
if (Python_COMMAND STREQUAL "build") | ||
set(CMD cmd /C PCbuild\\build.bat -e -q -p ${Python_PLATFORM}) | ||
elseif(Python_COMMAND STREQUAL "install") | ||
set(CMD cmd /C python.bat PC\\layout --precompile --preset-default --copy "${CMAKE_INSTALL_PREFIX}/bin/") | ||
else() | ||
message(FATAL_ERROR "Unknown Python_COMMAND ${Python_COMMAND}!") | ||
endif() | ||
|
||
message(STATUS "Running: ${CMD} in ${ROOT_DIR}...") | ||
|
||
execute_process( | ||
COMMAND ${CMD} | ||
WORKING_DIRECTORY ${ROOT_DIR} | ||
ERROR_VARIABLE BAT_CMD_ERROR | ||
OUTPUT_VARIABLE BAT_CMD_OUTPUT | ||
ECHO_ERROR_VARIABLE | ||
ECHO_OUTPUT_VARIABLE | ||
COMMAND_ERROR_IS_FATAL ANY | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# "$Id: demos.py 531 2019-12-27 12:15:45Z andreasheld $" | ||
# | ||
# Test program for pyFLTK the Python bindings | ||
# for the Fast Light Tool Kit (FLTK). | ||
# | ||
# FLTK copyright 1998-1999 by Bill Spitzak and others. | ||
# pyFLTK copyright 2003 by Andreas Held and others. | ||
# | ||
# This library is free software you can redistribute it and/or | ||
# modify it under the terms of the GNU Library General Public | ||
# License, version 2.0 as published by the Free Software Foundation. | ||
# | ||
# This library is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Library General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Library General Public | ||
# License along with this library if not, write to the Free Software | ||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
# USA. | ||
# | ||
# Please report all bugs and problems to "[email protected]". | ||
# | ||
|
||
|
||
from fltk14 import * | ||
|
||
class subwindow(Fl_Gl_Window): | ||
|
||
def __init__(self, x,y,w,h): | ||
super().__init__(x,y,w,h, "") | ||
|
||
def handle(self, event): | ||
if event == FL_PUSH: | ||
raise Exception("exception in handle") | ||
return super().handle(event) | ||
|
||
def draw(self): | ||
pass | ||
|
||
|
||
|
||
class MyButton(Fl_Button): | ||
def __init__(self, x,y,w,h, l): | ||
super().__init__(x,y,w,h, l) | ||
self.callback(self.b_cb) | ||
|
||
def b_cb(self, wid): | ||
raise Exception("exception in callback") | ||
|
||
if __name__=='__main__': | ||
window = Fl_Double_Window(0, 0, 500, 500, "tst") | ||
|
||
widget = subwindow(0,0,500,400) | ||
window.resizable(widget) | ||
|
||
mb = MyButton(200,420,100,60, "Exit") | ||
|
||
|
||
try: | ||
window.end() | ||
window.show() | ||
Fl.run() | ||
except Exception as e: | ||
print("Exception: ", e) | ||
|