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 

openning a .pdf file by pressing a window button

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


Joined: 01 Mar 2010
Posts: 34
Location: India

PostPosted: Tue Mar 16, 2010 10:04 am    Post subject: openning a .pdf file by pressing a window button Reply with quote

I am new to Gtk How do i open a existing *.pdf file by pressing a window button and how do I create a file by pressing a window button in following code-Could any body please help


#include <gtk/gtk.h>
#include <glib.h>
#include <glib/gstdio.h>

int g_open(gchar *filename,
0, 0);

int
main( int argc,
char **argv )
{
GtkWidget *window,
*vbox,
*label,
*button;

gtk_init( &argc, &argv );

window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
g_signal_connect( G_OBJECT( window ), "destroy",
G_CALLBACK( gtk_main_quit ), NULL );

vbox = gtk_vbox_new( FALSE, 5 );
gtk_container_add( GTK_CONTAINER( window ), vbox );

label = gtk_label_new( "open a file by clicking the button below" );
gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, FALSE, 0 );

button = gtk_button_new_with_mnemonic( "Open file" );
g_signal_connect( G_OBJECT( button ), "clicked",
G_CALLBACK(g_open), NULL );
gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );

gtk_widget_show_all( window );

gtk_main();

return( 0 );
}
Back to top
Saniat
Familiar Face


Joined: 24 Dec 2009
Posts: 23

PostPosted: Tue Mar 16, 2010 10:33 am    Post subject: Reply with quote

Hi,
See this thread.this could be helpful for you.
http://www.gtkforums.com/viewtopic.php?t=3421&highlight=pdf+viewer

Saniat
Back to top
Turtel
Familiar Face


Joined: 01 Mar 2010
Posts: 34
Location: India

PostPosted: Wed Mar 17, 2010 5:56 am    Post subject: Reply with quote

Dear Saniat thanks for your response ...I am not sure how to include poppler-glib in my pkg-conf route...........
Is it possible to open a non pdf file easily or create any other file without adding more software into the computer..............
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