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
611c9d0d
Commit
611c9d0d
authored
19 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
Make our error messages cut/pastable...yipee.....
parent
d0629f21
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/zmapUtils/zmapGUIutils.c
+32
-10
32 additions, 10 deletions
src/zmapUtils/zmapGUIutils.c
with
32 additions
and
10 deletions
src/zmapUtils/zmapGUIutils.c
+
32
−
10
View file @
611c9d0d
...
...
@@ -25,9 +25,9 @@
* Description:
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited: Nov 14
09:26
2005 (edgrif)
* Last edited: Nov 14
12:58
2005 (edgrif)
* Created: Thu Jul 24 14:37:35 2003 (edgrif)
* CVS info: $Id: zmapGUIutils.c,v 1.
7
2005-11-14 1
1:14:02
edgrif Exp $
* CVS info: $Id: zmapGUIutils.c,v 1.
8
2005-11-14 1
3:00:35
edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -47,6 +47,8 @@ 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
)
;
/*! @defgroup zmapguiutils zMapGUI: set of utility functions for use in a GUI.
* @{
...
...
@@ -62,11 +64,6 @@ static void killFileDialog(GtkWidget *widget, gpointer user_data) ;
/* LIFT MY CODE FROM ACEDB THAT ALLOWED YOU TO CLICK TO CUT/PASTE MESSAGE CONTENTS....*/
/*!
* Trivial cover function for zmapGUIShowMsgOnTop(), see documentation of that function
* for description and parameter details.
...
...
@@ -99,7 +96,7 @@ void zMapGUIShowMsg(ZMapMsgType msg_type, char *msg)
* */
void
zMapGUIShowMsgOnTop
(
GtkWindow
*
parent
,
ZMapMsgType
msg_type
,
char
*
msg
)
{
GtkWidget
*
dialog
,
*
label
;
GtkWidget
*
dialog
,
*
button
,
*
label
;
char
*
title
=
NULL
;
GtkDialogFlags
flags
=
GTK_DIALOG_DESTROY_WITH_PARENT
;
gboolean
modal
=
FALSE
;
...
...
@@ -138,10 +135,17 @@ void zMapGUIShowMsgOnTop(GtkWindow *parent, ZMapMsgType msg_type, char *msg)
gtk_container_set_border_width
(
GTK_CONTAINER
(
dialog
),
5
);
label
=
gtk_label_new
(
msg
)
;
/* Set up the message text in a button widget so that it can put in the primary
* selection buffer for cut/paste when user clicks on it. */
button
=
gtk_button_new_with_label
(
msg
)
;
gtk_box_pack_start
(
GTK_BOX
(
GTK_DIALOG
(
dialog
)
->
vbox
),
button
,
TRUE
,
TRUE
,
20
);
gtk_button_set_relief
(
GTK_BUTTON
(
button
),
GTK_RELIEF_NONE
)
;
label
=
gtk_bin_get_child
(
GTK_BIN
(
button
))
;
/* Center + wrap long lines. */
gtk_label_set_justify
(
GTK_LABEL
(
label
),
GTK_JUSTIFY_CENTER
)
;
gtk_label_set_line_wrap
(
GTK_LABEL
(
label
),
TRUE
)
;
gtk_box_pack_start
(
GTK_BOX
(
GTK_DIALOG
(
dialog
)
->
vbox
),
label
,
TRUE
,
TRUE
,
20
);
gtk_signal_connect
(
GTK_OBJECT
(
button
),
"clicked"
,
GTK_SIGNAL_FUNC
(
butClick
),
button
)
;
gtk_widget_show_all
(
dialog
)
;
...
...
@@ -185,6 +189,24 @@ void zMapGUIShowMsgOnTop(GtkWindow *parent, ZMapMsgType msg_type, char *msg)
}
/* When user clicks on the message itself, we put the message text in the cut buffer. */
static
void
butClick
(
GtkButton
*
button
,
gpointer
user_data
)
{
char
*
label_text
;
GtkClipboard
*
clip_board
;
label_text
=
gtk_button_get_label
(
button
)
;
clip_board
=
gtk_clipboard_get
(
GDK_SELECTION_PRIMARY
)
;
gtk_clipboard_set_text
(
clip_board
,
label_text
,
-
1
)
;
return
;
}
/*!
* Display longer text in a text widget. The code attempts to display the window
* as 80 chars wide. Currently both title and text must be provided.
...
...
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