how to write information into text boxes after GUI runs?

I am trying to write strings into a text box after the GUI starts running. i tried to use 'set' command, this is what i have
set(hObject, 'String', input_folder_name)
so the input_folder_name is a user inputted variable. i put this command line in the function created when i made the text box. can anyone tell me where i did wrong? Thanks

 採用された回答

Paulo Silva
Paulo Silva 2011 年 9 月 7 日

0 投票

Put the code inside the OpeningFcn
set(handles.text1, 'String', input_folder_name)
%text1 is the name of the textbox, you might need to change it

3 件のコメント

Andy
Andy 2011 年 9 月 7 日
hi, thanks for the fix, it works now, but is there a way so that everytime the user enters a new thing and press OK, it get reupdates the text box? thanks
Paulo Silva
Paulo Silva 2011 年 9 月 8 日
If the Ok is a pushbutton you just need to put the code inside that pushbutton callback
Andy
Andy 2011 年 9 月 8 日
thank you so much, works like a charm

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Characters and Strings についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by