The time now is Fri 20 Apr 2018, 08:59
All times are UTC - 4 |
Page 47 of 56 [833 Posts] |
Goto page: Previous 1, 2, 3, ..., 45, 46, 47, 48, 49, ..., 54, 55, 56 Next |
Author |
Message |
thunor

Joined: 14 Oct 2010 Posts: 350 Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
|
Posted: Fri 07 Dec 2012, 11:31 Post subject:
Re: Unexpected output value from gtkdialog3/4 |
|
rerwin wrote: | ...
The code for this trace is: Code: | RETVALS=`gtkdialog3 --program=MAIN_DIALOG --center`
eval $RETVALS
if [[ "$EXIT" == "RESTART" ]] ; then |
As a test, I coded:
Code: | RETVALS=`gtkdialog3 --program=MAIN_DIALOG --center | grep =` |
which solves the problem. But I have not noticed any other gtkdialog result processing that does that.
I assume the the "OK" is only a confirmation that the invocation did not fail, but a failure would probably output a message to stderr. Or would it?
Richard |
The problem is with using RETVALS=`gtkdialog` is that you're going to catch everything sent to stdout including whatever programs you are running from within your gtkdialog application. Where does that "OK" come from? Something that your application is executing is responsible for that.
I'll tell you how it works: every widget that has a <variable> directive will be printed to stdout on application exit unless you use <variable export="false">. So do you actually want to evaluate everything or is there something in particular?
" | grep =" is going to remove lines such as "OK" which is good.
Do people actually use this method of capturing all of stdout? I don't think it's very common.
See this Frisbee post because I mentioned this before and I saw that peebee had changed the code.
If all you want to evaluate is EXIT then what's wrong with:
Code: | eval `gtkdialog3 --program=MAIN_DIALOG --center | grep ^EXIT=` |
Regards.
|
Back to top
|
|
 |
EDDIE_THE_HEAD

Joined: 02 Dec 2012 Posts: 15 Location: Córdoba, Argentina
|
Posted: Fri 07 Dec 2012, 16:16 Post subject:
|
|
Well, I'm afraid I was originally running the tests on gtkdialog 0.8.2. Anyway, I'll keep you posted, see if anything comes to mind.
Cheers!!
|
Back to top
|
|
 |
thunor

Joined: 14 Oct 2010 Posts: 350 Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
|
Posted: Fri 07 Dec 2012, 18:20 Post subject:
|
|
EDDIE_THE_HEAD wrote: | ...
Well, I'm afraid I was originally running the tests on gtkdialog 0.8.2. Anyway, I'll keep you posted, see if anything comes to mind.
... |
Ah, so that's 0.8.2 and 0.8.3 which both use different methods to show the widgets and you still can't see the menubar; that's not good
I'll email this other chap and see what he's using.
Can you please supply me with your version of Ubuntu and the output from these:
Code: | pkg-config --modversion gtk+-2.0
pkg-config --modversion glib-2.0 |
Many thanks,
Thunor
|
Back to top
|
|
 |
EDDIE_THE_HEAD

Joined: 02 Dec 2012 Posts: 15 Location: Córdoba, Argentina
|
Posted: Sat 08 Dec 2012, 03:25 Post subject:
|
|
thunor wrote: |
Can you please supply me with your version of Ubuntu and the output from these:
Code: | pkg-config --modversion gtk+-2.0
pkg-config --modversion glib-2.0 |
|
Code: |
ale@Linux:~$ pkg-config --modversion gtk+-2.0
2.24.10
ale@Linux:~$ pkg-config --modversion glib-2.0
2.32.3
|
I am using Ubuntu 12.04 LTS
|
Back to top
|
|
 |
thunor

Joined: 14 Oct 2010 Posts: 350 Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
|
Posted: Sat 08 Dec 2012, 12:44 Post subject:
|
|
@EDDIE_THE_HEAD
Thanks for that.
Today I worked on the files within examples/miscellaneous and tested them with my /bin/sh linking to /bin/dash. I found a problem with the operation of the progressbar in the show_and_hide example with nonsensical gdk error messages, a non-showing window and I even had an empty window. All of these problems disappear when my /bin/sh links to /bin/bash, so I'm going to recommend that you try symlinking your /bin/sh to /bin/bash and then try your menu example again. Don't forget to symlink /bin/sh back to dash once you've finished. Im just throwing in suggestions -- maybe it'll help isolate the problem.
Regards,
Thunor
|
Back to top
|
|
 |
EDDIE_THE_HEAD

