doyle
New Member
Posts: 44
|
Post by doyle on Apr 11, 2010 19:41:38 GMT 1
OK, I give up! I'm using a gtk_vpaned_new and want to be able to get/set the position of the splitter. I need to know the current window size for this to work, so... how do I do this? Believe me, I've tried. I can get the screen and the default size but I need to be able to get the size when/if the user changes it. I even tried the "frame-event" signal but I don't know how to do this in BaCON it seems. Hints, tips, code, etc. appreciated. Thanks Doyle
|
|
airr
New Member
Posts: 47
|
Post by airr on Apr 12, 2010 5:17:49 GMT 1
Try using "expose-event", and in your callback access the widget->allocation.width and widget->allocation.height fields of the GtkWidget structure....
A.
|
|
|
Post by Pjot on Apr 12, 2010 6:38:18 GMT 1
Doyle, You can use gtk_window_get_size for that. Make sure the arguments provide the address of the variables. Some code to help you: DECLARE xs, ys
IMPORT "gtk_init(int*,void*)" FROM lib_Gtk$ TYPE void IMPORT "gtk_window_get_size(long,long,long)" FROM lib_Gtk$ TYPE void IMPORT "gtk_window_new(int)" FROM lib_Gtk$ TYPE long
gtk_init(0, 0) win = gtk_window_new(0)
[.....more code.....]
gtk_window_get_size(win, ADDRESS(xs), ADDRESS(ys))
PRINT xs PRINT ys
Peter
|
|
doyle
New Member
Posts: 44
|
Post by doyle on Apr 17, 2010 1:17:37 GMT 1
Doyle, You can use gtk_window_get_size for that. Make sure the arguments provide the address of the variables. Some code to help you: DECLARE xs, ys
IMPORT "gtk_init(int*,void*)" FROM lib_Gtk$ TYPE void IMPORT "gtk_window_get_size(long,long,long)" FROM lib_Gtk$ TYPE void IMPORT "gtk_window_new(int)" FROM lib_Gtk$ TYPE long
gtk_init(0, 0) win = gtk_window_new(0)
[.....more code.....]
gtk_window_get_size(win, ADDRESS(xs), ADDRESS(ys))
PRINT xs PRINT ys
Peter Thanks Peter, don't know how I missed that one. Doyle
|
|