You are not logged in.

#1 2013-08-22 13:14:39

linux-ka
Member
From: ADL
Registered: 2010-05-07
Posts: 232

[Solved] [C++,Gtkmm2] custom FileFilter

Hi,

could some help me to understand how to create my own FileFitler entry?

The documentation just mentions the prototype of the function :

void Gtk::FileFilter::add_custom ( FileFilterFlags needed, const SlotCustom& slot 	)

But honestly, it doesn't help me much. Maybe there is some code sniplet out there demonstrating the application of this function. Unfortunatelly, I did not find anything on my way through the internet :-\

I would be glad, if someone could help me!!!

Cheers,

L-K

Last edited by linux-ka (2013-08-27 14:15:13)

Offline

#2 2013-08-26 21:48:31

n0stradamus
Member
Registered: 2010-11-08
Posts: 94
Website

Re: [Solved] [C++,Gtkmm2] custom FileFilter

Hey!

In advance: I am not very familiar with GTK and any of the smilarly named projects, but I felt like looking into it and found out a little that might just help you further smile

First of all, code that uses this function is indeed hard to find. But there seem to be a lot of wrappers for this UI toolkit in other languages.
Lots of sites show that the way for adding a custom FileFilter is just making an instance of one, assigning it a name and pattern
and passing that to the file selection dialog.
I have found the Vala gtkmm documentation to have a very good example for this.

Hopefully this helps smile

Offline

#3 2013-08-27 06:31:16

linux-ka
Member
From: ADL
Registered: 2010-05-07
Posts: 232

Re: [Solved] [C++,Gtkmm2] custom FileFilter

Thanks n0stradamus,

this somehow explains at least a bit what kind of parameter is expected, but it also lacks of examples....I guess I will ask on the Gtkmm page directly and post the solution later on (if there will be one)...

Offline

#4 2013-08-27 13:56:02

n0stradamus
Member
Registered: 2010-11-08
Posts: 94
Website

Re: [Solved] [C++,Gtkmm2] custom FileFilter

Alright, I hope that you'll find it out.
If you do so, why don't you post your findings here, so that at least one hit on google will be useful? smile

Offline

#5 2013-08-27 14:14:53

linux-ka
Member
From: ADL
Registered: 2010-05-07
Posts: 232

Re: [Solved] [C++,Gtkmm2] custom FileFilter

You are so right :-)

Since I was interested in setting a filter for specific file extensions (which are not covered by mime-types), I got the following repsonse via mailing-list; for the ease of application simply set the filter via

add_pattern("*.dat")

or any extension you might need. This works pretty good :-)

Last edited by linux-ka (2013-08-27 15:55:36)

Offline

Board footer

Powered by FluxBB