Joined: 02 Dec 2012 Posts: 15 Location: Córdoba, Argentina
|
Posted: Sun 09 Dec 2012, 14:48 Post subject:
|
|
Thunor,
Yesterday I tried gtkdialog in Linux Mint 14 and the menus are working! Since it is ubuntu-based I kinda was expecting to come across the same issue but luckily I didn't. This led me to think that maybe something was wrong with my ubuntu config so I ran a clean install in virtualbox but still the menus and menubars aren't showing. So apparently there's some kind of incompatibility with 12.04.1 LTS. I am downloading version 12.10 now, I'll bring you the results in a couple of hours.
|
Back to top
|
|
 |
thunor

Joined: 14 Oct 2010 Posts: 350 Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
|
Posted: Sun 09 Dec 2012, 18:34 Post subject:
|
|
EDDIE_THE_HEAD wrote: | Yesterday I tried gtkdialog in Linux Mint 14 and the menus are working! ... I am downloading version 12.10 now, I'll bring you the results in a couple of hours. |
Great.
I got a reply from Francois of LiveUSB Multiboot and he said that "for me and all multisystem users, gtkdialog 0.8.2 works fine with Ubuntu 12.04 and 12.10".
Regards.
|
Back to top
|
|
 |
EDDIE_THE_HEAD

Joined: 02 Dec 2012 Posts: 15 Location: Córdoba, Argentina
|
Posted: Sun 09 Dec 2012, 19:20 Post subject:
|
|
thunor wrote: |
I got a reply from Francois of LiveUSB Multiboot and he said that "for me and all multisystem users, gtkdialog 0.8.2 works fine with Ubuntu 12.04 and 12.10".
|
Well that's great news, though it makes me even more curious about what's causing the problem in my case.
A little question off the topic while I'm installing v12.10:
Is it possible to make a menu without menuitems so that it may do something when I click rather than display a bunch of options?
EDIT:
Also, can you include more than one condition in an action? Are there special operators to do so?
For instance:
<action condition="command_is_true(argument) AND sensitive_is_true(argument)"></action>
|
Back to top
|
|
 |
EDDIE_THE_HEAD

Joined: 02 Dec 2012 Posts: 15 Location: Córdoba, Argentina
|
Posted: Sun 09 Dec 2012, 21:27 Post subject:
|
|
Nope. No menus in Ubuntu 12.10 either... It is starting to drive me crazy. I guess I'll have to switch to Mint for the moment
|
Back to top
|
|
 |
thunor

Joined: 14 Oct 2010 Posts: 350 Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
|
Posted: Mon 10 Dec 2012, 12:40 Post subject:
|
|
EDDIE_THE_HEAD wrote: | ...
Is it possible to make a menu without menuitems so that it may do something when I click rather than display a bunch of options?
...
Also, can you include more than one condition in an action? Are there special operators to do so? |
No and no. I've only just added support for conditions within actions but it can be expanded later. I'm currently working towards making an 0.8.3 source package release so I'm not planning on adding any more new features.
EDDIE_THE_HEAD wrote: | Nope. No menus in Ubuntu 12.10 either... It is starting to drive me crazy. I guess I'll have to switch to Mint for the moment  |
Ok, so what's the difference between your set-up and somebody else's? You said that you were using VirtualBox, therefore you have a host operating system with VirtualBox and then you're installing and running Ubuntu within a virtual machine.
What else? Ubuntu 12.04 uses Unity on top of GTK+ 3 therefore either it comes with GTK+ 2 too or you've installed it.
I'd like to discover why you can't see the menubar but I can't set-up a test environment like yours.
Do you have other GTK+ 2 apps written in C on your computer that have a menubar with menuitems? I can write a very simple program in C that has a menubar and one menuitem and I'll just copy and paste the code out of gtkdialog so it's all done in the same way and then you can test it.
Being forced to use another distro is over the top.
Regards.
|
Back to top
|
|
 |
thunor

Joined: 14 Oct 2010 Posts: 350 Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
|
Posted: Mon 10 Dec 2012, 13:57 Post subject:
|
|
@EDDIE_THE_HEAD
This is the order that gtkdialog creates and shows the widgets and this is gtkdialog code.
Code: | #include <gtk/gtk.h>
/* Notes:
*
* Compile with:
*
* gcc menubar.c -o menubar `pkg-config --cflags --libs gtk+-2.0`
*
* Run it in a terminal and press CTRL+C to kill it */
int main(int argc, char *argv[])
{
GtkWidget *menubar;
GtkWidget *menubarmenuitem;
GtkWidget *menu;
GtkWidget *menuitem;
GtkWidget *window;
gtk_init(&argc, &argv);
menuitem = gtk_image_menu_item_new_from_stock("gtk-quit", NULL);
menu = gtk_menu_new();
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
menubarmenuitem = gtk_menu_item_new_with_label("File");
gtk_menu_item_set_submenu(GTK_MENU_ITEM(menubarmenuitem), menu);
menubar = gtk_menu_bar_new();
gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menubarmenuitem);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_add(GTK_CONTAINER(window), menubar);
gtk_widget_show(menuitem);
gtk_widget_show(menu);
gtk_widget_show(menubarmenuitem);
gtk_widget_show(menubar);
gtk_widget_show(window);
gtk_main();
return 0;
} |
Try that although it's just a fraction of the gtkdialog code so it'll only demonstrate that you can see the menubar and menuitems. I personally can't go anywhere from here.
Regards,
Thunor
Description |
See notes within C source about how to compile and run.
|

