Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zmap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
zmap
Commits
ddf7a0ec
Commit
ddf7a0ec
authored
18 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
clean up exit code so it all goes through the top level widget destroy callback.
parent
2930ec21
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/zmapApp/zmapAppmenubar.c
+6
-3
6 additions, 3 deletions
src/zmapApp/zmapAppmenubar.c
src/zmapApp/zmapAppremote.c
+5
-5
5 additions, 5 deletions
src/zmapApp/zmapAppremote.c
src/zmapApp/zmapAppwindow.c
+38
-12
38 additions, 12 deletions
src/zmapApp/zmapAppwindow.c
with
49 additions
and
20 deletions
src/zmapApp/zmapAppmenubar.c
+
6
−
3
View file @
ddf7a0ec
...
...
@@ -26,9 +26,9 @@
* Description:
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited:
Feb 2
6 10:
29
200
4
(edgrif)
* Last edited:
Mar
6 10:
16
200
7
(edgrif)
* Created: Thu Jul 24 14:36:59 2003 (edgrif)
* CVS info: $Id: zmapAppmenubar.c,v 1.
4
200
6-11-08 09:23:41
edgrif Exp $
* CVS info: $Id: zmapAppmenubar.c,v 1.
5
200
7-03-06 10:20:10
edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -96,7 +96,10 @@ static void quitCB(gpointer cb_data, guint callback_action, GtkWidget *w)
{
ZMapAppContext
app_context
=
(
ZMapAppContext
)
cb_data
;
zmapAppExit
(
app_context
)
;
/* Causes the destroy callback to be invoked which then cleans up. */
gtk_widget_destroy
(
app_context
->
app_widg
)
;
return
;
}
static
void
print_hello
(
gpointer
data
,
guint
callback_action
,
GtkWidget
*
w
)
...
...
This diff is collapsed.
Click to expand it.
src/zmapApp/zmapAppremote.c
+
5
−
5
View file @
ddf7a0ec
...
...
@@ -27,9 +27,9 @@
*
* Exported functions: None
* HISTORY:
* Last edited:
Nov 14
10:
3
6 200
6
(
rds
)
* Last edited:
Mar 6
10:
1
6 200
7
(
edgrif
)
* Created: Thu May 5 18:19:30 2005 (rds)
* CVS info: $Id: zmapAppremote.c,v 1.2
1
200
6-11-14 10:36:41 rds
Exp $
* CVS info: $Id: zmapAppremote.c,v 1.2
2
200
7-03-06 10:20:10 edgrif
Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -236,9 +236,9 @@ static void remoteCloseDestroyNotify(gpointer data)
g_timer_destroy
(
tc
->
timer
);
tc
->
app_context
=
NULL
;
g_free
(
tc
);
/* Now really clean up the main window */
zMapManagerDestroy
(
app_context
->
zmap_manager
);
zmapAppExit
(
app_context
)
;
/* Causes the destroy callback to be invoked which then cleans up. */
gtk_widget_destroy
(
app_context
->
app_widg
)
;
}
return
;
...
...
This diff is collapsed.
Click to expand it.
src/zmapApp/zmapAppwindow.c
+
38
−
12
View file @
ddf7a0ec
...
...
@@ -19,16 +19,15 @@
*-------------------------------------------------------------------
* This file is part of the ZMap genome database package
* and was written by
* Rob Clack (Sanger Institute, UK) rnc@sanger.ac.uk,
* Ed Griffiths (Sanger Institute, UK) edgrif@sanger.ac.uk and
*
Simon Kell
ey (Sanger Institute, UK)
srk
@sanger.ac.uk
*
Roy Stor
ey (Sanger Institute, UK)
rds
@sanger.ac.uk
*
* Description:
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited:
Jun
7
1
5:05
200
6
(
rds
)
* Last edited:
Mar
6
1
0:16
200
7
(
edgrif
)
* Created: Thu Jul 24 14:36:27 2003 (edgrif)
* CVS info: $Id: zmapAppwindow.c,v 1.3
2
200
6-11-08 09:23:43
edgrif Exp $
* CVS info: $Id: zmapAppwindow.c,v 1.3
3
200
7-03-06 10:20:10
edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -48,7 +47,7 @@
static
void
initGnomeGTK
(
int
argc
,
char
*
argv
[])
;
static
ZMapAppContext
createAppContext
(
void
)
;
static
void
quit
CB
(
GtkWidget
*
widget
,
gpointer
data
)
;
static
void
toplevelDestroy
CB
(
GtkWidget
*
widget
,
gpointer
data
)
;
static
void
removeZMapCB
(
void
*
app_data
,
void
*
zmap
)
;
static
void
infoSetCB
(
void
*
app_data
,
void
*
zmap
)
;
static
void
checkForCmdLineVersionArg
(
int
argc
,
char
*
argv
[])
;
...
...
@@ -59,7 +58,6 @@ static gboolean removeZMapRowForeachFunc(GtkTreeModel *model, GtkTreePath *path,
GtkTreeIter
*
iter
,
gpointer
data
);
void
exitCB
(
void
*
app_data
,
void
*
zmap_data_unused
)
;
static
void
appExit
(
ZMapAppContext
app_context
)
;
static
gboolean
getConfiguration
(
ZMapAppContext
app_context
)
;
...
...
@@ -244,7 +242,7 @@ int zmapMainMakeAppWindow(int argc, char *argv[])
(
gpointer
)
app_context
);
gtk_signal_connect
(
GTK_OBJECT
(
toplevel
),
"destroy"
,
GTK_SIGNAL_FUNC
(
quit
CB
),
(
gpointer
)
app_context
)
;
GTK_SIGNAL_FUNC
(
toplevelDestroy
CB
),
(
gpointer
)
app_context
)
;
vbox
=
gtk_vbox_new
(
FALSE
,
0
)
;
gtk_container_add
(
GTK_CONTAINER
(
toplevel
),
vbox
)
;
...
...
@@ -304,8 +302,13 @@ int zmapMainMakeAppWindow(int argc, char *argv[])
}
void
zmapAppExit
(
ZMapAppContext
app_context
)
{
/* Destroy any ZMap windows. */
zMapManagerDestroy
(
app_context
->
zmap_manager
)
;
/* If we have a client object, clean it up */
if
(
app_context
->
xremoteClient
!=
NULL
)
zMapXRemoteDestroy
(
app_context
->
xremoteClient
);
...
...
@@ -378,11 +381,29 @@ static ZMapAppContext createAppContext(void)
}
/* This function gets called whenever there is a gtk_widget_destroy() to the top level
* widget. Sometimes this is because of window manager action, sometimes one of our exit
* routines does a gtk_widget_destroy() on the top level widget. */
static
void
toplevelDestroyCB
(
GtkWidget
*
widget
,
gpointer
cb_data
)
{
ZMapAppContext
app_context
=
(
ZMapAppContext
)
cb_data
;
app_context
->
app_widg
=
NULL
;
zmapAppExit
(
app_context
)
;
return
;
}
static
void
quitCB
(
GtkWidget
*
widget
,
gpointer
cb_data
)
{
ZMapAppContext
app_context
=
(
ZMapAppContext
)
cb_data
;
appExit
(
app_context
)
;
/* Causes the destroy callback to be invoked which then cleans up. */
gtk_widget_destroy
(
app_context
->
app_widg
);
return
;
}
...
...
@@ -405,8 +426,8 @@ void removeZMapCB(void *app_data, void *zmap_data)
if
(
app_context
->
selected_zmap
==
zmap
)
app_context
->
selected_zmap
=
NULL
;
if
((
!
(
app_context
->
show_mainwindow
))
&&
((
zMapManagerCount
(
app_context
->
zmap_manager
))
==
0
))
/* Causes the destroy callback to be invoked which then cleans up. */
if
((
!
(
app_context
->
show_mainwindow
))
&&
((
zMapManagerCount
(
app_context
->
zmap_manager
))
==
0
))
gtk_widget_destroy
(
app_context
->
app_widg
);
return
;
...
...
@@ -544,17 +565,20 @@ static void infoSetCB(void *app_data, void *zmap)
}
/* Called from layers to below when they need to exit. */
void
exitCB
(
void
*
app_data
,
void
*
zmap_data_unused
)
{
ZMapAppContext
app_context
=
(
ZMapAppContext
)
app_data
;
appExit
(
app_context
)
;
/* Causes the destroy callback to be invoked which then cleans up. */
gtk_widget_destroy
(
app_context
->
app_widg
)
;
return
;
}
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
static
void
appExit
(
ZMapAppContext
app_context
)
{
zMapManagerDestroy
(
app_context
->
zmap_manager
)
;
...
...
@@ -563,6 +587,8 @@ static void appExit(ZMapAppContext app_context)
return
;
}
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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