some gtk2 code

Miscellaneous Forums/Linux Discussion/some gtk2 code

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Another bug report for you Brucey, although it's not really a bug, more of an inconsistency...

Basically, in Win32, Cocoa, and FLTK, changing a gadget's properties programatically (e.g. using SetGadgetText(), SetButtonState() ) doesn't trigger a GAGDET_ACTION event. However in GTK, it does.

Framework BaH.GTKMaxGUI
'Framework BRL.FLTKMaxGUI
Import BRL.Timer

Global wndMain:TGadget = CreateWindow("Hello",100,100,400,300,Null,15)
	Global gadTextBox:TGadget = CreateTextField(10,10,370,20,wndMain)
	Global gadCheckBox:TGadget = CreateButton("Test Checkbox",10,30,370,20,wndMain,BUTTON_CHECKBOX)
	
	CreateTimer(1)
	
Global varSwitch:Int = 0

Repeat

	Select WaitEvent()
		
		Case EVENT_WINDOWCLOSE;End
		
		Case EVENT_TIMERTICK
		
			If varSwitch = 0 Then
		
			SetButtonState(gadCheckBox,1)
			SetGadgetText(gadTextBox,"Test Text")
			varSwitch = 1
			
			Else
			
			SetButtonState(gadCheckBox,0)
			SetGadgetText(gadTextBox,"")
			varSwitch = 0
			
			EndIf
		
	EndSelect
	
	DebugLog CurrentEvent.toString$()
	
Forever


Have a look at the debug log as the gadgets are changed with a) FLTK and then b) GTK.

Cheers Brucey

Seb