Download |
Filename |
menubar.tar.gz |
Filesize |
580 Bytes |
Downloaded |
445 Time(s) |
|
Back to top
|
|
 |
thunor

Joined: 14 Oct 2010 Posts: 350 Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
|
Posted: Mon 10 Dec 2012, 19:43 Post subject:
|
|
@EDDIE_THE_HEAD
Actually there is one more thing: you can show and hide widgets with action functions so you can try this example:
Code: | #!/bin/sh
echo '
<window window-position="1">
<vbox>
<menubar>
<menu label="_File" use-underline="true">
<menuitem stock-id="gtk-open">
<variable>OPEN</variable>
<action signal="show">echo showing OPEN</action>
<action signal="hide">echo hiding OPEN</action>
<action signal="realize">echo realizing OPEN</action>
</menuitem>
<menuitem stock-id="gtk-save">
<variable>SAVE</variable>
<action signal="show">echo showing SAVE</action>
<action signal="hide">echo hiding SAVE</action>
<action signal="realize">echo realizing SAVE</action>
</menuitem>
<menuitem stock-id="gtk-quit">
<variable>QUIT</variable>
<action signal="show">echo showing QUIT</action>
<action signal="hide">echo hiding QUIT</action>
<action signal="realize">echo realizing QUIT</action>
</menuitem>
<variable>FILE</variable>
<action signal="show">echo showing FILE</action>
<action signal="hide">echo hiding FILE</action>
<action signal="realize">echo realizing FILE</action>
</menu>
<variable>MENUBAR</variable>
<action signal="show">echo showing MENUBAR</action>
<action signal="hide">echo hiding MENUBAR</action>
<action signal="realize">echo realizing MENUBAR</action>
</menubar>
<button label="Show everything">
<action>show:OPEN</action>
<action>show:SAVE</action>
<action>show:QUIT</action>
<action>show:FILE</action>
<action>show:MENUBAR</action>
</button>
<button label="Hide everything">
<action>hide:OPEN</action>
<action>hide:SAVE</action>
<action>hide:QUIT</action>
<action>hide:FILE</action>
<action>hide:MENUBAR</action>
</button>
<button ok></button>
</vbox>
</window>
' | gtkdialog -s |
Cheers,
Thunor
|
Back to top
|
|
 |
thunor

Joined: 14 Oct 2010 Posts: 350 Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
|
Posted: Wed 12 Dec 2012, 19:47 Post subject:
|
|
November 16th r472 I connected-up the realize signal since it was half way there anyway but I experienced an instability later on because something was NULL that I wasn't expecting so I fixed it on November 30th r483, therefore I would recommend that if somebody has a version of gtkdialog that is r472 to r482 inclusive then they might want to consider upgrading to the latest version.
I'm all done with adding features to gtkdialog for the moment and am only hanging around making sure any potential problems are resolved, so what's in SVN now (r493) is pretty much what the next source package release is going to be although I'm trying to complete an example application before I release.
Regards,
Thunor
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8670 Location: qld
|
Posted: Wed 12 Dec 2012, 20:42 Post subject:
|
|
Thank you Thunor,
By the week's end I will build Slacko (5.3x and 5.4) gtkdialog packages for broader testing.
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
don570

Joined: 10 Mar 2010 Posts: 4985 Location: Ontario
|
Posted: Wed 12 Dec 2012, 21:04 Post subject:
|
|
The more examples the better!!!
I'll make a pet package of the examples and post them on the
Murga forum.
I've already done this for version 8.2
http://www.murga-linux.com/puppy/viewtopic.php?t=82059&sid=a45ba1576eda1e38e8b5310fabe201af
__________________________________________
|
Back to top
|
|
 |
|
Page 47 of 56 [833 Posts] |
Goto page: Previous 1, 2, 3, ..., 45, 46, 47, 48, 49, ..., 54, 55, 56 Next |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|