Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
0660a32d
Commit
0660a32d
authored
Feb 05, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to get List window to get input focus
parent
efaf7dc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
src/lib/co/gtk/co_wow_gtk.cpp
src/lib/co/gtk/co_wow_gtk.cpp
+19
-10
No files found.
src/lib/co/gtk/co_wow_gtk.cpp
View file @
0660a32d
/**
* Proview $Id: co_wow_gtk.cpp,v 1.
3 2007-01-17 10:27:06
claes Exp $
* Proview $Id: co_wow_gtk.cpp,v 1.
4 2007-02-05 09:30:02
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -169,20 +169,21 @@ void CoWowGtk::DisplayError( char *title, char *text)
*
*************************************************************************/
typedef
struct
{
class
WowListCtx
{
public:
GtkWidget
*
toplevel
;
GtkWidget
*
list
;
char
*
texts
;
void
(
*
action_cb
)
(
void
*
,
char
*
);
void
*
parent_ctx
;
}
*
wow_tListCtx
;
};
void
CoWowGtk
::
list_ok_cb
(
GtkWidget
*
w
,
gpointer
data
)
{
wow_tListCtx
ctx
=
(
wow_tListCtx
)
data
;
WowListCtx
*
ctx
=
(
WowListCtx
*
)
data
;
char
*
text
;
static
char
selected_text
[
80
];
GtkTreeIter
iter
;
...
...
@@ -203,7 +204,7 @@ void CoWowGtk::list_ok_cb (
gtk_widget_destroy
(
ctx
->
toplevel
);
free
(
ctx
->
texts
);
free
(
ctx
)
;
delete
ctx
;
}
void
CoWowGtk
::
list_cancel_cb
(
...
...
@@ -211,11 +212,17 @@ void CoWowGtk::list_cancel_cb (
gpointer
data
)
{
wow_tListCtx
ctx
=
(
wow_tListCtx
)
data
;
WowListCtx
*
ctx
=
(
WowListCtx
*
)
data
;
gtk_widget_destroy
(
ctx
->
toplevel
);
free
(
ctx
->
texts
);
free
(
ctx
);
delete
ctx
;
}
static
gboolean
list_action_inputfocus
(
GtkWidget
*
w
,
GdkEvent
*
event
,
gpointer
data
)
{
gtk_window_present
(
GTK_WINDOW
(
w
));
return
FALSE
;
}
void
*
CoWowGtk
::
CreateList
(
...
...
@@ -227,13 +234,13 @@ void *CoWowGtk::CreateList (
{
char
*
name_p
;
int
i
;
wow_tListCtx
ctx
;
WowListCtx
*
ctx
;
GtkListStore
*
store
;
GtkTreeIter
iter
;
GtkCellRenderer
*
text_renderer
;
GtkTreeViewColumn
*
name_column
;
ctx
=
(
wow_tListCtx
)
calloc
(
1
,
sizeof
(
*
ctx
)
);
ctx
=
new
WowListCtx
(
);
ctx
->
action_cb
=
action_cb
;
ctx
->
parent_ctx
=
parent_ctx
;
...
...
@@ -245,6 +252,9 @@ void *CoWowGtk::CreateList (
"window-position"
,
GTK_WIN_POS_CENTER
,
NULL
);
g_signal_connect
(
ctx
->
toplevel
,
"focus-in-event"
,
G_CALLBACK
(
list_action_inputfocus
),
ctx
);
store
=
gtk_list_store_new
(
1
,
G_TYPE_STRING
);
name_p
=
texts
;
i
=
0
;
...
...
@@ -309,7 +319,6 @@ void *CoWowGtk::CreateList (
// Set input focus to the scrolled list widget
gtk_widget_grab_focus
(
ctx
->
list
);
return
ctx
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment