简体   繁体   English

我该如何从GTK的Glade获取文本输入?

[英]How would I go about getting text entry from Glade in GTK?

I am working on trying to get Text input from my text entry fields to an array. 我正在尝试从文本输入字段中获取文本输入到数组。 I have 8 text entry fields and have been following many of the tutorials. 我有8个文本输入字段,并且已经关注了许多教程。 So far from what I gathered . 离我聚集的太远了。 I have 我有

void on_Save_and_Process_button_clicked(GTKButton *button, GtkEntry *text){

GTKWidget *entry1 = lookup_widget(text,"entry1");

Const g char *entry_text1 = gtk_entry _get_text(GTK_ENTRY(entry1));

}

I am getting an warning in: 我在收到警告:

GTKWidget *entry1 = lookup_widget(text,"entry1");

That says: 说的是:

warning: intialization make pointer from integer without a cast 警告:初始化从整数开始使指针不带强制转换

This my first GTK project. 这是我的第一个GTK项目。 Any help,guidance, links to tutorials of similar projects would be much appreciated. 任何帮助,指导,链接到类似项目的教程将不胜感激。

The function lookup_widget was part of Glade 2, a long time ago. 很久以前,函数lookup_widget是Glade 2的一部分。 Back then, Glade would generate C code, instead of an XML file, and that function was included in the generated code. 那时,Glade会生成C代码而不是XML文件,并且该函数已包含在生成的代码中。

You can't even run Glade 2 anymore most likely, so the tutorial you are using is not going to help you very much. 您甚至不可能再运行Glade 2,因此您正在使用的教程不会对您有太大帮助。 Use a more modern tutorial, such as the one included in the official GTK 3.x documentation. 使用更现代的教程,例如官方GTK 3.x文档中包含的教程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM