gtk statusbar / statusbar gadget

Linux specific forum
frederic
User
User
Posts: 56
Joined: Thu Jan 05, 2006 11:22 pm

gtk statusbar / statusbar gadget

Post 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]
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post 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)
frederic
User
User
Posts: 56
Joined: Thu Jan 05, 2006 11:22 pm

Post by frederic »

a statusbar hasn't a gadgetid but a statusbarid
gadgetid/statusbarid ; it doesn't work
User avatar
oryaaaaa
Addict
Addict
Posts: 831
Joined: Mon Jan 12, 2004 11:40 pm
Location: Okazaki, JAPAN

Post 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))
frederic
User
User
Posts: 56
Joined: Thu Jan 05, 2006 11:22 pm

Post 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
Post Reply