FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

libglade

 
Post new topic   Reply to topic     Forum Index -> gtkD
View previous topic :: View next topic  
Author Message
nikolai



Joined: 25 Aug 2007
Posts: 12

PostPosted: Sat Aug 25, 2007 1:29 pm    Post subject: libglade Reply with quote

hi
i compiled the glade test from the demos folder of gtkd preview 4, but when i run it and provide a *.glade file as an argument, then this is the output:

nikolai@nikolai-pc:~$ /home/nikolai/gtkD/gladeTest /home/nikolai/gui.glade
Loaded lib = libglade-2.0.so
Loaded lib = libgtk-x11-2.0.so
Loaded lib = libglib-2.0.so
Loaded lib = libatk-1.0.so
Loaded lib = libgobject-2.0.so
Loaded lib = libgdk-x11-2.0.so
Loader.Linker.link trying alternate lib <<<<<<<<< gdk_color_to_string
Loader.Linker.link trying alternate lib <<<<<<<<< gdk_window_beep
Loader.Linker.link trying alternate lib <<<<<<<<< gdk_threads_add_idle
Loader.Linker.link trying alternate lib <<<<<<<<< gdk_threads_add_idle_full
Loader.Linker.link trying alternate lib <<<<<<<<< gdk_threads_add_timeout
Loader.Linker.link trying alternate lib <<<<<<<<< gdk_threads_add_timeout_full
Loaded lib = libgthread-2.0.so
Loaded lib = libpango-1.0.so
loading /home/nikolai/win.glade

and then it does nothing, the program doesn't even exit.
what am i doing wrong? or do i maybe need a D binding for libglade, and if this is the case, where can i download it?

any help would be appreciated.
Question
Back to top
View user's profile Send private message
nikolai



Joined: 25 Aug 2007
Posts: 12

PostPosted: Mon Aug 27, 2007 7:26 am    Post subject: solved!!! Reply with quote

hello
i am sorry i even posted this. the reason i got this message is because i forgot to set the window visible in glade. please excuse me for being stupid, but i am a newbie and i dont know much yet.

nikolai Very Happy Smile
Back to top
View user's profile Send private message
okibi



Joined: 04 Jan 2007
Posts: 170

PostPosted: Mon Aug 27, 2007 8:53 am    Post subject: Reply with quote

That's quite alright. Everyone makes mistakes every now and then. Sometimes you just got to step away and come back to it, even if it is something "stupid". We've all done it...
Back to top
View user's profile Send private message
kaarna



Joined: 03 Apr 2006
Posts: 92
Location: Finland

PostPosted: Wed Aug 29, 2007 2:07 am    Post subject: Reply with quote

I do "mistakes" like that all the time. But glad to hear you got libglade working then? I haven't tested it on gtkD yet. It worked great for me back in my gtkmm days.
Back to top
View user's profile Send private message AIM Address MSN Messenger
nikolai



Joined: 25 Aug 2007
Posts: 12

PostPosted: Wed Aug 29, 2007 7:32 am    Post subject: Reply with quote

libglade works quite nicely, but it is a fraction slower than writing the gui by hand.
But is there someone who can tell me how i assign events to buttons created in Glade, and how to set my program to exit when pressing the close button in the top right corner, because at the moment when i run my program from a terminal i have to press ctrl - c to exit after pressing the close button.

nikolai
Back to top
View user's profile Send private message
okibi



Joined: 04 Jan 2007
Posts: 170

PostPosted: Wed Aug 29, 2007 11:06 am    Post subject: Reply with quote

I would overwrite the delete_event and connect it to the main window. This will catch whatever is going on and allow you to force it to close.
Back to top
View user's profile Send private message
nikolai



Joined: 25 Aug 2007
Posts: 12

PostPosted: Thu Aug 30, 2007 8:27 am    Post subject: Reply with quote

i am a newb, so could you please explain a bit more closely how to do that?
that would be very kind!

Nikolai
Back to top
View user's profile Send private message
okibi



Joined: 04 Jan 2007
Posts: 170

PostPosted: Fri Aug 31, 2007 9:16 am    Post subject: Reply with quote

For your MainWindow, simply apply the following:

Code:

addOnDelete(&delete_event);
addOnDestroy(&delete_event);


If you are using this() for your MainWindow, simply add those lines within, otherwise if you have a MainWindow called mainWin, add these:

Code:

mainWin.addOnDelete(&delete_event);
mainWin.addOnDestroy(&delete_event);


And then somewhere within your program, overwrite the delete_event with this function:

Code:

gint delete_event(Event event, Widget widget)
  {
    GtkD.exit(0);
  }


This will force the program to exit when they issue the close command or if they click the close button in the top right of the window.

Does that answer your questions?
Back to top
View user's profile Send private message
nikolai



Joined: 25 Aug 2007
Posts: 12

PostPosted: Fri Aug 31, 2007 1:55 pm    Post subject: Reply with quote

yes, thank you Exclamation Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> gtkD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group