Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
TimeManager
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Schedules
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
linux-tools
TimeManager
Commits
407106c5
Commit
407106c5
authored
Jun 10, 2019
by
Carit Zhu
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial commit for hello world example
parents
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
.gitignore
.gitignore
+0
-0
main.c
main.c
+37
-0
No files found.
.gitignore
0 → 100644
View file @
407106c5
main.c
0 → 100644
View file @
407106c5
#include <gtk/gtk.h>
static
void
print_hello
(
GtkWidget
*
widget
,
gpointer
data
)
{
g_print
(
"Hello World
\n
"
);
}
static
void
activate
(
GtkApplication
*
app
,
gpointer
user_data
)
{
GtkWidget
*
window
;
GtkWidget
*
button
;
GtkWidget
*
button_box
;
window
=
gtk_application_window_new
(
app
);
gtk_window_set_title
(
GTK_WINDOW
(
window
),
"Window"
);
gtk_window_set_default_size
(
GTK_WINDOW
(
window
),
200
,
200
);
button_box
=
gtk_button_box_new
(
GTK_ORIENTATION_HORIZONTAL
);
gtk_container_add
(
GTK_CONTAINER
(
window
),
button_box
);
button
=
gtk_button_new_with_label
(
"Hello World"
);
g_signal_connect
(
button
,
"clicked"
,
G_CALLBACK
(
print_hello
),
NULL
);
g_signal_connect_swapped
(
button
,
"clicked"
,
G_CALLBACK
(
gtk_widget_destroy
),
window
);
gtk_container_add
(
GTK_CONTAINER
(
button_box
),
button
);
gtk_widget_show_all
(
window
);
}
int
main
(
int
argc
,
char
**
argv
)
{
GtkApplication
*
app
;
int
status
;
app
=
gtk_application_new
(
"com.witium.timemanager"
,
G_APPLICATION_FLAGS_NONE
);
g_signal_connect
(
app
,
"activate"
,
G_CALLBACK
(
activate
),
NULL
);
status
=
g_application_run
(
G_APPLICATION
(
app
),
argc
,
argv
);
g_object_unref
(
app
);
return
status
;
}
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