GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Sep 20, 2014 6:01 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to use gtkwindows as dialog
PostPosted: Mon Oct 29, 2012 2:25 pm 
Offline
Familiar Face

Joined: Mon Oct 29, 2012 1:30 pm
Posts: 16
Good morning to everyone.

I am a c programmer, I used a lot visual C++ in windows and I started with visual programming in Linux using GTK. These days I'm fighting with dialogs.

I built a program that open a main window (made with glade) and pushing a button open a "dialog". I don't use gtkdialog because I need a little more complex one (I us a treeview) so I built a second windows (with glade too)

Even if I set the modal property this new dialog is not modal. I can't switch between windows (as modal) but it return immediately (unlike modal)

I noticed that gtk_dialog_run function fails (return -1) and the debug window says:
Quote:
(contabil.exe:4368): GLib-GObject-WARNING **: invalid cast from `GtkWindow' to `GtkDialog' (contabil.exe:4368): Gtk-CRITICAL **: gtk_dialog_run: assertion `GTK_IS_DIALOG (dialog)' failed

Can you please help me? Thanks in advance
Wally


Top
 Profile  
 
 Post subject: Re: how to usa gtkwindows as dialog
PostPosted: Mon Oct 29, 2012 7:32 pm 
Offline
Never Seen the Sunlight

Joined: Wed Jul 23, 2008 10:31 am
Posts: 2406
Location: Slovenia
Hello and welcome to the GTK+ forums!

Your code fails because GtkWindow is not GtkDialog and you cannot use dialog's methods on windows (it is possible to do it in opposite way, since GtkDialog is derived from GtkWindow).

Now, are you sure you cannot use stock dialog? You can place just about anything inside it (area reserved for user content can be accessed usoing gtk_dialog_get_content_are().

Cheers,
Tadej


Top
 Profile  
 
 Post subject: Re: how to usa gtkwindows as dialog
PostPosted: Mon Oct 29, 2012 9:01 pm 
Offline
Familiar Face

Joined: Mon Oct 29, 2012 1:30 pm
Posts: 16
hi tadeboro and thanks about your greeting (as you can understand i'm not from "english" lands, so i don't know very well its slang...)

i thought to use gtkwindows because reading gtk reference manual i read gtkdialogs are very poor resources (read it http://developer.gnome.org/gtk3/3.4/GtkDialog.html)

anyway i realized (after a lot of google searches) i can add more resources than i imagined before, so i'm trying to enrich a simple dialog with more controls (or widget, as they are called)

i discovered it is very hard to find documentation about gtk in c language. sometimes it looks to me to try to follow tom thumb crumbs...

thanks again

wally


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

All times are UTC


Who is online

Users browsing this forum: Yahoo [Bot] and 4 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