text widget in Free Pascal lazarus / 8-Other ---------------------------------------------------------------------- Rickard · 2008-02-01 01:27 First I'd like to thank all of you who are developing lazarus and fp.  Now to my question. I'm a newbie concerning fp and now I try to add gtk to my pascal programs and can't understand how to make a text widget. I've looked at both fp-gtk tutorials.  Let's say that we have the following program and want to have a text widget over the whole window... Does someone know what lines to add? PROGRAM gtk-window; USES gtk, gdk, glib; VAR window: pGtkWidget; BEGIN gtk_init(@argc, @argv); window := gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), 'Test window'); gtk_container_set_border_width(GTK_CONTAINER(window), 250); gtk_widget_show(window); gtk_main(); END. ---------------------------------------------------------------------- bee · 2008-02-01 04:24 Why bother with direct gtk programming? Lazarus has done it for you in a very elegant way. ---------------------------------------------------------------------- Marc · 2008-02-01 10:50 From the top of my head, I didn't check for the exact names, and I'm to lazy to lookup the params (...) but it should give you an idea where to look Code: [Select] PROGRAM gtk-window; USES gtk, gdk, glib; VAR   edit, window: pGtkWidget; BEGIN   gtk_init(@argc, @argv);   window := gtk_window_new(GTK_WINDOW_TOPLEVEL);   gtk_window_set_title(GTK_WINDOW(window), 'Test window');   gtk_container_set_border_width(GTK_CONTAINER(window), 250);   gtk_widget_show(window);   edit := gtk_entry_new(....);   gtk_widget_show(edit);   gtk_container_add(GTK_CONTAINER(window), edit);   gtk_main(); END. ---------------------------------------------------------------------- Rickard · 2008-02-01 22:09 Thanks! I've got inspiration from the code. Perhaps I can use: edit := gtk_entry_set_text (GtkEntry ... ); instead of edit := gtk_entry_new( ... ); ? ---------------------------------------------------------------------- felipemdc · 2008-02-02 10:28 Just try it and find out. You can read the docs for the functions on the gtk websit.