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
f3c4b643
Commit
f3c4b643
authored
18 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
add a non-modal version of gtk_run_dialog() function.
parent
6e604101
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/include/ZMap/zmapUtilsGUI.h
+5
-2
5 additions, 2 deletions
src/include/ZMap/zmapUtilsGUI.h
src/zmapUtils/zmapGUIutils.c
+58
-3
58 additions, 3 deletions
src/zmapUtils/zmapGUIutils.c
with
63 additions
and
5 deletions
src/include/ZMap/zmapUtilsGUI.h
+
5
−
2
View file @
f3c4b643
...
...
@@ -25,9 +25,9 @@
* Description: Set of general GUI functions.
*
* HISTORY:
* Last edited: Dec
18 11:10
2006 (edgrif)
* Last edited: Dec
21 15:58
2006 (edgrif)
* Created: Fri Nov 4 16:59:52 2005 (edgrif)
* CVS info: $Id: zmapUtilsGUI.h,v 1.1
7
2006-12-
18 11:36:00
edgrif Exp $
* CVS info: $Id: zmapUtilsGUI.h,v 1.1
8
2006-12-
21 16:18:46
edgrif Exp $
*-------------------------------------------------------------------
*/
#ifndef ZMAP_UTILS_GUI_H
...
...
@@ -146,6 +146,9 @@ typedef struct
gint
my_gtk_run_dialog_nonmodal
(
GtkWidget
*
toplevel
)
;
void
zMapGUIMakeMenu
(
char
*
menu_title
,
GList
*
menu_sets
,
GdkEventButton
*
button_event
)
;
void
zMapGUIPopulateMenu
(
ZMapGUIMenuItem
menu
,
int
*
start_index_inout
,
...
...
This diff is collapsed.
Click to expand it.
src/zmapUtils/zmapGUIutils.c
+
58
−
3
View file @
f3c4b643
...
...
@@ -25,9 +25,9 @@
* Description:
* Exported functions: See ZMap/zmapUtilsGUI.h
* HISTORY:
* Last edited: Dec
18 11:09
2006 (edgrif)
* Last edited: Dec
21 15:56
2006 (edgrif)
* Created: Thu Jul 24 14:37:35 2003 (edgrif)
* CVS info: $Id: zmapGUIutils.c,v 1.2
4
2006-12-
18 11:36:29
edgrif Exp $
* CVS info: $Id: zmapGUIutils.c,v 1.2
5
2006-12-
21 16:18:46
edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -56,9 +56,11 @@ static void store_filename(GtkWidget *widget, gpointer user_data) ;
static
void
killFileDialog
(
GtkWidget
*
widget
,
gpointer
user_data
)
;
/* ONLY NEEDED FOR OLD STYLE FILE SELECTOR, REMOVE WHEN WE CAN USE THE NEW CODE... */
static
void
butClick
(
GtkButton
*
button
,
gpointer
user_data
)
;
static
void
responseCB
(
GtkDialog
*
toplevel
,
gint
arg1
,
gpointer
user_data
)
;
/*! @defgroup zmapguiutils zMapGUI: set of utility functions for use in a GUI.
* @{
...
...
@@ -73,6 +75,46 @@ static void butClick(GtkButton *button, gpointer user_data) ;
/*!
* Gtk provides a function called gtk_dialog_run() which blocks until the user presses
* a button on the dialot, the function returns an int indicating which button was
* pressed. The problem is though that this function blocks any user interaction with
* the rest of the application. This function is an attempt to get round this by
* continuing to service events while waiting for a response.
*
* The code _relies_ on the response never being zero, no GTK predefined responses
* have this value and you should not use this value either (see gtk web page for dialogs).
*
*
* @param toplevel This must be the dialog widget itself.
* @return an integer which corresponds to the button pressed.
* */
gint
my_gtk_run_dialog_nonmodal
(
GtkWidget
*
toplevel
)
{
gint
result
=
0
;
int
*
response_ptr
;
zMapAssert
(
GTK_IS_DIALOG
(
toplevel
))
;
response_ptr
=
g_new0
(
gint
,
1
)
;
*
response_ptr
=
0
;
g_signal_connect
(
GTK_OBJECT
(
toplevel
),
"response"
,
GTK_SIGNAL_FUNC
(
responseCB
),
(
gpointer
)
response_ptr
)
;
while
(
*
response_ptr
==
0
||
gtk_events_pending
())
gtk_main_iteration
()
;
result
=
*
response_ptr
;
g_free
(
response_ptr
)
;
return
result
;
}
/*!
* Returns a title string in standard form to be used for the window manager title
* bar in zmap windows.
...
...
@@ -1020,3 +1062,16 @@ static void killFileDialog(GtkWidget *widget, gpointer user_data)
}
/* Record the response from the dialog so we can detect it in our event hanlding loop. */
static
void
responseCB
(
GtkDialog
*
toplevel
,
gint
arg1
,
gpointer
user_data
)
{
int
*
response_ptr
=
(
int
*
)
user_data
;
zMapAssert
(
arg1
!=
0
)
;
/* It will never exit if this is true... */
*
response_ptr
=
arg1
;
return
;
}
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