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:

#601 Post by thunor »

smokey01 wrote:export script='
<window title="Nudger" icon-name="gtk-preferences" 0 0>
The above produces this error in 0.8.2:

Code: Select all

** ERROR **: gtkdialog: Error in line 2, near token 'tag attribute name': syntax error
It doesn't error in 0.8.0.

The cause is the " 0 0" at the end but what's interesting is that previous versions allowed it. The error will be coming from the parser and I guess it wasn't being too thorough before, but I've recently modified the parser to allow tag attribute names to include numbers (arg0="" arg1="" etc. for the terminal widget) so that's likely the reason why it's not tolerated anymore.

Regards,
Thunor

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#602 Post by smokey01 »

It works ok in 0.8.1 too.

Thanks

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#603 Post by zigbert »

thunor wrote:I'm in the process of setting-up slacko 533 to use as my main distro so Sigmund I will look into your issues once I'm settled.
Good news :)

User avatar
ariel
Posts: 140
Joined: Fri 03 Jul 2009, 19:47
Contact:

#604 Post by ariel »

if my memory serves me well I remember reading in the gtkdialog website that it could be possible to insert gtkdialog guis into C code. it seems that now I cannot find that reference anymore.

can anybody give me a very simple example of it?

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#605 Post by vovchik »

Dear ariel,

Here is example from thunor's sources.

WIth kind regards,
vovchik
Attachments
c_embedded.tar.gz
(2.29 KiB) Downloaded 689 times

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#606 Post by vovchik »

Dear guys,

While I was at it, I did two examples of the c-embedded in BaCon. They might be useful for somebody....

With kind regards,
vovchik
Attachments
bacon-gtkdialog.tar.gz
(12.68 KiB) Downloaded 688 times

User avatar
ariel
Posts: 140
Joined: Fri 03 Jul 2009, 19:47
Contact:

#607 Post by ariel »

Thanks vovchik :D I browsed neither all the 40 odd pages of the thread nor the sources you mentioned. the examples look interesting.
Last edited by ariel on Sat 17 Nov 2012, 20:03, edited 2 times in total.

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#608 Post by 8-bit »

I have gtkdialog subversion 375 installed along with vte-0.28.2-i486.pet and I am getting a segmentation fault trying to run the terminal example.
Am I missing something or did something get changed in the progress of development of gtkdialog?

:oops: I feel like the motley fool complaining about things without checking my puppy for the latest version of gtkdialog!
I found that I had installed an early version and after installing the later version, the terminal example worked fine.
So now, I will be able to use it.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#609 Post by zigbert »

Bugreport

Trying to sort out the bugs for pMusic 3, I have met another gtkdialog-issue.
While the previous mentioned (use reorderable="true" in <tree>) is not documented in the gtkdialog reference guide, this one is:
Somehow, hidden <entry> does show up.
This happens only if <entry> is set invisible in the first place. After executing 'show' and then 'hide', the <entry> is not visible anymore.

Image shows what user meets at first run of pMusic 3.
The search-dock is hidden and contains an <entry> - the one you can see over the scrollbar.

Image


To simplify and make it all clearer, I have made a small test-script.

Code: Select all

echo '|there is hidden entry disturbing
|me so badly in this simple bash script.
|Is there a way to get around this
|annoying behaviour.' > /tmp/test

echo '
<vbox>
<hbox>
 <tree>
  <label>1|2</label>
  <input file>/tmp/test</input>
 </tree>
 <entry visible="false"><variable>HIDDEN_ENTRY</variable><default>Am I hidden</default></entry>
</hbox>
 <togglebutton label="show/hide entry">
  <action>if true show:HIDDEN_ENTRY</action>
  <action>if false hide:HIDDEN_ENTRY</action>
 </togglebutton>
</vbox>
' | gtkdialog -s

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#610 Post by zigbert »

What does the <input> control of the <menu> widget?
I could not find any example, and tried both to set label and icon via the <input> directive....


Sigmund

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#611 Post by zigbert »

This is probably way off the line, but I have several times wished this behavior, so must ask......

Would it be possible to combine the builtin functions with other <actions>. Something like:

Code: Select all

<action>[ $FORMAT = flac" ] && disable:BITRATE</action>
or

Code: Select all

<action>[ $FORMAT = flac" ] && <action>disable:BITRATE</action></action>

Sigmund

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#612 Post by technosaurus »

I haven't tried but would something like this pseudo work

disable_bitrate_if_fmt()
[ "$FORMAT" = "$1" ] && export BITRATEVISIBLE=disabled
}

<action>disable_bitrate_if_fmt flac</action>
...
<visible>BITRATEVISIBLE</visible>
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#613 Post by zigbert »

technosaurus
I'm often wrong, but I think <input> is the only thing you can refresh after the gui is loaded.

That is how <checkbox> and <togglebutton> have different usage. The first refreshes state, the latter refreshes icon.


Sigmund


EDIT
It is often not a question IF you can solve it, but HOW. Too many workarounds make my code harder to maintain.

It is of course possible to disable a widget from a non-builtin function but it requires some code... One way is to use an invisible checkbox to disable/enable while the function changes status of the checkbox's input file.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#614 Post by zigbert »

I have no idea if this is a bug, a limitation or just how stuff are supposed to work. - But I will mention it anyway :)

