GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Q: How to use a Gtk::FileFilter to restrict to PNG-files?

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
MacSlow
Familiar Face


Joined: 21 Sep 2005
Posts: 17
Location: Aachen, Germany

PostPosted: Sun Sep 25, 2005 6:21 am    Post subject: Q: How to use a Gtk::FileFilter to restrict to PNG-files? Reply with quote

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
Back to top
MacSlow
Familiar Face


Joined: 21 Sep 2005
Posts: 17
Location: Aachen, Germany

PostPosted: Sun Sep 25, 2005 6:30 am    Post subject: insert brain... Reply with quote

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: (Plaintext)
1
2
3
4
5
6
7
...
Gtk::FileFilter pngFilter;
pngFilter.add_pattern ("*.png");
pngFilter.add_pattern ("*.PNG");
pFCB->add_filter (pngFilter);
pFCB->set_filter (pngFilter);
...


Best regards...

MacSlow
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP