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
3b064d66
Commit
3b064d66
authored
17 years ago
by
rds
Browse files
Options
Downloads
Patches
Plain Diff
set a limit size for the navigator
parent
247dd714
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
+80
-2
80 additions, 2 deletions
src/zmapUtils/zmapGUIutils.c
with
80 additions
and
2 deletions
src/zmapUtils/zmapGUIutils.c
+
80
−
2
View file @
3b064d66
...
...
@@ -25,9 +25,9 @@
* Description:
* Exported functions: See ZMap/zmapUtilsGUI.h
* HISTORY:
* Last edited:
Jul
2
6
1
2:33
2007 (
edgrif
)
* Last edited:
Aug
2 1
1:05
2007 (
rds
)
* Created: Thu Jul 24 14:37:35 2003 (edgrif)
* CVS info: $Id: zmapGUIutils.c,v 1.3
7
2007-0
7-26 11:40:33 edgrif
Exp $
* CVS info: $Id: zmapGUIutils.c,v 1.3
8
2007-0
8-02 10:10:33 rds
Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -1122,6 +1122,84 @@ void zMapGUISetClipboard(GtkWidget *widget, char *text)
return
;
}
/* GtkPaned Widget helper functions... */
/* Because we need to cast to the function type to call it without debugger complaints... */
typedef
void
(
*
g_object_notify_callback
)(
GObject
*
pane
,
GParamSpec
*
scroll
,
gpointer
user_data
);
/* data for our proxying */
typedef
struct
{
g_object_notify_callback
callback
;
gpointer
user_data
;
gulong
handler_id
;
gboolean
freeze
;
/* So that we don't end up in a loop of changing... */
}
PaneMaxPositionStruct
,
*
PaneMaxPosition
;
static
void
pane_max_position_callback
(
GObject
*
pane
,
GParamSpec
*
scroll
,
gpointer
user_data
);
static
void
pane_max_position_destroy_notify
(
gpointer
pane_max_pos_data
,
GClosure
*
unused_closure
);
/*!
* \brief To safely set a maximum position of a paned handle from the
* GtkPaned:position notify signal handler.
*
* Without this doing a gtk_paned_set_position in the handler results
* in another call to the handler and it's very easy to get into a
* loop... So instead of doing
* g_signal_connect(widget, "notify::position", cb, data);
* use this function.
*
* \param GtkWidget * should be GtkPaned *
* \param Your GCallback
* \param Your data (this is never freed)
* \return void
************************************************** */
void
zMapGUIPanedSetMaxPositionHandler
(
GtkWidget
*
widget
,
GCallback
callback
,
gpointer
user_data
)
{
PaneMaxPosition
pane_data
=
NULL
;
if
(
GTK_IS_PANED
(
widget
))
{
pane_data
=
g_new0
(
PaneMaxPositionStruct
,
1
);
pane_data
->
callback
=
(
g_object_notify_callback
)
callback
;
pane_data
->
user_data
=
user_data
;
pane_data
->
handler_id
=
g_signal_connect_data
(
G_OBJECT
(
widget
),
"notify::position"
,
G_CALLBACK
(
pane_max_position_callback
),
(
gpointer
)
pane_data
,
pane_max_position_destroy_notify
,
0
);
}
return
;
}
static
void
pane_max_position_callback
(
GObject
*
pane
,
GParamSpec
*
scroll
,
gpointer
user_data
)
{
PaneMaxPosition
pane_data
=
(
PaneMaxPosition
)
user_data
;
if
(
pane_data
->
callback
&&
!
(
pane_data
->
freeze
))
{
pane_data
->
freeze
=
TRUE
;
(
pane_data
->
callback
)(
pane
,
scroll
,
pane_data
->
user_data
);
pane_data
->
freeze
=
FALSE
;
}
return
;
}
static
void
pane_max_position_destroy_notify
(
gpointer
pane_max_pos_data
,
GClosure
*
unused_closure
)
{
PaneMaxPosition
pane_data
=
(
PaneMaxPosition
)
pane_max_pos_data
;
g_free
(
pane_data
);
return
;
}
/*! @} end of zmapguiutils docs. */
...
...
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