<comboboxentry> is only returning the signal for key-release-event.
Other signals seems to be 'dead'

Code: Select all

#!/bin/sh
echo '
<window title="Signals">
 <comboboxentry>
  <input>ls -1 '$HOME'/</input>
  <action signal="button-press-event">echo Entry: button-press_event</action>
  <action signal="button-release-event">echo Entry: button-release-event</action>
  <action signal="configure-event">echo Entry: configure-event</action>
  <action signal="enter-notify-event">echo Entry: enter-notify-event</action>
  <action signal="leave-notify-event">echo Entry: leave-notify-event</action>
  <action signal="focus-in-event">echo Entry: focus-in-event</action>
  <action signal="focus-out-event">echo Entry: focus-out-event</action>
  <action signal="key-press-event">echo Entry: key-press-event</action>
  <action signal="key-release-event">echo Entry: key-release-event</action>
  <action signal="hide">echo Entry: hide</action>
  <action signal="show">echo Entry: show</action>
  <action signal="map-event">echo Entry: map-event</action>
  <action signal="unmap-event">echo Entry: unmap-event</action>
 </comboboxentry>
</window>
' | gtkdialog -s

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#615 Post by seaside »

zigbert wrote:I have no idea if this is a bug, a limitation or just how stuff are supposed to work. - But I will mention it anyway :)

<comboboxentry> is only returning the signal for key-release-event.
Other signals seems to be 'dead'

Code: Select all

#!/bin/sh
echo '
<window title="Signals">
 <comboboxentry>
  <input>ls -1 '$HOME'/</input>
  <action signal="button-press-event">echo Entry: button-press_event</action>
  <action signal="button-release-event">echo Entry: button-release-event</action>
  <action signal="configure-event">echo Entry: configure-event</action>
  <action signal="enter-notify-event">echo Entry: enter-notify-event</action>
  <action signal="leave-notify-event">echo Entry: leave-notify-event</action>
  <action signal="focus-in-event">echo Entry: focus-in-event</action>
  <action signal="focus-out-event">echo Entry: focus-out-event</action>
  <action signal="key-press-event">echo Entry: key-press-event</action>
  <action signal="key-release-event">echo Entry: key-release-event</action>
  <action signal="hide">echo Entry: hide</action>
  <action signal="show">echo Entry: show</action>
  <action signal="map-event">echo Entry: map-event</action>
  <action signal="unmap-event">echo Entry: unmap-event</action>
 </comboboxentry>
</window>
' | gtkdialog -s
zigbert,

They work if you put them just within the </window> tag after the </comboboxentry> tag.

Code: Select all

 #!/bin/sh
echo '
<window title="Signals">
 <comboboxentry>
  <input>ls -1 '$HOME'/</input>
 </comboboxentry>
  <action signal="configure-event">echo Entry: configure-event</action>
  <action signal="enter-notify-event">echo Entry: enter-notify-event</action>
  <action signal="leave-notify-event">echo Entry: leave-notify-event</action>
  <action signal="focus-in-event">echo Entry: focus-in-event</action>
  <action signal="focus-out-event">echo Entry: focus-out-event</action>
  <action signal="key-press-event">echo Entry: key-press-event</action>
  <action signal="key-release-event">echo Entry: key-release-event</action>
  <action signal="hide">echo Entry: hide</action>
  <action signal="show">echo Entry: show</action>
  <action signal="map-event">echo Entry: map-event</action>
  <action signal="unmap-event">echo Entry: unmap-event</action>
</window>
' | gtkdialog -s 
I think the "button press" events have to be within a <button> tag

Maybe more good info for the tips thread.

Regards,
s

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

#616 Post by thunor »

zigbert wrote:Bugreport

Trying to sort out the bugs for pMusic 3, I have met another gtkdialog-issue.
While the previous mentioned (use reorderable="true" in <tree>) is not documented in the gtkdialog reference guide, this one is:
Somehow, hidden <entry> does show up.
This happens only if <entry> is set invisible in the first place. After executing 'show' and then 'hide', the <entry> is not visible anymore
Last year we discussed the tree widget and the "reorderable" gtk property: the tree widget uses the wrong model (tree model) and you'll end up dragging rows onto other rows and they'll disappear into branches that you can't reach, so it doesn't work as expected.

"reorderable" is not a gtkdialog custom tag attribute, it's a gtk property so it's not documented within gtkdialog's widget reference although the gtk properties are linked to.

