ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
ok... let me rephrase...
I have a GTK program. Small and pointless.
There is a text entry box that contains say: ls -aF
When I cilck btn_001 it will copy that strn to a var. From there I need it to be executed.
That's kinda what I meant. Not actually using the console.
Oh sorry. Using C. Using Glade2 to put it all together.
Does glade handle perl?
But I think that's what I'm trying to do. I also don't know if I NEED to throw it to console.
How about something like:
click btn1 and it starts up the samba srv: /usr/local/bin/smbd -D
well glade will generate all the callback stubs for you no problem, you just need to put the actual command you want to run inside the blank callback, so just build a string up from the variable and execute it with a system call.
yes glade2perl works on old gtk, that's how i started with http://acidrip.sf.net but i soon grew out of glade, far too limiting really especially as programming in Gtk really is very very simple after a little while.
Yeah it is. But I'm just trying to throw together a few simple things for tha boss before I go out on this job. He's sooo non linux... hell he's almost completely computer stpuid! heh...
anyway...
this is what I got as far as the proggie. I started out with a system command to handle the string but it doesn't look like it is being executed.
*********************************
{
GtkEntry *two;
GtkWidget * listitem;
gchar str[50];
gchar * p_str = str;
GtkWidget *dialog, *label, *okay_button;
char *text;
/* COPYING THE TEXT ENTERED IN ENTRY1 TO THE LIST WIDGET */
GtkWidget * entry = lookup_widget(GTK_WIDGET(button), "entry_002");
strncpy(p_str, gtk_entry_get_text(GTK_ENTRY(entry)),50);
listitem = gtk_list_item_new_with_label(p_str);
gtk_widget_show(listitem);
text = gtk_entry_get_text(GTK_ENTRY(entry));
two = GTK_ENTRY(lookup_widget(GTK_WIDGET(button), "entry_001"));
Yeah I was looking at that just now. I know the syntax isn't correct according to the mans, but I was just fiddling around with the string trying to figure out how to pass it to a system call.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.