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.

Hi Brucey,

Thanks for the update, however it seems SetPanelColor() appears to have been broken in the meantime...

SuperStrict

Rem
SetPanelColor() doesn't appear to work with none, PANEL_BORDER, or PANEL_GROUP...
EndRem

Framework bah.gtkmaxgui

Global wndMain:TGadget = CreateWindow("Test Window",100,100,400,300,Null,WINDOW_TITLEBAR)

	Global gadPanel:TGadget = CreatePanel(10,10,300,200,wndMain,PANEL_BORDER)
	SetPanelColor(gadPanel,200,255,200)

Repeat

	Select WaitEvent()

		Case EVENT_WINDOWCLOSE;End

	EndSelect

Forever


It might be my new linux set-up but I remember it used to work before syncmods. Also you know this...

Improved gadget positioning - no negative coords!.

Well, what do you actually mean... Do you mean gadgets can't be drawn at negative co-ordinates. If so, how would I be able to tweak GTKMaxGUI to disable this for Max'd GUI so that I can draw gadgets at -ve co-ordinates.

Also Brucey, I was wondering if I could pick your brains. Is there a way in GTK for me to make gadgets "see-through". I don't literally mean setting the transparency, but can you make a gadget not "suck-up" mouse-clicks so that the parent containers will receive them instead. (Let me give an example...)

I.e. if a button is drawn on a panel, would I be able to still display the button, but when the mouse moves over the button, the parent panel underneath still fires EVENT_MOUSEMOVE events while over the button. In Windows, I can acheive this by disabling the gadget (and as a kind of side effect, Windows seems to automatically pass events to the parent gadget)...

Finally, I can't get a HTML gadget to show with either module (GTKHTML or Mozilla). Mozilla still reports the above error message and GTKHTML compiles, but just displays a blank window...

I tried the example from the MaxGUI docs and I get the same effect (which I've pasted here for quick reference)...

 createhtmlview.bmx

Framework BaH.GTKMaxGUI
Import BaH.gtkwebgtkhtml

Rem
HTML Gadget won't show - just blank window as if nothing
was on it...
EndRem

Strict 

Local window:TGadget
Local htmlview:TGadget

window=CreateWindow("My Window",30,20,600,440,,15|WINDOW_ACCEPTFILES)

htmlview=CreateHTMLView(0,0,ClientWidth(window),ClientHeight(window),window)
SetGadgetLayout htmlview,1,1,1,1 

HtmlViewGo htmlview,"http://www.blitzmax.com"

While WaitEvent()
	Print CurrentEvent.ToString()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			End
	End Select
Wend


Thank - you so much...


Seb