File tree Expand file tree Collapse file tree 4 files changed +7
-1
lines changed Expand file tree Collapse file tree 4 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -224,6 +224,10 @@ type Font struct {
224
224
GFont * C.GdkFont
225
225
}
226
226
227
+ func FontFromUnsafe (window unsafe.Pointer ) * Font {
228
+ return & Font {C .toGdkFont (window )}
229
+ }
230
+
227
231
func FontLoad (name string ) * Font {
228
232
ptr := C .CString (name )
229
233
defer cfree (ptr )
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ static void freeCstr(char* s) { free(s); }
14
14
15
15
static GdkWindow * toGdkWindow (void * w ) { return GDK_WINDOW (w ); }
16
16
static GdkDragContext * toGdkDragContext (void * l ) { return (GdkDragContext * )l ; }
17
+ static GdkFont * toGdkFont (void * l ) { return (GdkFont * )l ; }
17
18
18
19
static void * _gdk_display_get_default () {
19
20
return (void * ) gdk_display_get_default ();
Original file line number Diff line number Diff line change @@ -8240,7 +8240,7 @@ func NewFontSelection() *FontSelection {
8240
8240
}
8241
8241
8242
8242
func (v * FontSelection ) GetFont () * gdk.Font {
8243
- return & gdk.Font { C .gtk_font_selection_get_font (FONT_SELECTION (v ))}
8243
+ return gdk .FontFromUnsafe ( unsafe . Pointer ( C .gtk_font_selection_get_font (FONT_SELECTION (v ))))
8244
8244
}
8245
8245
8246
8246
func (v * FontSelection ) GetFontName () string {
Original file line number Diff line number Diff line change @@ -773,6 +773,7 @@ static inline GtkDialog* toGDialog(GtkWidget* w) { return GTK_DIALOG(w); }
773
773
static inline GtkAboutDialog * toGAboutDialog (GtkWidget * w ) { return GTK_ABOUT_DIALOG (w ); }
774
774
static inline GtkContainer * toGContainer (GtkWidget * w ) { return GTK_CONTAINER (w ); }
775
775
static inline GtkFileChooser * toGFileChooser (GtkWidget * w ) { return GTK_FILE_CHOOSER (w ); }
776
+ static inline GtkFontSelection * toGFontSelection (GtkWidget * w ) { return GTK_FONT_SELECTION (w ); }
776
777
static inline GtkFontSelectionDialog * toGFontSelectionDialog (GtkWidget * w ) { return GTK_FONT_SELECTION_DIALOG (w ); }
777
778
static inline GtkMisc * toGMisc (GtkWidget * w ) { return GTK_MISC (w ); }
778
779
static inline GtkLabel * toGLabel (GtkWidget * w ) { return GTK_LABEL (w ); }
You can’t perform that action at this time.
0 commit comments