The strange behaviour with the hidden entry widget I have experienced myself. This is not new, I have tested this back to gtkdialog3-0.7.20-pe-1 so it's likely always been like that but you've never been able to show widgets before so now it's an issue. gtkdialog uses the gtk function gtk_widget_show_all() to show (make visible) all the widgets at start-up, then any tag attributes that are gtk properties are applied, so visible="false" is a gtk property which hides the already shown widget. I have experienced this resulting in some weird behaviour just as you have with the entry widget although some widgets seem to hide cleanly. gtk is responsible for rendering the widgets so if it leaves artifacts then that's how it is, but I can look into showing widgets individually which might solve this. I say "artifact" because it is visible="false" even though you can see it (try typing into it and then show it).
zigbert wrote:What does the <input> control of the <menu> widget?
true or false although pretty pointless. It exists because the menu widget is actually a menuitem with a submenu so the interface is the same as the menuitem widget.
zigbert wrote:Would it be possible to combine the builtin functions with other <actions>. Something like:

Code: Select all

<action>[ $FORMAT = flac" ] && disable:BITRATE</action>
or

Code: Select all

<action>[ $FORMAT = flac" ] && <action>disable:BITRATE</action></action>
I'll add a feature request for it.
zigbert wrote:I have no idea if this is a bug, a limitation or just how stuff are supposed to work. - But I will mention it anyway :)

<comboboxentry> is only returning the signal for key-release-event.
Other signals seems to be 'dead'
I detected key-press-event, key-release-event, hide, show, activate and changed. The entry part is a child widget and I'm guessing that you're expecting to be able to detect the same signals as an entry widget. The process of connecting up the common GtkWidget signals is automated so gtkdialog is connecting them to the comboboxentry widget, not the child entry widget although this could be done manually within the widget_comboboxentry.c module. What signals do you want? I can add a feature request for it.

I'm not looking to do another massive update. I'd like to do a small 0.8.3 update because I've got another project I want to continue. I'm still a happy Puppy user so I'll be around now and then but I think some people more involved with Puppy should volunteer to be project committers because it's an important fundamental component of Puppy and life moves on. At some point somebody may require a modification to the code and nobody except me will be able to commit and I won't be around.

sklimkin
Posts: 157
Joined: Wed 11 Jul 2012, 21:21
Location: Russia Moscow

collect from combo-boxes string of parameters for ext. progs

#617 Post by sklimkin »

thunor wrote: ... ... ...
I want to ask experts:
Probably-whether in gtkdialog (the old version 0.8 or 0.5) to receive from combo-boxes a string of parameters for a call of the external program?
I have placed the question on page:
http://murga-linux.com/puppy/posting.ph ... e&p=661379
Post subject: make string of argements for scrot-program

I have solved this task with the help gcc + GTK2 (37 KB).
But I want to reduce the size of the program and to eliminate possible errors in the absence of libraries.
Therefore the script in this case is more preferable (1.7 KB).
But the answer there it will not be probable.

Therefore I ask now here.
Certainly it would be desirable to hear judgement such as thunor, zigbert ...
Certainly if this question is of interest for developers gtkdialog

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#618 Post by zigbert »

thunor wrote:I'm guessing that you're expecting to be able to detect the same signals as an entry widget. [...] What signals do you want? I can add a feature request for it.
You got me right. I was looking for a button-release-event to avoid <action> to execute when clicking in the entry widget.

Thank you for your very clear explanations. I admire your knowledge of what your doing. You show yourself as a very skilled person.

Please remember my nr. 1 Puppy rule: If things are not funny anymore, go do something else. When somebody start yelling about lack of critical features or serious bugs, I very soon get pissed. Puppy is NOT SERIOUS, it should be pure fun. I take a break, and come back when my inspiration is peaking.

I am very thankful for what you have done with gtkdialog. There will always be limits, and I build guis out of what's available. pMusic is experimental code to push the limits of gtkdialog. It is a learning project.


Sigmund

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#619 Post by zigbert »

Thunor
Thank you for r464


Sigmund

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#620 Post by zigbert »

Testing the updated output of <tree> widget :D
r467

The format of the output file changes a bit. Look at this:

Code: Select all

#!/bin/bash

echo -e "gtk-ok|row1\n|row2\n|row3\n\n" > /tmp/treetest 

echo '
<window default_height="300">
 <vbox>
  <text><label>"Move row in tree and see result. The output file has got an extra leading pipe before every row.
  
Also output for blank lines differ. I do not see the problem of this, but will mention anyway."</label></text>
  <tree reorderable="true" hover-selection="true">
   <label>A|B</label>
   <input file stock-column="0">/tmp/treetest</input>
   <output file>/tmp/treetest_out</output>
   <variable>TREE</variable>
   <action signal="cursor-changed">save:TREE</action>
   <action signal="button-release-event">xmessage "    input file: `cat /tmp/treetest`:::    output file: `cat /tmp/treetest_out`" &</action>
  </tree>
 </vbox>
</window>' | gtkdialog -s

Post Reply