Re: Collecting data from an InutDialog?



Zdravko Monov wrote:

Hi,
could you tell me how to collect data from an input dialog. I read the whole documentation and even the InputDialog reference.
Thanks in advance
Zdravko


Here is a snippet of code that shows how to create an "input dialog" with
a Gtk::Label and a Gtk::Entry to accept user input

   Gtk::Label label;
   Gtk::Entry entry;
   Gtk::HBox hbox(FALSE,4);
   Gtk::Dialog db;

   label.set_markup("<big> Enter new employee ID: </big>");

   entry.set_activates_default(TRUE);
hbox.set_border_width(CONTAINER_BORDER_WIDTH);
   hbox.pack_start(label,TRUE,FALSE,3);
   hbox.pack_start(entry,TRUE,FALSE,3);

   db.add_button(Gtk::Stock::OK,Gtk::RESPONSE_OK);
   db.add_button(Gtk::Stock::CANCEL,Gtk::RESPONSE_CANCEL);
   db.set_default_response(Gtk::RESPONSE_OK);
   db.set_title(" Create New Employee Record ");
   db.get_vbox()->pack_start(hbox,TRUE,FALSE,3);
   db.show_all_children();
if(db.run() == Gtk::RESPONSE_OK)
   {
      // write code to access contents of your entry
   }

Hope this helps.

Bob
begin:vcard
fn:Robert Caryl
n:Caryl;Robert
org:Fiscal Systems, Inc.
adr:;;102 Commerce Circle;Madison;AL;35758;USA
email;internet:bob fis-cal com
title:Senior Software Design Engineer
tel;work:356-772-8920 X108
x-mozilla-html:TRUE
url:http://www.fis-cal.com
version:2.1
end:vcard



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]