2016-10-20 1 views
0

を取得することはできませんFileChooserButtonのgtkmmとFileChooserButtonは、私はfile_nameの後にウィジェットを使用してファイルを選択し取得してみてください、これは私のコードでファイル名

Gtk::FileChooserButton *chooserButton = nullptr; 
std::string idChooserButton = commonArray[b]["id"]; 
builder->get_widget(idChooserButton, chooserButton); 
Php::call("var_dump",chooserButton); 
if (strcmp(commonArray[b]["action"], "click") == 0) { 
    Php::Value callback = commonArray[b]["callback"]; 
    chooserButton->signal_selection_changed().connect(
      sigc::bind<Php::Value,Php::Value>(
        sigc::mem_fun(*this, &ParserGtk::callbacks), 
        callback, 
        chooserButton->get_filename() 
      ) 
    ); 
} 

私はfunctino get_filenameしかしget_filenameリターン、空の文字列「コール」。

答えて

1

信号と接続時に計算されたsigc::bind合格値。あなたは

chooserButton->get_filename() 

を行うときにこれが空の文字列を返します、 Gtk::FileChooserButtonが表示されたり、その時点で使用されていませんでした。

現在の値を取得するには、コールバック関数でchooserButton->get_filename()に電話する必要があります。

+0

あなたの仕事のおかげです! – Naumov

関連する問題