Page 1 of 1
gtk statusbar / statusbar gadget
Posted: Tue Jun 05, 2007 10:42 pm
by frederic
Hello, today i've a pb with a gadget.
I've seen some statusbar with a "grip" to resize window, after some research i've found this function
gtk_statusbar_set_has_resize_grip_
But the code below doesn't work. Maybe an error with handle.
Fred >> is exists a flag to activate this grip easily with CreateStatusBar command ?
Code: Select all
handle = CreateStatusBar(125, WindowID(254))
gtk_statusbar_set_has_resize_grip_ (handle, #True);
thanks[/list]
Posted: Wed Jun 06, 2007 12:56 pm
by walker
Handle in GTK must be ALWAYS a gadgetId (or windowid) and not the PB number of it...
Code: Select all
handle = CreateStatusBar(125, WindowID(254))
gtk_statusbar_set_has_resize_grip_ (gadgetID(handle), #True);
should work (asuming the window is resizeable)
Posted: Wed Jun 06, 2007 9:44 pm
by frederic
a statusbar hasn't a gadgetid but a statusbarid
gadgetid/statusbarid ; it doesn't work
Posted: Fri Jun 08, 2007 4:12 am
by oryaaaaa
StatusBarID is WidgetID?
not work
Code: Select all
CreateStatusBar(500, WindowID(#Window_PBinstall))
AddStatusBarField(600)
StatusBarText(500, 0, "TEST")
Debug StatusBarID(500)
gtk_container_set_resize_mode_(StatusBarID(500),2)
....
gtk_statusbar_set_has_resize_grip_(StatusBarID(500), #True)
Repeat
EventID=WindowEvent()
Delay(1)
Until EventID=#PB_Event_CloseWindow
Debug gtk_statusbar_get_has_resize_grip_(StatusBarID(500))
Posted: Tue Dec 11, 2007 10:29 am
by frederic
i come back with my statusbar pb
this code is working :
Code: Select all
ProcedureC DestroyHandler(*Widget, *UserData)
Debug "Window destroyed"
; Breaks the main event loop
gtk_main_quit_()
EndProcedure
gtk_init_(0,0)
Window = gtk_window_new_(#GTK_WINDOW_TOPLEVEL);
If Window
gtk_window_set_default_size_ (Window, 300, 200);
g_signal_connect_(Window, "destroy", @DestroyHandler(), 0)
vbox = gtk_vbox_new_ (#False, 5);
gtk_container_add_ (Window, vbox);
hStatus = gtk_statusbar_new_()
gtk_statusbar_set_has_resize_grip_(hStatus, #True);
gtk_box_pack_end_(vbox, hStatus, #False, #False, 0);
; This show the window and all its children
gtk_widget_show_all_(Window)
; All GTK applications must have a gtk_main(). Control ends here
; and waits for an event to occur (like a key press or
; mouse event).
gtk_main_();
Debug "Quit.."
EndIf
Now how to apply this to a classic pb window (openwindow) ??
thanks frederic