Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gtk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1,145
Issues
1,145
List
Boards
Labels
Service Desk
Milestones
Merge Requests
142
Merge Requests
142
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
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
GNOME
gtk
Commits
9e85fcbe
Commit
9e85fcbe
authored
Jan 27, 2015
by
Bastian Ilsø
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Paragraph explaining casting conventions via macro
parent
a1e4ba0d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
docs/reference/gtk/getting_started.xml
docs/reference/gtk/getting_started.xml
+15
-0
No files found.
docs/reference/gtk/getting_started.xml
View file @
9e85fcbe
...
...
@@ -75,6 +75,21 @@
by the windowing system: it will have a frame, a title bar and window
controls, depending on the platform.
</para>
<para>
A window title is set using gtk_window_set_title(). This function
takes a GtkWindow* pointer and a string as input. As our
<varname>
window
</varname>
pointer is a GtkWidget pointer, we need to cast it
to GtkWindow*.
But instead of casting
<varname>
window
</varname>
via
<varname>
(GtkWindow*)
</varname>
,
<varname>
window
</varname>
can be cast using the macro
<varname>
GTK_WINDOW()
</varname>
.
<varname>
GTK_WINDOW()
</varname>
will check if the
pointer is an instance of the GtkWindow class, before casting, and emit a
warning if the check fails. More information about this convention
can be found
<ulink
url=
"https://developer.gnome.org/gobject/stable/gtype-conventions.html"
>
here
</ulink>
.
</para>
<para>
In order to terminate the application when the #GtkWindow is
destroyed, we connect the #GtkWidget::destroy signal to the gtk_main_quit()
function. This function will terminate the GTK+ main loop started by calling
...
...
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