GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Oct 02, 2014 12:26 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Q: How to use a Gtk::FileFilter to restrict to PNG-files?
PostPosted: Sun Sep 25, 2005 6:21 am 
Offline
Familiar Face

Joined: Wed Sep 21, 2005 4:14 am
Posts: 17
Location: Aachen, Germany
Greetings everybody!

I want to enforce only PNG-files to be selected via a Gtk::FileChooser (or Gtk::FileChooserButton). From reading the API-reference of gtkmm I didn't get enough clues on Gtk::FileFilter to get it working. Furthermore I also didn't find a simple example for this on the web yet. Can anybody help out?

Thanks in advance for you time and kind advice!

Best regards...

MacSlow

_________________
First they ignore you...
then they laugh at you...
then they fight you...
then you win!
(Gandhi)


Top
 Profile  
 
 Post subject: insert brain...
PostPosted: Sun Sep 25, 2005 6:30 am 
Offline
Familiar Face

Joined: Wed Sep 21, 2005 4:14 am
Posts: 17
Location: Aachen, Germany
Well... in the future I should look at PyGTK-examples and derive the stuff I need for C++ from that. I just found an example and got it working. All I have to do to get the desired effect is:

Code:
...
Gtk::FileFilter pngFilter;
pngFilter.add_pattern ("*.png");
pngFilter.add_pattern ("*.PNG");
pFCB->add_filter (pngFilter);
pFCB->set_filter (pngFilter);
...


Best regards...

MacSlow

_________________
First they ignore you...
then they laugh at you...
then they fight you...
then you win!
(Gandhi)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group