Re: Can anyone tell me how to make a floating window?



Hi Jack,

Jack Chen wrote:
Hi, can anyone please tell me how I can make a "floating window", a
window, dialog, or popup on top of my main window, like the one that
contains all the drawing tools and can be moved around in Photoshop?

Take a look at the docs for gtk_window_set_type_hint() and gtk_window_set_transient_for(). You make a regular GtkWindow, set the hints, link it to the parent, and then fill it with your tool buttons.

Also can someone please tell me how to do something like when you press
a button, for example - "settings", and then a new window pops up with
all the configuration options? I just need to know how to create a new
window and show it.

Very easy, something like:

 new_window = gtk_window_new( GTK_WINDOW_POPUP );
 gtk_window_set_transient_for( new_window, main_window );
 fill_window_with_stuff( new_window );
 gtk_widget_show( new_window );

You might find it helpful to look through another gtk application for tips. Gimp is huge, but really pretty easy to read.

John



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]