Gtkdialog Development

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

Re: Unexpected output value from gtkdialog3/4

#691 Post by thunor »

rerwin wrote:...
The code for this trace is:

Code: Select all

RETVALS=`gtkdialog3 --program=MAIN_DIALOG --center`

eval $RETVALS
if [[ "$EXIT" == "RESTART" ]] ; then 
As a test, I coded:

Code: Select all

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: Select all

eval `gtkdialog3 --program=MAIN_DIALOG --center | grep ^EXIT=`
Regards.

User avatar
EDDIE_THE_HEAD
Posts: 15
Joined: Mon 03 Dec 2012, 02:24
Location: Córdoba, Argentina

#692 Post by EDDIE_THE_HEAD »

thunor wrote: What you could do next is download the gtkdialog-0.8.2 source package and try that.
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!! :wink:

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#693 Post by thunor »

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: Select all

pkg-config --modversion gtk+-2.0
pkg-config --modversion glib-2.0
Many thanks,
Thunor

User avatar
EDDIE_THE_HEAD
Posts: 15
Joined: Mon 03 Dec 2012, 02:24
Location: Córdoba, Argentina

#694 Post by EDDIE_THE_HEAD »

thunor wrote: Can you please supply me with your version of Ubuntu and the output from these:

Code: Select all

pkg-config --modversion gtk+-2.0
pkg-config --modversion glib-2.0

Code: Select all

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

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#695 Post by thunor »

@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

User avatar
EDDIE_THE_HEAD
Posts: 15
Joined: Mon 03 Dec 2012, 02:24
Location: Córdoba, Argentina

#696 Post by EDDIE_THE_HEAD »

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.

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#697 Post by thunor »

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.

User avatar
EDDIE_THE_HEAD
Posts: 15
Joined: Mon 03 Dec 2012, 02:24
Location: Córdoba, Argentina

#698 Post by EDDIE_THE_HEAD »

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>

User avatar
EDDIE_THE_HEAD
Posts: 15
Joined: Mon 03 Dec 2012, 02:24
Location: Córdoba, Argentina

#699 Post by EDDIE_THE_HEAD »

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 :)

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#700 Post by thunor »

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.

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#701 Post by thunor »

@EDDIE_THE_HEAD

This is the order that gtkdialog creates and shows the widgets and this is gtkdialog code.

Code: Select all

#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
Attachments
menubar.tar.gz
See notes within C source about how to compile and run.
(580 Bytes) Downloaded 492 times

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#702 Post by thunor »

@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: Select all

#!/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

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#703 Post by thunor »

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

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#704 Post by 01micko »

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

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#705 Post by don570 »

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/viewto ... 0fabe201af

__________________________________________

User avatar
EDDIE_THE_HEAD
Posts: 15
Joined: Mon 03 Dec 2012, 02:24
Location: Córdoba, Argentina

#706 Post by EDDIE_THE_HEAD »

@Thunor

Thanks for everything. I haven't tried that C code you posted 'cause I've been occupied with other things and had no time to fix some issues in the virtual machine where I'm running Ubuntu. I believe that (the fact that I'm running it in VirtualBox) is the only difference in my setup, so it could certainly be the source of the problem. In fact, I've encountered much more trouble than I ever had when Ubuntu was my host OS.

I'll get back to you as soon as I can run the tests you suggested.

Cheers.

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#707 Post by thunor »

Gtkdialog 0.8.3 Released

Changes:
* Solved the hidden widgets leaving artifacts at start-up problem.
* Added support for conditional actions with <action condition="type">.
* Added support for <variable export="false">VARNAME</variable>.
* Added button-press/release-event signals to comboboxentry's entry.
* Added support for break i.e. don't process any more actions.
* Connected-up the realize signal so that it can be used within actions.
* Refreshing markup in a text widget now works as expected.
* Added three new examples including the Pfeme emulator front-end.
* Fixed bashisms within examples where possible and made them portable.
* Fixed three examples.

http://code.google.com/p/gtkdialog/downloads/list

It's gone quiet so it must've matured by now :) Thanks to everyone who assisted with testing.

If anyone's interested I've written an emulator front-end using gtkdialog called Pfeme. I actually used a very small piece of perl code to merge the times-played data into the games list and it's so fast! I really recommend taking a look at perl to manage the complex parts of your applications.

Regards,
Thunor

User avatar
frafa
Posts: 10
Joined: Thu 04 Aug 2011, 14:48
Location: MONTPELIER
Contact:

#708 Post by frafa »

Hi Thunor
HAPPY NEW YEAR 2013 :)
Thank you for this new version of gtkdialog,
I put the packages for Ubuntu/Debian Bits 32 and 64 provide a ...
It is here: http://liveusb.info/tmp/gtkdialog-0.8.3/
Last edited by frafa on Fri 11 Jan 2013, 11:14, edited 1 time in total.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#709 Post by don570 »

I put the gtkdialog examples in an easy to install pet package

http://murga-linux.com/puppy/viewtopic.php?t=82059


__________________________________________________

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#710 Post by SFR »

Hey Thunor et al

There's ambiguous behaviour of <spinbutton> when floating point values are in use.

Example 1:

Code: Select all

echo '<spinbutton range-step="0.01"></spinbutton>' | gtkdialog -s
works fine with English country settings (dot as a decimal separator), but fails with, eg. German (comma as separator).

Example 2:

Code: Select all

echo '<spinbutton range-step="0,01"></spinbutton>' | gtkdialog -s
and the situation is opposite.

Ref:
http://murga-linux.com/puppy/viewtopic. ... 587#681587
http://murga-linux.com/puppy/viewtopic. ... 138#682138 (last sentence)

Is there anything what can be done about it, or the only way is to determine which type of decimal separator is in use (btw, what's the best way to do so?), before I export the GUI?

Thanks & Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

Post Reply