Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
422037ce
Commit
422037ce
authored
11 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
set custom fltk error handlers
parent
ec84f881
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Fltk/FlGui.cpp
+30
-0
30 additions, 0 deletions
Fltk/FlGui.cpp
with
30 additions
and
0 deletions
Fltk/FlGui.cpp
+
30
−
0
View file @
422037ce
...
...
@@ -198,9 +198,39 @@ static void gamepad_handler(void *data)
}
}
static
void
error_handler
(
const
char
*
fmt
,
...)
{
char
str
[
5000
];
va_list
args
;
va_start
(
args
,
fmt
);
vsnprintf
(
str
,
sizeof
(
str
),
fmt
,
args
);
va_end
(
args
);
if
(
!
strcmp
(
str
,
"Insufficient GL support"
)){
// this should be fatal
CTX
::
instance
()
->
terminal
=
1
;
Msg
::
Error
(
"%s (FLTK internal error)"
,
str
);
Msg
::
Fatal
(
"Your system does not seem to support OpenGL - aborting"
);
}
else
{
Msg
::
Error
(
"%s (FLTK internal error)"
,
str
);
}
}
static
void
fatal_error_handler
(
const
char
*
fmt
,
...)
{
char
str
[
5000
];
va_list
args
;
va_start
(
args
,
fmt
);
vsnprintf
(
str
,
sizeof
(
str
),
fmt
,
args
);
va_end
(
args
);
CTX
::
instance
()
->
terminal
=
1
;
Msg
::
Fatal
(
"%s (FLTK internal error)"
,
str
);
}
FlGui
::
FlGui
(
int
argc
,
char
**
argv
)
{
Fl
::
error
=
error_handler
;
Fl
::
fatal
=
fatal_error_handler
;
// set X display
if
(
CTX
::
instance
()
->
display
.
size
())
Fl
::
display
(
CTX
::
instance
()
->
display
.
c_str
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment