Open GoogleCodeExporter opened 9 years ago
...yet again I fix it myself.
In TGTKGUIDriver's CreateGadget method, change the case for GADGET_BUTTON to
the following:
Case GADGET_BUTTON
gtkclass = GTK_BUTTON
Select(style)
Case BUTTON_RADIO,BUTTON_RADIO|BUTTON_PUSH
gtkclass = GTK_RADIOBUTTON
Case BUTTON_CHECKBOX,BUTTON_CHECKBOX|BUTTON_PUSH
gtkclass = GTK_CHECKBUTTON
Case BUTTON_OK
Case BUTTON_CANCEL
Case BUTTON_PUSH
End Select
And in gtkgadget.bmx, change TGTKButtonRadio;s CreateButton function to look
like this:
Function CreateButton:TGTKButtonRadio(x:Int, y:Int, w:Int, h:Int, label:String, group:TGadget,
style:Int)
Local this:TGTKButtonRadio = New TGTKButtonRadio
this.initButton(x, y, w, h, label, group, style)
If(style & BUTTON_PUSH)
gtk_toggle_button_set_mode(this.handle,false)
EndIf
Return this
End Function
and TGTKButtonCheckbox's CreateButton function to look like this:
Function CreateButton:TGTKButtonCheckbox(x:Int, y:Int, w:Int, h:Int, label:String, group:TGadget,
style:Int)
Local this:TGTKButtonCheckbox = New TGTKButtonCheckbox
this.initButton(x, y, w, h, label, group, style)
If(style & BUTTON_PUSH)
gtk_toggle_button_set_mode(this.handle,false)
EndIf
Return this
End Function
One last this is to add the definition of gtk_toggle_button_set_mode to the
file gtkcommon.bmx. The line
to insert there (I put it on line 135) is:
Function gtk_toggle_button_set_mode(widgetPtr:Byte Ptr, bool:Int)
The buttons now look and behave correctly.
Original comment by beta.da...@gmail.com
on 20 Apr 2010 at 3:10
Original issue reported on code.google.com by
beta.da...@gmail.com
on 2 Jan 2010 at 1:56