Strange differences in GtkFileChooserDialog

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

Strange differences in GtkFileChooserDialog

#1 Post by MochiMoppel »

I need help. I noticed a strange difference in the behavior of GtkFileChooserDialog, depending on Puppy version.

GtkFileChooserDialog is the building block for the 'Open' or 'Save as' dialogs in many applications, e.g. Geany.

After booting Slacko 5.6 (or Precise 5.7.1) from USB stick and mounting the stick the left 'Places' pane shows
  • Search
    Recently Used
    ----------------
    root
    File System
    sdb1
    ----------------
When mounting additional partitions they show immediately below sdb1. When unmouting a partition, the entry is immediately removed from the list.

Not so in Tahrpup 6.05 or Lucid 5.2.8. In these Puppies the mounted partitions seem to be missing, the monitoring doesn't seem to work.

But: This difference may be related to another difference, showing in gtkdialog's chooser widget, and here Tahrpup shines where Slacko fails. When hiding and then unhiding a chooser widget, in Slacko the selected file list will not "stick", i.e. after unhiding the dialog reverts to the "Recently Used" list. In MMview this would make temporary hiding of the chooser ( to extend the viewer paner to the complete window width) useless.

Surprisingly hiding/unhiding in Tahrpup/Lucid works without problems. The display reverts to the original state. Perfect.

I now need to know how to distinguish and detect these 2 different behaviors from the command line. Depending on the result my script would then offer different options. How can I detect a specific GTK built?

Below is a demo script. The button of top hides/unhides the chooser, which by default starts in /root. After unhiding it should revert to /root (or any other directory that has been selected). In which Puppy does this work correctly and which Puppy fails?

Code: Select all

#!/bin/sh
echo '
<vbox>
<togglebutton label="Hide/Unhide chooser">
	<action> if true hide:vCHOOSER</action>
	<action> if false show:vCHOOSER</action>
</togglebutton>
<chooser width-request="600" height-request="400">
	<variable>vCHOOSER</variable>
	<default>"/root"</default>
	
</chooser>
</vbox>' | gtkdialog -s

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#2 Post by tallboy »

I applaud your initiative to make this work as intended, I have always just thought of it as a bug, it did not influence on the way I work anyway.
Example from Geany's Open command:
I have never had any use for Recently used, because until Lucid 5.2.8.7, it never worked in any puppy I have used! Now it makes a list of recently opened files of all kinds, that have to be filtered from a massive list of source files (58 to be exact) to be of any use, but only if you look for a specific source. There is no entry for simple 'text-files'. Oh, and I have set encoding and filetype to be detected from file extension in More Options. I miss some sort of dialog between the Open script and the program that use the Open feature, that will restrict the filtering to files that actually can be read/viewed by the program in question, Geany don't open .jpg-files anyway! :D
I have had to make some entries of directories I often use, like my puppylinux dir by clicking the Add button, and those entries are permanently visible, whether the drive or partition is mounted or not. No mounts have ever been detected at all.

Mochi, clicking the Hide/Unhide chooser button from your script in Lucid 5.2.8.7, hides/unhides absolutely everything, except for the chooser button itself.

tallboy
Attachments
mochis-magic-button-unclicked.jpg
(27.44 KiB) Downloaded 212 times
mochis-magic-button.jpg
(8.95 KiB) Downloaded 225 times
Last edited by tallboy on Mon 30 Oct 2017, 03:15, edited 1 time in total.
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#3 Post by tallboy »

BTW, may I draw your attention to the Save dialog, where the Name window never seem to be in focus when I try to enter a file name, after finding the directory where I want to save the file in question, even if the temporary filename untitled is marked as selected. Very annoying.
Could the reason be related to the problems in the Open dialog?

tallboy
True freedom is a live Puppy on a multisession CD/DVD.

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#4 Post by step »

Works as described in Fatdog-710.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#5 Post by greengeek »

My result in Slacko 5.6 derivative:

EDIT : If the animated gif fails to display it may be that image animation is turned off in your browser.
Attachments
Screenshot.gif
(106.53 KiB) Downloaded 165 times
Last edited by greengeek on Tue 31 Oct 2017, 15:42, edited 1 time in total.

belham2
Posts: 1715
Joined: Mon 15 Aug 2016, 22:47

#6 Post by belham2 »

greengeek wrote:My result in Slacko 5.6 derivative:

Whoa, fancy-schmancy gif post, greengeek!! Me like :D Any chance by all graciousness of whim that you could do a short tutorial (in "How-To' section on murga) on how you make/put a "gif-post-on-murga" together so us mere mortals stuck in 2D can bring alive our posts when sometimes needed? :wink:

Would be greatly appreciated :wink:

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#7 Post by jamesbond »

@belham:

http://smokey01.com/newsletters/2017/Ap ... 17.html#19

One more reason to read and subscribe to Puppy News Letter :D
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#8 Post by MochiMoppel »

I've checked now Slacko 6.3.2 and found that the script works as in Tahrpup.
Working: Tahrpup 6.05, Lucid 5.2.8, Slacko 6.3.2
Not working: Slacko 5.6, Precise 5.7.1

Maybe an indication of the cause: Command geany -v in Slacko 6.3.2 outputs
Geany-INFO: GTK 2.24.20, GLib 2.36.4
Same command in Slacko 5.6:
Geany-INFO: GTK 2.24.10, GLib 2.32.4
I can't think of any other reason than the GTK version.

@tallboy: I find nothing wrong with Recently Used or the Open/Save dialogs. The only thing that confuses me is that mounted partitions are not showing in Places.

@step: "Works as described" means what? I described 2 different behaviors. Only 1 can apply to Fatdog. Which one?

@greengeek: I couldn't make sense of your screenshot until belham2 posted. In my browser animated images are disabled by default. Question: The screenshot shows no mounted partitions, maybe there aren't any. Would they show if you mounted a device?

@ belham2: Check out SFR's Take a Shot!. I know that you know it since you posted in the TAS thread. In my version the feature is a bit hidden in extra options.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#9 Post by greengeek »

belham2 wrote:...tutorial (in "How-To' section on murga) on how you make/put a "gif-post-on-murga" together
Mochi is right about TAS - it makes it very easy to capture a series of frames in animated gif form. Takes a bit of practice to set the parameters so that the result is small enough to post. I suspect the extra bandwidth of such gifs could pose a problem for the forum but I think that is justified occasionally.
MochiMoppel wrote:Question: The screenshot shows no mounted partitions, maybe there aren't any. Would they show if you mounted a device?
Yes they do show once mounted:
Attachments
Chooser_with_partitions.jpg
(33.7 KiB) Downloaded 108 times
Chooser_hidden.jpg
(7.48 KiB) Downloaded 108 times
Chooser_unhidden.jpg
(21.08 KiB) Downloaded 108 times

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

Re: Strange differences in GtkFileChooserDialog

#10 Post by step »

My intention for "as described" was your last paragraph:
MochiMoppel wrote: ...
Below is a demo script. The button of top hides/unhides the chooser, which by default starts in /root. After unhiding it should revert to /root (or any other directory that has been selected). ...
Indeed that is the way your demo script works for Fatdog64. The button hides/unhides the chooser. Unhiding reveals the folder that was selected before hiding.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#11 Post by disciple »

Hi guys, have you compared which gvfs packages are included in each of these puppies?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#12 Post by disciple »

And which gvfs processes are running?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

Post Reply