The docs and examples have been updated and of course type="function" is still supported (it was really type="type" but I think it's pretty obvious why it wasn't documented as such).

I'm not sure if anyone is aware of the fact that it is possible to use all of the action's attributes together as shown above which isn't obvious from the wiki/docs or examples therefore you'd never need to use the shortcut function:parameter because you can always move the function into its own function="type" attribute.

Yes, I am boring you - I know.....
I have tried so many times to get the reorderable attribute to work properly. - Not in an example, but in real code. With that I mean to update the <input> after each move. - Else the inputfile are not the same as the outputfile. So my simple test code looks like this, but it does not work. There MUST be a way .... ???

I really should turn my laptop off as it's approaching 4am, but just place <action signal="button-release-event">echo COPY_FORMAT=$COPY_FORMAT</action> above your problematic line and then you'll know what the outcome should be.

What an idiot I met in the mirror this morning.....
It is all clear now (command_is_true). The major bug is between the keyboard and the chair. For pMusic testing I have made a gtkdialog5 symlink to gtkdialog-0.8.2 which is preferred by pMusic if exist. There was no chance for the new code to work.

Exporting functions is a bashism and since you do indeed have /bin/bash at the top of your script, everything would appear to be fine but the contents of the action will be executed as /bin/sh -c now because gtkdialog was written with C and the C library uses /bin/sh, so I'll hazard a guess that you are using Ubuntu and your /bin/sh is a symlink to dash which doesn't support exported functions.

The easy way to deal with this is to use <action>/bin/bash -c now</action> which gtkdialog will ultimately execute as /bin/sh -c /bin/bash -c now.

Widget variables (the ones that you have created and named yourself) will be placed into the shell when an action executes so that you can read the contents of widgets, but you can't change the contents of widgets by modifying their variables -- you'll likely want something like this:

Thanks a lot Thunor!! You were right, I am using Ubuntu and that was exactly the problem.

One last question (for now ): I understand that you can't change the content of a widget by assigning new values to their variables, but say you wanna change the content of a variable (not related to a widget) by clicking a button or with any other signal, how can you do it? For example:

Code:

#!/bin/bash

MY_VAR="DEFAULT VALUE"

export script='
<vbox>
<button>
<label>Change</label>
# What should I put here to assign another value to MY_VAR??
<action></action>
</button>
</vbox>'

gtkdialog -p script

echo MY_VAR

I've tried many things but no matter what the last line keeps printing "DEFAULT VALUE". Perhaps storing the variable in another file??

... I've tried many things but no matter what the last line keeps printing "DEFAULT VALUE". Perhaps storing the variable in another file??

That's exactly what you have to do. You need to maintain variables as files. Anything other than a very simple program will require quite a few variables so I personally create a temporary folder in /tmp and store them in there, then delete the folder on program exit.

For the record, if you want shell variables to be visible to subshells then you have to export them, but any changes that you might make to exported variables will be lost when the subshell exits.

Thanks again!! Yes, I've had a look at some of the examples but I must confess I rather felt at a loss while trying to analyze them. Now with your explanations everything is starting to add up. I will be playing with gtkdialog for the next few days, working on some project for university. Wish me luck!!

So far the only widgets that have given me trouble are the menu, menubar and menuitems. My gtkdialog seems to be ignoring them completely. No matter how I define them, they won't appear in my dialogs.

I've attached a screen capture for you to see. The code belongs to one of your examples.

I am inclined to think that it has something to do with Ubuntu. Or maybe something went wrong during the installation of the package, which would be weird 'cause neither configure nor make install complained...

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum