]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Wrap gtkutil/dialog
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 21 Jul 2017 16:32:11 +0000 (02:32 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 31 Jul 2017 12:35:47 +0000 (22:35 +1000)
libs/gtkutil/dialog.cpp
libs/gtkutil/dialog.h

index 6c0c8edbb20c28af90437c21e9fc59295b653da3..8a1448717f801d486c19ae75609b606b27b0cb48 100644 (file)
@@ -176,14 +176,14 @@ ui::Window create_simple_modal_dialog_window( const char* title, ModalDialog& di
 }
 
 RadioHBox RadioHBox_new( StringArrayRange names ){
-       GtkHBox* hbox = ui::HBox( TRUE, 4 );
+       auto hbox = ui::HBox( TRUE, 4 );
        gtk_widget_show( GTK_WIDGET( hbox ) );
 
        GSList* group = 0;
-       GtkRadioButton* radio = 0;
+       auto radio = ui::RadioButton{nullptr};
        for ( StringArrayRange::Iterator i = names.first; i != names.last; ++i )
        {
-               radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( group, *i ) );
+               radio = ui::RadioButton(GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( group, *i ) ));
                gtk_widget_show( GTK_WIDGET( radio ) );
                gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( radio ), FALSE, FALSE, 0 );
 
@@ -195,8 +195,8 @@ RadioHBox RadioHBox_new( StringArrayRange names ){
 
 
 PathEntry PathEntry_new(){
-       GtkFrame* frame = ui::Frame();
-       gtk_widget_show( GTK_WIDGET( frame ) );
+       auto frame = ui::Frame();
+       frame.show();
        gtk_frame_set_shadow_type( frame, GTK_SHADOW_IN );
 
        // path entry
index 3fbb14b1163bafd8e86d9404bfeaa2b58d6c7b35..b5f235c2aa07efb7888b1cdfdd7dd4d0b9124dfd 100644 (file)
 typedef int gint;
 typedef gint gboolean;
 typedef struct _GdkEventAny GdkEventAny;
-typedef struct _GtkWidget GtkWidget;
-typedef struct _GtkHBox GtkHBox;
-typedef struct _GtkVBox GtkVBox;
-typedef struct _GtkRadioButton GtkRadioButton;
-typedef struct _GtkFrame GtkFrame;
-typedef struct _GtkEntry GtkEntry;
-typedef struct _GtkButton GtkButton;
-typedef struct _GtkLabel GtkLabel;
-typedef struct _GtkTable GtkTable;
 
 
 struct ModalDialog
@@ -61,11 +52,6 @@ struct ModalDialogButton
 
 typedef void ( *GCallback )( void );
 typedef void* gpointer;
-typedef struct _GtkTable GtkTable;
-typedef struct _GtkButton GtkButton;
-typedef struct _GtkVBox GtkVBox;
-typedef struct _GtkHBox GtkHBox;
-typedef struct _GtkFrame GtkFrame;
 
 ui::Window create_fixedsize_modal_window( ui::Window parent, const char* title, int width, int height );
 
@@ -93,9 +79,9 @@ ui::Window create_simple_modal_dialog_window( const char* title, ModalDialog& di
 class RadioHBox
 {
 public:
-GtkHBox* m_hbox;
+ui::HBox m_hbox;
 ui::RadioButton m_radio;
-RadioHBox( GtkHBox* hbox, GtkRadioButton* radio ) :
+RadioHBox( ui::HBox hbox, ui::RadioButton radio ) :
        m_hbox( hbox ),
        m_radio( radio ){
 }
@@ -107,10 +93,10 @@ RadioHBox RadioHBox_new( StringArrayRange names );
 class PathEntry
 {
 public:
-GtkFrame* m_frame;
+ui::Frame m_frame;
 ui::Entry m_entry;
-GtkButton* m_button;
-PathEntry( GtkFrame* frame, GtkEntry* entry, GtkButton* button ) :
+ui::Button m_button;
+PathEntry( ui::Frame frame, ui::Entry entry, ui::Button button ) :
        m_frame( frame ),
        m_entry( entry ),
        m_button( button ){