Page 1 of 1

Glade3-3.6.7-full and gtk-server-2.3.1-03

Posted: Sun 28 Apr 2013, 15:09
by der-schutzhund
Hi,

i have created a GUI with Glade3-3.6.7 and created with gtk-server-2.3.1-03 a Bashscript.
http://www.murga-linux.com/puppy/viewtopic.php?t=60705

Can anyone tell me how to read the contents of text fields, etc. in the Gladefile?

Greedings

Wolfgang

Posted: Sun 28 Apr 2013, 17:55
by sunburnt
Hi der-schutzhund; I`d help, but I don`t know what a Glade file looks like.

Post a section of code showing what you want to ( scrape or read? ).

Posted: Sun 28 Apr 2013, 19:50
by der-schutzhund
Hi,

very nice that you will help me!

The Projectfiles are:
project.glade, project.inc, functions.inc, events.inc and the script myproject

In the file functions.inc each Button gets his function and in this file i need the entry of the textfields into stringsvariables and the other checkfields.

In "on_speichern_clicked ()" i have tried out but it will not work!

The pet must be installed!

greetings

Wolfgang

Posted: Tue 30 Apr 2013, 17:59
by sunburnt
I think what you`re saying is that you want to assign the contents of the text boxes and check boxes to variables?
Doesn`t Glade have a standard way of doing this? I`ve never used Glade so I`m not aware of how it returns data.

If you want to scrape the info from the GUI while the GUI is up and running, the Glade file doesn`t contain the data.
I assumed you wanted to extract text from a file, if this is so show the text you want to automatically grab.

I was not aware that Glade uses GtkServer as it`s GTK+ wrapper.

You could just make the GUI with GtkServer and use it`s output.

If this is for Puppy only, then best to use GtkDialog for the GUI.

Or use BaCon to make the GUI. It makes an exec. file that shows GUIs and manipulates data ( BASIC language ).
http://murga-linux.com/puppy/viewtopic.php?t=48901
http://basic-converter.org/
http://basic-converter.proboards.com/
BaCon exec files should work in almost any Linux distro.
.

Posted: Tue 30 Apr 2013, 19:17
by der-schutzhund
The Target is to make a gui without programming the Elements!!!!!!
Is it right that this is impossible with Bacon and gtkdialog-ide ?

Posted: Tue 30 Apr 2013, 20:36
by seaside
der-schutzhund ,

I don't really know much about gtkserver, but looking at your test "project.glade" file, if you want to pass the text variables to your "functions.inc" file, you could pass them as parameters to the called functions like this....

Code: Select all

<signal name="clicked" handler="on_abbrechen_clicked "$VARID" "$VARID" "$VARID""/>
Each $VARID is the widget "id=VAR" for those widgets. For example to pass only the "<widget class="GtkEntry" id="wpassid">" text entry, the code would be

Code: Select all

<signal name="clicked" handler="on_abbrechen_clicked "$wpassid""/>
Your function could receive them as ""$1" "$2" , etc.


Cheers,
s

Posted: Sat 04 May 2013, 16:32
by jamesbond
der-schutzhund,

I use glade to generate GtkBuilder XML files (instead of glade files). This way you don't depend on libglade, but only on base libgtk. I have written an example here, granted it is for TreeView but it would be similar for entry fields: http://murga-linux.com/puppy/viewtopic.php?t=77026.

If you want to see more working examples, get Fatdog ISO and boot it. Most of Fatdog's core GUI are based on gtk-server. Examine the contents of /usr/sbin/*.sh.xml - these are the GtkBuilder XML GUI files which you can open with glade, and the corresponding *.sh files are the shell scripts for the GUI. fatdog-event-manager.sh and fatdog-event-manager.sh.xml are probably the easiest to follow.

cheers!