GtkDialog fileselector Question

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
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

GtkDialog fileselector Question

#1 Post by RSH »

How can i make the gtkdialog fileselector showing only files with a given extension?

- how to make it shows only *.sfs
- how to make it shows only *.jpg
- how to make it shows only *.odt

etc.pp.
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

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

#2 Post by zigbert »

Code taken from the save-dialog of pmusic which shows only *.m3u files.

Code: Select all

	   <hbox>
	    <text><label>'$LOC281'</label></text>
	    <entry accept="file" width-request="300" fs-filters="*.m3u" fs-folder="'$DIR'" fs-title="Pmusic - '$LOC102'">
	     <variable>SAVEFILE</variable>
	     <input>cat '$WORKDIR'/last_added_playlist</input>
	    </entry>
	    <button>
	     <input file stock="gtk-open"></input>
	     <action type="fileselect">SAVEFILE</action>
	    </button>
	   </hbox>

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#3 Post by RSH »

zigbert wrote:Code taken from the save-dialog of pmusic which shows only *.m3u files.

Code: Select all

	   <hbox>
	    <text><label>'$LOC281'</label></text>
	    <entry accept="file" width-request="300" fs-filters="*.m3u" fs-folder="'$DIR'" fs-title="Pmusic - '$LOC102'">
	     <variable>SAVEFILE</variable>
	     <input>cat '$WORKDIR'/last_added_playlist</input>
	    </entry>
	    <button>
	     <input file stock="gtk-open"></input>
	     <action type="fileselect">SAVEFILE</action>
	    </button>
	   </hbox>
Thanks a lot, zigbert!

I know, i should have post my next question also in the first post - but did forget it. :oops:

Is there any possibility to combine these extensions/filters? So it does show f.e. *.jpg and *.png?
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

Post Reply